-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
initialize test suite for git fetchers #9676
Conversation
84af38d
to
73ae9ab
Compare
}]; | ||
}; | ||
in | ||
evaled.config.result; |
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.
We should have such functionality upstream.
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.
Is that a requirement for getting this PR merged?
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 really. This is going to sound harsh, but you could remove it instead.
By doing this here, it feels like we're done, but we've really just created an ad hoc implementation that we wouldn't really want to develop new feature for. It deserves a better place than this! I'd be happy to review the same functionality in Nixpkgs. Meanwhile, you can unblock this PR by simplifying it.
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.
Alright, I removed the logic that exports the test cases as individual derivations
Added some changes: fetchGit: add simple test for ssh fetching Also move tests to separate files which are auto-imported. This should allow people adding tests concurrently without introducing merge conflicts |
solves NixOS#9388 This utilizes nixos vm tests to allow: - writing tests for fetchTree and fetchGit involving actual networking. - writing small independent test cases by automating local and remote repository setup per test case. This adds: - a gitea module setting up a gitea server - a setup module that simplifies writing test cases by automating the repo setup. - a simple git http test case Other improvements: For all nixos tests, add capability of overriding the nix version to test against. This should make it easier to prevent regressions. If a new test is added it can simply be ran against any older nix version without having to backport the test. For example, for running the container tests against nix 2.12.0: `nix build "$(nix eval --raw .#hydraJobs.tests.containers --impure --apply 't: (t.forNix "2.12.0").drvPath')^*" -L`
1e82908
to
2cd6f1c
Compare
Also move tests to separate files which are auto-imported. This should allow people adding tests concurrently without introducing merge conflicts
1918bd2
to
78074bd
Compare
Memoization is for thunk-like behavior whereas this is executed eagerly.
Thanks @DavHau. It's really nice to have much more robust tests for this stuff. |
Great, now what's missing is that these tests get actually run for PRs |
initialize test suite for git fetchers (cherry picked from commit 0bd9e10) Change-Id: Idf94a47794190c3e1de07fc4e7848741c4e9ffed
solves #9388
This utilizes nixos vm tests to allow:
This adds:
Other improvements:
For all nixos tests, add capability of overriding the nix version to test against.
This should make it easier to prevent regressions. If a new test is added it can simply be ran against any older nix version without having to backport the test.
For example, for running the container tests against nix 2.12.0:
nix build "$(nix eval --raw .#hydraJobs.tests.containers --impure --apply 't: (t.forNix "2.12.0").drvPath')^*" -L
cc @roberth as you were involved in the discussion and provided directions.