aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2022-04-05Allow `welcomeText` when checking a flake templateThéophane Hufschmitt
Fix https://github.com/NixOS/nix/issues/6321
2022-04-01Fix handling of outputHash when outputHashAlgo is not specifiedEelco Dolstra
https://hydra.nixos.org/build/171351131
2022-03-31tests/impure-derivations.sh: Ensure that inputAddressed build failsEelco Dolstra
2022-03-31Provide default values for outputHashAlgo and outputHashModeEelco Dolstra
2022-03-31Fix testEelco Dolstra
2022-03-31tests/impure-derivations.sh: Restart daemonEelco Dolstra
2022-03-31Support fixed-output derivations depending on impure derivationsEelco Dolstra
2022-03-31Add support for impure derivationsEelco Dolstra
Impure derivations are derivations that can produce a different result every time they're built. Example: stdenv.mkDerivation { name = "impure"; __impure = true; # marks this derivation as impure outputHashAlgo = "sha256"; outputHashMode = "recursive"; buildCommand = "date > $out"; }; Some important characteristics: * This requires the 'impure-derivations' experimental feature. * Impure derivations are not "cached". Thus, running "nix-build" on the example above multiple times will cause a rebuild every time. * They are implemented similar to CA derivations, i.e. the output is moved to a content-addressed path in the store. The difference is that we don't register a realisation in the Nix database. * Pure derivations are not allowed to depend on impure derivations. In the future fixed-output derivations will be allowed to depend on impure derivations, thus forming an "impurity barrier" in the dependency graph. * When sandboxing is enabled, impure derivations can access the network in the same way as fixed-output derivations. In relaxed sandboxing mode, they can access the local filesystem.
2022-03-30Don’t create a file in the worktree in the fetchPath testThéophane Hufschmitt
2022-03-25Merge pull request #6311 from edolstra/return-wanted-pathsEelco Dolstra
Make buildPathsWithResults() only return info on wanted outputs
2022-03-24tests/build.sh: Test that 'nix build' only prints wanted outputsEelco Dolstra
2022-03-24Implement regression test for empty logs loaded via `nix log`Maximilian Bosch
2022-03-24Add experimental feature 'fetch-closure'Eelco Dolstra
2022-03-24Add a test for fetchClosure and 'nix store make-content-addressed'Eelco Dolstra
2022-03-22Don't hide repeated values while generating manifest.nixEelco Dolstra
Fixes #6243.
2022-03-19Fix sourcehut integration testGabriel Fontes
The new implementation relies on tab separting the hash and ref (this is how sourcehut does it). This fixes the integration test to use a tab instead of a space.
2022-03-17Merge pull request #6277 from thufschmitt/ca/nix-build-dry-runEelco Dolstra
Fix `nix build --dry-run` with CA derivations
2022-03-17Merge pull request #6270 from Artturin/stdinevalThéophane Hufschmitt
nix: allow using --file - to read from stdin
2022-03-17Fix `nix build --dry-run` with CA derivationsThéophane Hufschmitt
Don’t try and assume that we know the output paths when we’ve just built with `--dry-run`. Instead make `--dry-run` follow a different code path that won’t assume the knowledge of the output paths at all. Fix #6275
2022-03-17Merge pull request #6242 from ncfavier/print-output-namesThéophane Hufschmitt
nix-env: always print output names in JSON and XML
2022-03-16Add some tests for `nix-env -q --json`Théophane Hufschmitt
2022-03-16add tests for nix eval and nix-instantiateArtturin
2022-03-16Fix the date in the comment of fetchPath’s testThéophane Hufschmitt
Co-authored-by: pennae <82953136+pennae@users.noreply.github.com>
2022-03-15Fix the tests on 32bits machinesregnat
year 2222 is too much for a 32 bit timestamp. So replace it by something smaller
2022-03-15Implement simple test for `path`-fetcher setting a correct `lastModifiedDate`Maximilian Bosch
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-03-11Merge remote-tracking branch 'origin/eval-suggestions'Eelco Dolstra
2022-03-11Merge pull request #5758 from mschwaig/fix-git-workspace-dirty-detectionThéophane Hufschmitt
git fetcher: fix detection of dirty git workspaces
2022-03-08Also display some suggestions for invalid formal argumentsregnat
```console $ nix eval --expr '({ foo ? 1 }: foo) { fob = 2; }' error: anonymous function at (string):1:2 called with unexpected argument 'fob' at «string»:1:1: 1| ({ foo ? 1 }: foo) { fob = 2; } | ^ Did you mean foo? ``` Not that because Nix will first check for _missing_ arguments before checking for extra arguments, `({ foo }: foo) { fob = 1; }` will complain about the missing `foo` argument (rather than extra `fob`) and so won’t display a suggestion.
2022-03-08Add some suggestions to the evaluatorregnat
Make the evaluator show some suggestions when trying to access an invalid field from an attrset. ```console $ nix eval --expr '{ foo = 1; }.foa' error: attribute 'foa' missing at «string»:1:1: 1| { foo = 1; }.foa | ^ Did you mean foo? ```
2022-03-07Merge branch 'cli-suggestions' of https://github.com/thufschmitt/nixEelco Dolstra
2022-03-07Add some end-to-end tests for the suggestionsregnat
2022-03-07Merge pull request #6029 from Ma27/nix-log-ssh-ngThéophane Hufschmitt
ssh-ng: also store build logs to make them accessible by `nix log`
2022-03-07Explain why the log tests are disabled for CA derivationsThéophane Hufschmitt
2022-03-04tests: grep for string in nix log for remote-buildsMaximilian Bosch
2022-03-02nix profile test: Restart daemonEelco Dolstra
Fixes nix-daemon: src/libstore/sqlite.cc:97: nix::SQLiteStmt::Use::Use(nix::SQLiteStmt&): Assertion `stmt.stmt' failed. which happens because the daemon doesn't properly handle the case where ca-derivations isn't enabled at daemon startup.
2022-03-02Remove obsolete todoEelco Dolstra
2022-03-02Silence kill outputEelco Dolstra
2022-03-02tests/common.sh.in: Add enableFeatures helperEelco Dolstra
2022-03-02nix profile: Add a test for non-flake packagesEelco Dolstra
2022-03-02nix profile: Support CA derivationsEelco Dolstra
2022-03-02Add basic tests for 'nix profile'Eelco Dolstra
Fixes #6193.
2022-03-02tests: Rename nix-profile.sh -> bash-profile.shEelco Dolstra
2022-02-28fetchTree: Do not re-fetch paths already presentRobert Hensing
2022-02-28tests: implement test for `nix log` with `ssh-ng://` buildsMaximilian Bosch
A few notes: * The `echo hi` is needed to make sure that a file that can be read by `nix log` is properly created (i.e. some output is needed). This is known and to be fixed in #6051. * We explicitly ignore the floating-CA case here: the `$out` of `input3` depends on `$out` of `input2`. This means that there are actually two derivations - I assume that this is because at eval time (i.e. `nix-instantiate -A`) the hash of `input2` isn't known yet and the other .drv is created as soon as `input2` was built. This is another issue on its own, so we ignore the case here explicitly.
2022-02-28tests: Fix the start of the daemonregnat
- Make sure that it starts even without the `nix-command` xp feature - Fail if it doesn’t manage to start This fixes a 30s wait for every test in `init.sh` as the daemon couldn’t start, but the code was just waiting 30s and continuing as if everything was all right.
2022-02-24Merge pull request #6089 from edolstra/dot-defaultEelco Dolstra
Replace defaultBla.$system with bla.$system.default
2022-02-24Merge pull request #6159 from NixOS/more-eager-daemon-polling-in-testsEelco Dolstra
testS: poll more eagerly for the daemon start/stop
2022-02-24testS: poll more eagerly for the daemon start/stopregnat
Polling every 1 second means that even the simplest test takes at least 2 seconds. We can reasonably poll 1/10 of that to make things much quicker (esp. given that most of the time 0.1s is enough for the daemon to be started or stopped)
2022-02-24Sort the tests by wall timeregnat
The tests are scheduled in the order they appear, so running the long ones first slightly improves the scheduling. On my machine, this decreases the time of `make install` from 40s to 36s
2022-02-23add sourcehut integration testGabriel Fontes