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

Add flag to build package passthru.tests #397

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

Conversation

B4dM4n
Copy link
Contributor

@B4dM4n B4dM4n commented Apr 10, 2024

This PR adds a --tests flag to build passthru.tests for all packages, as discussed in #77.

The tests to be build can be filtered with -p, -P and similar, like all other packages.

$ nixpkgs-review pr --tests 303033
...
Link to currently reviewing PR:
https://github.com/NixOS/nixpkgs/pull/303033

1 tests built:
netbird.passthru.tests.netbird

2 packages built:
netbird netbird-ui
...
$ nixpkgs-review pr --tests --package-regex 'netbird.+' 303033
...
1 tests built:
netbird.passthru.tests.netbird

1 package built:
netbird-ui
...

Since they are classified as tests, they can also be enabled individually with -p, without specifying --tests:

$ nixpkgs-review pr -p netbird.passthru.tests.netbird 303033
...
1 tests built:
netbird.passthru.tests.netbird
...

Fixes: #77

Until now, failed tests would not be reported separately and simply shown in the
"tests build" list.
build_passthru_tests=build_passthru_tests,
)
changed_packages = set(
changed_attrs[path].name for path in changed_attrs.keys()
Copy link
Owner

@Mic92 Mic92 Apr 25, 2024

Choose a reason for hiding this comment

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

Sorry for the late reply. I think because of the potential large memory consumption of nixos tests, we need to evaluate them isolation as they will otherwise make the build potentially go out of memory, i.e. if you try to have a large package set rebuild.
Therefore I would suggest to evaluate those packages ahead of time i.e. using nix-instantiate and add them to the final nix build. Of course a better design would be some sort of pipe-lining where already evaluated packages gets build as the rest of the evaluation is still in progress. But this probably requires bigger refactorings and could implemented at a later point similar to nix-fast-build. When using nix-instantiate also add a gcroot with --add-root to make sure that derivations are not garbage collected before hand.

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.

Feature request: Build passthru.tests automatically
2 participants