-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
nixos/tests/hydra: build a trivial derivation #40729
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
Conversation
@GrahamcOfBorg test hydra |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: tests.hydra Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: tests.hydra Partial log (click to expand)
|
@spacefrogg @grahamc I don't need to set |
nixos/tests/hydra/default.nix
Outdated
|
||
{ | ||
virtualisation.memorySize = 1024; | ||
environment.systemPackages = [ createTrivialProject pkgs.jq ]; |
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.
Adding time.timeZone = "UTC";
here will eliminate ugly time zone warnings from the test log.
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.
I'm not able to find these warnings. Could you paste an example? Are they in the nix-build output or in the generated html test log?
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.
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.
Ok, fixed thanks (this is only visible with sandboxed builds).
nixos/tests/hydra/default.nix
Outdated
$machine->succeed("create-trivial-project.sh"); | ||
|
||
# make sure the build as been successfully built | ||
$machine->waitUntilSucceeds('curl -L -s http://localhost:3000/build/1 -H "Accept: application/json" | jq .buildstatus | xargs test 0 -eq'); |
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.
The test seems non-deterministic on my local machine: it succeeds the first time but then fails on repeated runs, because the jobset is unchanged and skipped by hydra, so it waits here until the waitUntilSucceeds
times out .
You could fix this by artifically changing the derivation hash of the trivial
derivation on every test run, for instance by making some attribute depend on current time or a random value.
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.
It is also sometimes failing on my machine... When it fails, in the test log, there is:
machine# [ 47.021598] hydra-queue-runner[1167]: marking build 1 as failed
And the log of the build is:
<3>builder for '/nix/store/nfmhzq2sv51qn1mh0lfmkpiwpk8dc2v5-trivial.drv' failed due to signal 9 (Killed)
But the output path has been produced even if the job is marked as failed. It seems this is related to Hydra and not to Nix.
Note also if I restart the job, it succeeds...
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.
@xeji I've fixed the non deterministic issue I encountered. Could you try again?
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.
Thanks, non-deterministic failure seems gone here too. Looks good now.
For the non deterministic failure, see NixOS/nix#2176. |
A script is used to create a project, and configure a jobset. This jobset fetches a local file containing a trivial Nix expression. The test script makes sure this derivation has been successfully built by Hydra.
@GrahamcOfBorg test hydra |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: tests.hydra Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: tests.hydra Partial log (click to expand)
|
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.
This is great!
A script is used to create a project, and configure a jobset. This
jobset fetches a local file containing a trivial Nix expression. The
test script makes sure this derivation has been successfully built by
Hydra.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)