Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompletion bento config tests #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

noorassi01
Copy link
Collaborator

I only added tests that check if the version is correct (only accepts 1 or 2). I tried to write a test that checks if the right options are suggested after choosing the version. For example, if version 2 is chosen, the suggestion should be "services" and not "api-server". I wrote the following tests:

 it('should not allow for "api_server" if version 2 is selected', async () => {
    const bentoFile = `
        # invalid version
        version: 2
        api_server:
            workers: 4
            backlog: 128
        `;
    const valid = validateBentoConfigFile(bentoFile);
    assert.strictEqual(valid, false);
  });
  it('should not allow for "services" if version 1 is selected', async () => {
    const bentoFile = `
        # invalid version
        version: 1
        services:
          resources:
            cpu: "2"
            memory: "4GB"
            gpu: 1
        `;
    const valid = validateBentoConfigFile(bentoFile);
    assert.strictEqual(valid, false);
  });

However, these tests fail since the yaml file accepts using "services" with version 1, it just does not autocomplete it. Let me know if you have any suggestions on how to test this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant