Skip to content

nixos/test-driver: fix #153766#153866

Closed
Synthetica9 wants to merge 3 commits intoNixOS:masterfrom
Synthetica9:explicit-output-test-driver
Closed

nixos/test-driver: fix #153766#153866
Synthetica9 wants to merge 3 commits intoNixOS:masterfrom
Synthetica9:explicit-output-test-driver

Conversation

@Synthetica9
Copy link
Member

Motivation for this change

Fixes #153766, alternative to #153854

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@Synthetica9 Synthetica9 requested a review from tfc as a code owner January 7, 2022 16:48
@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Jan 7, 2022
@Synthetica9 Synthetica9 added the 6.topic: testing Tooling for automated testing of packages and modules label Jan 7, 2022
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jan 7, 2022
Copy link
Contributor

Choose a reason for hiding this comment

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

I also thought about making the out-dir an optional parameter, defaulting to the PWD. Now the problem I thought of was, if a user runs the driver inside a directory without write-permission. The test-run will fail pretty late i.e. when screenshot or copy_from_vm is called. I found it nicer to fail as early as possible. The case can occur e.g. when someone does this:

nix-build . -A nixosTests.<test>.driver
cd result/bin
./nixos-test-driver

Here the result dir is a symlink to the nix store obviously...

Copy link
Member Author

Choose a reason for hiding this comment

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

agree, but I think that check should be happening in the initialization of Driver, not in parsing the arguments. I rebased and pushed a new commit to fix this, please verify

@Synthetica9 Synthetica9 force-pushed the explicit-output-test-driver branch from 901c109 to 28fa06f Compare January 11, 2022 12:29
@Synthetica9 Synthetica9 force-pushed the explicit-output-test-driver branch from 28fa06f to adf0844 Compare January 11, 2022 12:43
@marijanp
Copy link
Contributor

Can we get rid of all accesses to environment variables, I already did that in https://github.com/NixOS/nixpkgs/pull/153854/files
And you will also need @tfc s approval as he's the code owner

@tfc
Copy link
Contributor

tfc commented Jan 24, 2022

Hi, i tend to prefer the other PR, because it is already cleaned out from env var usage, and doesn't mix in the image stuff (which should be individually tested and merged for the record imho).

@Synthetica9
Copy link
Member Author

I have some thoughts on the other one, but I'll leave them there.

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

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: testing Tooling for automated testing of packages and modules 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nixos/test-driver: "bare" driver crashes when $out env var is not a writable directory

3 participants