aboutsummaryrefslogtreecommitdiff
path: root/tests/check-refs.sh
AgeCommit message (Collapse)Author
2023-08-07Stabilize `discard-references`Théophane Hufschmitt
It has been there for a few releases now (landed in 2.14.0), doesn't seem to cause any major issue and is wanted in a few places (https://github.com/NixOS/nix/pull/7087#issuecomment-1544471346).
2023-03-08Harden tests' bashJohn Ericson
Use `set -u` and `set -o pipefail` to catch accidental mistakes and failures more strongly. - `set -u` catches the use of undefined variables - `set -o pipefail` catches failures (like `set -e`) earlier in the pipeline. This makes the tests a bit more robust. It is nice to read code not worrying about these spurious success paths (via uncaught) errors undermining the tests. Indeed, I caught some bugs doing this. There are a few tests where we run a command that should fail, and then search its output to make sure the failure message is one that we expect. Before, since the `grep` was the last command in the pipeline the exit code of those failing programs was silently ignored. Now with `set -o pipefail` it won't be, and we have to do something so the expected failure doesn't accidentally fail the test. To do that we use `expect` and a new `expectStderr` to check for the exact failing exit code. See the comments on each for why. `grep -q` is replaced with `grepQuiet`, see the comments on that function for why. `grep -v` when we just want the exit code is replaced with `grepInverse, see the comments on that function for why. `grep -q -v` together is, surprise surprise, replaced with `grepQuietInverse`, which is both combined. Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-01-03`unsafeDiscardReferences`Naïm Favier
Adds a new boolean structured attribute `outputChecks.<output>.unsafeDiscardReferences` which disables scanning an output for runtime references. __structuredAttrs = true; outputChecks.out.unsafeDiscardReferences = true; This is useful when creating filesystem images containing their own embedded Nix store: they are self-contained blobs of data with no runtime dependencies. Setting this attribute requires the experimental feature `discard-references` to be enabled.
2018-10-27Restore old (dis)allowedRequisites behaviour for self-referencesEelco Dolstra
stdenv relies on this. So ignore self-references (but only in legacy non-structured attributes mode).
2014-08-28Add disallowedReferences / disallowedRequisitesEelco Dolstra
For the "stdenv accidentally referring to bootstrap-tools", it seems easier to specify the path that we don't want to depend on, e.g. disallowedRequisites = [ bootstrapTools ];
2014-08-21Fix testsEelco Dolstra
So all these years I was totally deluded about the meaning of "set -e". You might think that it causes statements like "false && true" or "! true" to fail, but it doesn't...
2011-10-10* Refactoring: remove unnecessary variables from the tests.Eelco Dolstra
2006-10-19* Checks for allowedReferences and some other features.Eelco Dolstra
* Use nix-build in a test.