Skip to content

Run the functional tests in a NixOS environment#10922

Merged
Ericson2314 merged 15 commits intoNixOS:masterfrom
hercules-ci:functional-tests-on-nixos
Jun 24, 2024
Merged

Run the functional tests in a NixOS environment#10922
Ericson2314 merged 15 commits intoNixOS:masterfrom
hercules-ci:functional-tests-on-nixos

Conversation

@roberth
Copy link
Member

@roberth roberth commented Jun 16, 2024

Motivation

By running the functional tests also in a mostly normal NixOS environment, we increase our test coverage.

This reproduces

It also allows for testing

Context

  • Rewrite of most of Run test suite on NixOS #7778

  • Possible follow-ups:

    • A VM test with many features enabled
    • Some sudo action in the functional tests
    • Maybe move some stand-alone VM test scripts into the functional tests, if that's better?

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions bot added documentation contributor-experience Developer experience for Nix contributors with-tests Issues related to testing. PRs with tests have some priority labels Jun 16, 2024
@roberth roberth mentioned this pull request Jun 16, 2024
14 tasks
@fricklerhandwerk
Copy link
Contributor

Indeed I discussed just this sort of change with @tfc recently, and I'd take a slightly different architectural approach: instead of including environment-dependent setup/teardown, source the script itself from each environment. WDYT?

@roberth
Copy link
Member Author

roberth commented Jun 17, 2024

instead of including environment-dependent setup/teardown, source the script itself from each environment. WDYT?

The implementation and benefit of this idea are unclear to me.

I have not changed the architecture to keep the diff manageable, so I'd like to proceed with this and refactor later.

@fricklerhandwerk
Copy link
Contributor

Discussed in Nix maintainer meeting:

  • looks good generally
  • have to figure out better patterns to set up environments as we go
  • eventually we'd also want the noGC etc. outputs separately as well, currently they're only in Hydra jobs

@Ericson2314 Ericson2314 enabled auto-merge June 17, 2024 12:18
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-06-17-nix-team-meeting-minutes-153/47186/1

@roberth roberth force-pushed the functional-tests-on-nixos branch from 3b4c254 to 18f602d Compare June 19, 2024 19:47
@roberth roberth force-pushed the functional-tests-on-nixos branch from 83871c8 to dcee46a Compare June 20, 2024 13:00
@fricklerhandwerk
Copy link
Contributor

@roberth IMO you can self-merge once it's all green.

…ion"

ShellCheck doesn't want us to add extra parentheses for show.

This reverts commit 7c9f3ee.
@roberth roberth force-pushed the functional-tests-on-nixos branch from cb96b87 to d968466 Compare June 20, 2024 20:32
Comment on lines 13 to 16
die() {
echo "fatal error: $*" >&2
exit 1
}
Copy link
Member

Choose a reason for hiding this comment

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

isn't this like fail?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't aware, but it is similar. fail doesn't prefix anything.
They do seem to differ a bit in their use cases, which suggests that their behavior could be differentiated more. Perhaps:

  • die: echo "fatal error in test setup: $*"
  • fail: echo "test failed: $*"

@roberth roberth force-pushed the functional-tests-on-nixos branch from d70a198 to bacd9fc Compare June 24, 2024 17:05
@roberth roberth force-pushed the functional-tests-on-nixos branch from bacd9fc to 445a4a0 Compare June 24, 2024 17:05
@Ericson2314 Ericson2314 merged commit 5c497a9 into NixOS:master Jun 24, 2024
@roberth
Copy link
Member Author

roberth commented Jun 24, 2024

The extra swap appears to handle the extra evaluations with no significant slowdown 🎉

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-06-24-nix-team-meeting-minutes-155/47739/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor-experience Developer experience for Nix contributors documentation with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants