Skip to content

tests: add regression test for warnings + assertions#2100

Merged
mergify[bot] merged 1 commit intonix-community:mainfrom
MattSturgeon:test_tests
Aug 28, 2024
Merged

tests: add regression test for warnings + assertions#2100
mergify[bot] merged 1 commit intonix-community:mainfrom
MattSturgeon:test_tests

Conversation

@MattSturgeon
Copy link
Copy Markdown
Member

@MattSturgeon MattSturgeon commented Aug 27, 2024

Follow up to #2097, #2076, & #2048.

Expand "failing-tests" to also ensure warnings & assertions are correctly handled by mkTestDerivationFromNixvimModule.

Also did some minor cleanup:

  • Call failing-tests.nix using pkgs.callPackage
  • Replace repetive use of testBuildFailure with a wrapper
    mkFailingNixvimTest

You can run just the "failing" tests by using:

nix build .#checks.x86_64-linux.failing-tests

# Or for more detail:
nix build --show-trace --print-build-logs --verbose \
  .#checks.x86_64-linux.failing-tests

You can also use the entries passthu to access a specific sub-test:

nix build .#checks.x86_64-linux.failing-tests.entries.fail-on-assertions

(tab-completion can help here)

See also, linkFarmFromDrvs

Ensure `mkTestDerivationFromNixvimModule` correctly test warnings & assertions.

Also did some minor cleanup:
- Call `failing-tests.nix` using `pkgs.callPackage`
- Replace repetive use of `testBuildFailure` with a wrapper
  `mkFailingNixvimTest`
Copy link
Copy Markdown
Contributor

@khaneliman khaneliman left a comment

Choose a reason for hiding this comment

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

LGTM, this is giving me ideas about negative test cases...

@MattSturgeon

This comment was marked as resolved.

@mergify

This comment was marked as resolved.

@mergify mergify bot merged commit 1c879ec into nix-community:main Aug 28, 2024
@MattSturgeon MattSturgeon deleted the test_tests branch August 28, 2024 04:44
@MattSturgeon
Copy link
Copy Markdown
Member Author

this is giving me ideas about negative test cases...

I think most negative tests can be achieved by setting assertions in a test module, but more advanced ones can be done with a custom runCommand test or even a testBuildFailure wrapped failing derivation.

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.

2 participants