aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2023-06-14Merge pull request #8490 from flox/stdin_handlingJohn Ericson
fix: Do not apply default installables when using --stdin
2023-06-14Merge pull request #4803 from ShamrockLee/nix-channel-list-generationsJohn Ericson
Add `nix-channel --list-generations`
2023-06-14Merge pull request #4282 from tweag/fix-ca-hash-rewritingJohn Ericson
fix the hash rewriting for ca-derivations
2023-06-12test: add test for non-defaulting for stding installable inputTom Bereknyei
2023-06-09Merge branch 'master' into angerman/mac-fix-recursive-nixEelco Dolstra
2023-06-09Parse TOML timestamps (#8120)Andrea Bedini
Currently `fromTOML` throws an exception when encountering a timestamp since the Nix language lacks a way to represent them. This patch changes this beaviour and makes `fromTOML` parse timestamps as attrsets of the format { _type = "timestamp"; value = "1979-05-27T07:32:00Z"; } This is guarded by an experimental feature flag to leave room for iterating on the representation.
2023-06-06Fix SourcePath::resolveSymlinks()Eelco Dolstra
This fixes handling of symlinks that start with '..', and symlink targets that contain symlinks themselves.
2023-06-02Test `nix-channel --list-generations`Théophane Hufschmitt
Rough test, but the feature is a fairly trivial addition on top of `nix-profile --list-generations`, so it should be enough
2023-05-25primops: lazy evaluation of replaceStrings replacementspolykernel
The primop `builtins.replaceStrings` currently always strictly evaluates the replacement strings, however time and space are wasted for their computation if the corresponding pattern do not occur in the input string. This commit makes the evaluation of the replacement strings lazy by deferring their evaluation to when the corresponding pattern are matched and memoize the result for efficient retrieval on subsequent matches. The testcases for replaceStrings was updated to check for lazy evaluation of the replacements. A note was also added in the release notes to document the behavior change.
2023-05-24Disable the fetchClosure test for old daemonsThéophane Hufschmitt
Broken because of the change introduced by #4282
2023-05-23`nix flake check`: skip derivations for foreign systems (#7759)Peter Becich
`nix flake show` now skips derivations for foreign systems: https://github.com/NixOS/nix/pull/6988 This commit borrows from that to implement the same behavior for `nix flake check`. See "nix flake check breaks on IFD in multi-platform flake" https://github.com/NixOS/nix/issues/4265
2023-05-22Add tests for bind mount of SSL certs in sandboxGuillaume Maudoux
2023-05-17Merge pull request #8349 from tweag/fix-control-masterJohn Ericson
Fix ControlMaster behaviour
2023-05-17Add a test for ControlMasterAlexander Bantyev
2023-05-16Merge pull request #8346 from tweag/fix-nix-profile-install-conflict-segfaultJohn Ericson
Fix the segfault on `nix profile install` with conflict
2023-05-16Merge pull request #8154 from tweag/delete-old-on-all-profiles-dirJohn Ericson
undefined
2023-05-16Fix the printing of the installables on `nix profile install` conflictThéophane Hufschmitt
- If the element comes from a flake, print the full flakeref (with the fragment part) and not just the reference to the flake itself - If the element doesn't come from a flake, print its store path(s) This is a bit too verbose, but has the advantages of being correct (and not crashing), so it's strictly better than the previous situation Fix https://github.com/NixOS/nix/issues/8284
2023-05-15Make more string values work as installablesJohn Ericson
As discussed in #7417, it would be good to make more string values work as installables. That is to say, if an installable refers to a value, and the value is a string, it used to not work at all, since #7484, it works somewhat, and this PR make it work some more. The new cases that are added for `BuiltPath` contexts: - Fixed input- or content-addressed derivation: ``` nix-repl> hello.out.outPath "/nix/store/jppfl2bp1zhx8sgs2mgifmsx6dv16mv2-hello-2.12" nix-repl> :p builtins.getContext hello.out.outPath { "/nix/store/c7jrxqjhdda93lhbkanqfs07x2bzazbm-hello-2.12.drv" = { outputs = [ "out" ]; }; } The string matches the specified single output of that derivation, so it should also be valid. - Floating content-addressed derivation: ``` nix-repl> (hello.overrideAttrs (_: { __contentAddressed = true; })).out.outPath "/1a08j26xqc0zm8agps8anxpjji410yvsx4pcgyn4bfan1ddkx2g0" nix-repl> :p builtins.getContext (hello.overrideAttrs (_: { __contentAddressed = true; })).out.outPath { "/nix/store/qc645pyf9wl37c6qvqzaqkwsm1gp48al-hello-2.12.drv" = { outputs = [ "out" ]; }; } ``` The string is not a path but a placeholder, however it also matches the context, and because it is a CA derivation we have no better option. This should also be valid. We may also want to think about richer attrset based values (also discussed in that issue and #6507), but this change "completes" our string-based building blocks, from which the others can be desugared into or at least described/document/taught in terms of. Progress towards #7417 Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-05-15test the garbage collection with the old profile dirThéophane Hufschmitt
Regression test for https://github.com/NixOS/nix/issues/8294
2023-05-10Fix `nix print-dev-env` & `nix develop` with drv pathsJohn Ericson
Fixes #8309 This regression was because both `CmdDevelop` and `CmdPrintDevEnv` were switched to be `InstallableValueCommand` subclasses, but actually neither should have been. The `nixpkgsFlakeRef` method should indeed not be on the base installable class, because "flake refs" and "nixpkgs" are not installable-wide notions, but that doesn't mean these commands should only accept installable values.
2023-05-10Merge pull request #3959 from obsidiansystems/ca-drv-exoticJohn Ericson
Derivations can output "text-hashed" data
2023-05-10Merge pull request #7721 from yorickvP/post-build-hookThéophane Hufschmitt
Also pass unwanted outputs to post-build-hook
2023-05-09quote subshell expansion in tests/eval.shAlex Ameen
2023-05-09prevent double quotationAlex Ameen
2023-05-09libexpr: quote reserved keys when printingAlex Ameen
This fixes a bug in commands like `nix eval' which would emit invalid attribute sets if they contained reserved keywords such as "assert", "let", etc. These keywords will not be quoted when printed, making them valid expressions. All keywords recognized by the lexer are quoted except "or", which does not require quotation.
2023-05-08Merge pull request #3921 from obsidiansystems/trustless-remote-builder-simpleJohn Ericson
Trustless remote building for input-addressed drvs
2023-05-08Rename a few things in new testsJohn Ericson
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-05-08tests/post-hook: remove TODO and --derivation uploadYorick van Pelt
2023-05-08tests: copying only the out paths is not enough information for CAYorick van Pelt
2023-05-08tests/post-hook: test to see if all outputs are passedYorick van Pelt
fe5509df caused only wanted outputs to be passed to the post-build-hook, which resulted in paths being built without ever going into the hook. This commit adds a (currently failing) test for this.
2023-04-25Fix shutdown behavior and resource management for recursive-nix on macOSMoritz Angermann
Previously, we relied on the `shutdown()` function to terminate `accept()` calls on a listening socket. However, this approach did not work on macOS as the waiting `accept()` call is not considered a connected socket, resulting in an `ENOTCONN` error. Instead, we now close the listening socket to terminate the `accept()` call. Additionally, we fixed a resource management issue where we set the `daemonSocket` variable to -1, triggering resource cleanup and causing the `stopDaemon` function to be called twice. This resulted in errors as the socket was already closed by the time the second `stopDaemon` call was made. Instead of setting `daemonSocket` to -1, we now release the socket using the `release()` method on a unique pointer. This properly transfers ownership and allows for correct resource cleanup. These changes ensure proper behavior and resource management for the recursive-nix feature on macOS.
2023-04-24Merge remote-tracking branch 'origin/master' into source-pathEelco Dolstra
2023-04-19Fix typo in testsJohn Ericson
2023-04-19Add a more interesting testJohn Ericson
In this one, we don't just output an existing derivation as is, but modify it first.
2023-04-19Move `test/recursive.sh` nix expr to fileJohn Ericson
I found it hard to read as a big string literal.
2023-04-19Make `tests/dyn-drv` test dirJohn Ericson
2023-04-19Require daemon version for text hashing testJohn Ericson
2023-04-19Merge remote-tracking branch 'upstream/master' into ca-drv-exoticJohn Ericson
2023-04-17`TextHashMethod` -> `TextIngestionMethod`, gate with XP featureJohn Ericson
I suppose we can use `dynamic-derivations` for the few things we neeed.
2023-04-17Merge remote-tracking branch 'upstream/master' into ca-drv-exoticJohn Ericson
2023-04-17Gate experimental features in `DerivationOutput::fromJSON`John Ericson
This is an entry point for outside data, so we need to check enabled experimental features here.
2023-04-17Merge remote-tracking branch 'upstream/master' into ↵John Ericson
trustless-remote-builder-simple
2023-04-17Merge pull request #8230 from obsidiansystems/daemon-trust-overrideRobert Hensing
Experimentally allow forcing `nix-daemon` trust; use this to test
2023-04-17Experimentally allow forcing `nix-daemon` trust; use this to testJohn Ericson
We finally test the status quo of remote build trust in a number of ways. We create a new experimental feature on `nix-daemon` to do so. PR #3921, which improves the situation with trustless remote building, will build upon these changes. This code / tests was pull out of there to make this, so everything is easier to review, and in particular we test before and after so the new behavior in that PR is readily apparent from the testsuite diff alone.
2023-04-17Fix some issues with experimental config settingsJohn Ericson
Issues: 1. Features gated on disabled experimental settings should warn and be ignored, not silently succeed. 2. Experimental settings in the same config "batch" (file or env var) as the enabling of the experimental feature should work. 3. For (2), the order should not matter. These are analogous to the issues @roberth caught with my changes for arg handling, but they are instead for config handling. Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-04-17Merge remote-tracking branch 'upstream/master' into ca-drv-exoticJohn Ericson
2023-04-17`nix-testing` -> `daemon-trust-override`John Ericson
And only enable in the tests that need it. This makes it less of a sledgehammer.
2023-04-17Merge remote-tracking branch 'upstream/master' into ↵John Ericson
trustless-remote-builder-simple
2023-04-17Merge remote-tracking branch 'upstream/master' into source-pathRobert Hensing
2023-04-17Merge pull request #8193 from hercules-ci/dry-stringsRobert Hensing
Deduplicate string literal rendering, fix 4909