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

chore: add server tests for dryrun query parameter #112

Merged
merged 4 commits into from
Dec 20, 2023

Conversation

svienot
Copy link
Contributor

@svienot svienot commented Dec 19, 2023

Description:

Add tests for the dryrun query parameter recently added to the /session/input-files and /session/verify-checked API endpoints.

Related issue(s):

Fixes #93

@svienot svienot requested review from a team as code owners December 19, 2023 13:48
@svienot svienot requested review from quiet-node, Sheng-Long, acuarica, a team, ericleponner and Nana-EC and removed request for a team, quiet-node and Sheng-Long December 19, 2023 13:48
Copy link
Contributor

@ericleponner ericleponner left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@acuarica acuarica left a comment

Choose a reason for hiding this comment

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

lgtm, just left a few comments

test/server.js Outdated Show resolved Hide resolved
test/helpers/assertions.js Show resolved Hide resolved
Copy link
Contributor

@acuarica acuarica left a comment

Choose a reason for hiding this comment

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

Is it possible that these tests are not idempotent? I'm running the test multiple times, and it fails the second time.

  1) Server
       session api verification
         should not store the successful verification result when the query parameter dryrun=true is provided:

      Contract should not have been saved

@svienot
Copy link
Contributor Author

svienot commented Dec 19, 2023

@acuarica I do not see this issue when running the test several times (I do that interactively within IntelliJ).
These tests are supposed to be idempotent thanks to the beforeEach() clause of this module, which wipes out the repository ( rimraf.sync(server.repository) ). So we should be good.

@svienot svienot force-pushed the 93-test-dry-run-query-parameter branch from 643d5b8 to 2c3606b Compare December 19, 2023 21:42
@svienot svienot requested a review from acuarica December 19, 2023 21:43
Copy link
Contributor

@acuarica acuarica left a comment

Choose a reason for hiding this comment

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

lg

@svienot svienot merged commit 6604f16 into main Dec 20, 2023
6 checks passed
@svienot svienot deleted the 93-test-dry-run-query-parameter branch December 20, 2023 16:27
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.

Add tests covering the REST API
3 participants