aboutsummaryrefslogtreecommitdiff
path: root/tests/multiple-outputs.sh
AgeCommit message (Collapse)Author
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-18Add some tests for illegal output namesEelco Dolstra
2021-10-13tests/multiple-outputs.sh: Assert empty storeEelco Dolstra
2021-07-27Allow running all the tests with the daemonregnat
When `NIX_DAEMON_PACKAGE` is set, make all the tests use the Nix daemon. That way we can test every piece of Nix functionality both with and without the daemon. Tests for which using the daemon isn’t possible or doesn’t make sens can selectively be disabled with `needLocalStore`
2021-01-11Add 'nix store delete' commandEelco Dolstra
2020-08-07Squashed get CA derivations buildingJohn Ericson
2017-11-24nix-shell/nix-build: Support .drv files againEelco Dolstra
Fixes #1663. Also handle '!<output-name>' (#1694).
2017-11-20Test: Replace --option with the corresponding flagEelco Dolstra
2017-08-31Rename a few configuration optionsEelco Dolstra
In particular, drop the "build-" and "gc-" prefixes which are pointless. So now you can say nix build --no-sandbox instead of nix build --no-build-use-sandbox
2016-11-26Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25Get rid of unicode quotes (#1140)Guillaume Maudoux
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...
2012-11-26Fix the multiple-outputs testEelco Dolstra
2012-09-12Handle gc-keep-outputs and gc-keep-derivations both enabledEelco Dolstra
If the options gc-keep-outputs and gc-keep-derivations are both enabled, you can get a cycle in the liveness graph. There was a hack to handle this, but it didn't work with multiple-output derivations, causing the garbage collector to fail with errors like ‘error: cannot delete path `...' because it is in use by `...'’. The garbage collector now handles strongly connected components in the liveness graph as a unit and decides whether to delete all or none of the paths in an SCC.
2012-09-11Test hash rewritingEelco Dolstra
2011-12-21* The ‘foo.drvPath’ feature was already broken in read-only mode.Eelco Dolstra
Since it's rarely used and fixing it is too much work right now, just document it.
2011-12-21* Add a test for unsafeDiscardOutputDependency. Not really related toEelco Dolstra
multiple outputs, but good to have anyway.
2011-12-21* Add a test for referring to another derivation's ‘drvPath’. ThisEelco Dolstra
currently fails in read-only mode.
2011-12-20* Doing a GC after building a derivation with cyclic outputs currentlyEelco Dolstra
segfaults.
2011-12-20* Add a (currently failing) test that checks whether mutuallyEelco Dolstra
recursive outputs are properly rejected. * Add a (also failing) test for "nix-build -A <output-name>".
2011-12-20* Refactor a bit so that more tests can be added.Eelco Dolstra
2011-11-06The nixinstantiate and nixstore env vars are no longer set in common.shShea Levy
2011-09-14Add a test for multiple outputsShea Levy
This currently fails. Yay test-driven development!