-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Source filtering and disabling tests (to later run them externally) #7870
base: master
Are you sure you want to change the base?
Conversation
Not sure about the source filtering. That seems like a fair amount of complexity for a somewhat uncommon use case. It would be nice when hacking on the VM tests (usually I use The ability to disable tests looks useful, maybe that could be a separate PR? |
Sorry, didn't mean to hit "close". |
Based on the discussion in #7847 last time, where we mentioned doing filtering as a prelude to moving things around to avoid needing the filtering, I think we definitely want to do this next. |
While I want to agree, as any solution to the rebuilds problem would be helpful, I think we did agree on the goal of moving things, in which case this PR is a bit redundant. My interpretation of the meeting is that we minimize the amount of work done during the move, but we do perform the move (soon?). |
Now that we have positive source filtering, should this be rebased? |
Had to reindent the filter, so here's a link to view the files with whitespace changes hidden. |
imports = [ | ||
test | ||
# For fast cycle when you don't need the regular tests: | ||
# (useNixWithoutRegularTests system) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not enabled by default because it does duplicate the compilation work if you want to run both VM and non-VM tests. (I figured I'd be over-explaining by adding that sentence to the code)
Motivation
Prevent unnecessary rebuilds by including only relevant files. This speeds up the builds of anything that depends on the main build
Provide a solid foundation for working on tests that are run in a test environment that is outside the build of
nix
itself, catching bugs and preventing regressions that can't be detected there.Context
Additive or negative filtering
The source filtering approach is constructive instead of based on the removal of specific files. This is a best practice because it does not allow newly added files to accidentally cause unnecessary rebuilds. While a ~20 item list doesn't look great, it is hardly worse than the alternative, which is the removal of 8 files and 4 directory. Furthermore, new additions will typically not need inclusion into the main build, as the main build's tooling is already established and most additions of tooling will be for items that aren't part of the main build, such as the python bindings, or the docker image earlier.
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests
tests/nixos/*