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

Move nixos tests #7648

Merged
merged 3 commits into from
Jan 27, 2023
Merged

Move nixos tests #7648

merged 3 commits into from
Jan 27, 2023

Conversation

roberth
Copy link
Member

@roberth roberth commented Jan 20, 2023

Motivation

  • Move the integration tests together into a single directory, so that they're easier to find.

  • Use NixOS's public interface for calling the tests

Context

This came up in the final review of the PR template, #7577.

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • N/A: no logic added
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests
  • documentation in the manual
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or bug fix: updated release notes

This will allow contributors to find them more easily.
Copy link
Member

@thufschmitt thufschmitt left a comment

Choose a reason for hiding this comment

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

Not sure about the specifics of the changes whithin the tests, but moving them to a dedicated place and simplifying the flake a bit are welcome changes 👍

imports = [ test ];
hostPkgs = nixpkgsFor.${system};
defaults = {
nixpkgs.pkgs = nixpkgsFor.${system};
Copy link
Member Author

Choose a reason for hiding this comment

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

Tested with the assertion

          assertions = [ { assertion = config.nix.package.drvPath == self.packages.${system}.default.drvPath; message = "Unexpected nix.package"; } ];

and checked that the assertion runs. ✔️
I'm not adding the assertion, because we may want to write a test which uses an older nix daemon. In other words the validity of the assertion is somewhat coincidental.

flake.nix Outdated Show resolved Hide resolved
Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

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

This is nice clean up

@thufschmitt thufschmitt merged commit ccaadc9 into NixOS:master Jan 27, 2023
@roberth roberth mentioned this pull request Feb 26, 2023
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.

4 participants