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

introduce automated (integration) tests for the node module #12

Merged
merged 30 commits into from
Jun 29, 2024

Conversation

Varun0157
Copy link
Collaborator

  • increments the exit code for each "failure"
  • tests the requests in a stated bundle
  • requests whose name contain the word positive, are expected to have all their tests pass
  • requests whose name contain the word negative, are expected to have all their tests fail
  • first, we calculate the expected number of tests, and compare it with the received number of results, to ensure a situation like the regression on status checks does not occur again.

@Varun0157 Varun0157 linked an issue Jun 18, 2024 that may be closed by this pull request
@Varun0157 Varun0157 requested a review from vasan-agrostar June 18, 2024 21:50
Copy link
Collaborator

@vasan-agrostar vasan-agrostar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I would like the test code to be as simple as possible. I realize lots of code has been copied over from the CLI, but is not needed. Keeping the test code to the bare minimum and less complex (I was hoping a single file) makes us confident that when something fails, it is not in the test code. Otherwise we spend debugging the test code too, which defeats the purpose of automated testing.

tests/integration.test.ts Outdated Show resolved Hide resolved
tests/runTests.ts Show resolved Hide resolved
tests/runTests.ts Outdated Show resolved Hide resolved
tests/utils/fileContents.ts Outdated Show resolved Hide resolved

const VARFILE_EXTENSION = ".zzv";

function getVarFilePaths(dirPath: string): string[] {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us not read extra variables from files. These probably will go into the testing of the runner rather than zzapi itself.

The idea is to simplify test code. If the test code itself is not simple, when something fails, we will not be sure if the test code has a bug or the module has a bug.

Try and simplify it as much as you can. Bare minimum, only to test the functionality that this module provides, nothing more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading variables from varFiles is still the job of the module right? The runner just gets the content and passes it to the module.

I will attempt to simplify the code.

@vasansr vasansr merged commit 069fdd7 into main Jun 29, 2024
2 checks passed
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.

Automated tests using Jest
3 participants