aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2023-01-17Move the default profiles to the user’s homeThéophane Hufschmitt
Rather than using `/nix/var/nix/{profiles,gcroots}/per-user/`, put the user profiles and gcroots under `$XDG_DATA_DIR/nix/{profiles,gcroots}`. This means that the daemon no longer needs to manage these paths itself (they are fully handled client-side). In particular, it doesn’t have to `chown` them anymore (removing one need for root). This does change the layout of the gc-roots created by nix-env, and is likely to break some stuff, so I’m not sure how to properly handle that.
2023-01-13tests/config: test retrieving a single setting's value with `nix show-config ↵Cole Helbling
<setting>`
2023-01-13Merge pull request #7430 from tweag/ca/fix-nix-logThéophane Hufschmitt
Ca/fix nix log
2023-01-10Parse string context elements properlyJohn Ericson
Prior to this change, we had a bunch of ad-hoc string manipulation code scattered around. This made it hard to figure out what data model for string contexts is. Now, we still store string contexts most of the time as encoded strings --- I was wary of the performance implications of changing that --- but whenever we parse them we do so only through the `NixStringContextElem::parse` method, which handles all cases. This creates a data type that is very similar to `DerivedPath` but: - Represents the funky `=<drvpath>` case as properly distinct from the others. - Only encodes a single output, no wildcards and no set, for the "built" case. (I would like to deprecate `=<path>`, after which we are in spitting distance of `DerivedPath` and could maybe get away with fewer types, but that is another topic for another day.)
2023-01-10Merge remote-tracking branch 'origin/master' into fix-7417Eelco Dolstra
2023-01-10Merge pull request #7570 from lheckemann/fix-testsEelco Dolstra
tests: fix for nixpkgs 22.11
2023-01-08tests: fix for nixpkgs 22.11Linus Heckemann
runCommand now uses stdenvNoCC by default, so that needs to be included instead of the regular stdenv.
2023-01-05Don't check NixOS modulesNaïm Favier
NixOS modules can be paths. Rather than dig further down into the layer violation, don't check anything specific to NixOS modules.
2023-01-03move `unsafeDiscardReferences` out of `outputChecks`Naïm Favier
It's not a check.
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.
2023-01-02Increase the test coverage of `why-depends`Théophane Hufschmitt
- Test with `--derivation` - Actually test with ca-derivations (was suuposedly done, but not activated because of a missing line in `local.mk`)
2023-01-02Merge pull request #5941 from hercules-ci/optimize-intersectAttrsThéophane Hufschmitt
Optimize intersectAttrs performance
2023-01-02antiquotation -> string interpolationValentin Gagarin
as proposed by @mkaito[1] and @tazjin[2] and discussed with @edolstra and Nix maintainers [1]: https://github.com/NixOS/nix.dev/pull/267#issuecomment-1270076332 [2]: https://github.com/NixOS/nix.dev/pull/267#issuecomment-1270201979 Co-authored-by: John Ericson <git@JohnEricson.me> Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2023-01-02Merge pull request #7470 from obsidiansystems/simplify-tests-slightlyEelco Dolstra
Make `./mk/run-test.sh` work by itself; add `mk/debug-test.sh`
2022-12-24Optimize intersectAttrs performanceRobert Hensing
Always traverse the shortest set.
2022-12-24tests: switch to non-deprecated nix.settings.* module parametersSergei Trofimovich
Without the change checks issue the fllowing warning: $ nix flake check trace: warning: The option `nix.useSandbox' defined in `makeTest parameters' has been renamed to `nix.settings.sandbox'. trace: warning: The option `nix.useSandbox' defined in `makeTest parameters' has been renamed to `nix.settings.sandbox'. trace: warning: The option `nix.maxJobs' defined in `makeTest parameters' has been renamed to `nix.settings.max-jobs'. ...
2022-12-23Merge pull request #7367 from lheckemann/nixpkgs-22.11Eelco Dolstra
Bump nixpkgs to 22.11
2022-12-21Make `./mk/run-test.sh` work by itself; add `mk/debug-test.sh`John Ericson
First, logic is consolidated in the shell script instead of being spread between them and makefiles. That makes understanding what is going on a little easier. This would not be super interesting by itself, but it gives us a way to debug tests more easily. *That* in turn I hope is much more compelling. See the updated manual for details. Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-authored-by: Eelco Dolstra <edolstra@gmail.com> Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2022-12-20InstallableFlake::toDerivedPaths(): Support paths and store pathsEelco Dolstra
This makes 'nix build' work on paths (which will be copied to the store) and store paths (returned as is). E.g. the following flake output attributes can be built using 'nix build .#foo': foo = ./src; foo = self.outPath; foo = builtins.fetchTarball { ... }; foo = (builtins.fetchTree { .. }).outPath; foo = builtins.fetchTree { .. } + "/README.md"; foo = builtins.storePath /nix/store/...; Note that this is potentially risky, e.g. foo = /.; will cause Nix to try to copy the entire file system to the store. What doesn't work yet: foo = self; foo = builtins.fetchTree { .. }; because we don't handle attrsets with an outPath attribute in it yet, and foo = builtins.storePath /nix/store/.../README.md; since result symlinks have to point to a store path currently (rather than a file inside a store path). Fixes #7417.
2022-12-20Merge pull request #7451 from edolstra/abstract-posEelco Dolstra
Introduce AbstractPos
2022-12-15Fix a crash in DerivedPath::Built::toJSON() with impure derivationsEelco Dolstra
The use of 'nullptr' here didn't result in a null JSON value, but in a nullptr being cast to a string, which aborts.
2022-12-13Introduce AbstractPosEelco Dolstra
This makes the position object used in exceptions abstract, with a method getSource() to get the source code of the file in which the error originated. This is needed for lazy trees because source files don't necessarily exist in the filesystem, and we don't want to make libutil depend on the InputAccessor type in libfetcher.
2022-12-12Merge remote-tracking branch 'upstream/master' into indexed-store-path-outputsJohn Ericson
2022-12-12Merge remote-tracking branch 'upstream/master' into indexed-store-path-outputsJohn Ericson
2022-12-12Merge new tests into `build.sh`John Ericson
2022-12-12Merge pull request #7436 from edolstra/enable-lang-testsEelco Dolstra
Enable some language tests that were accidentally disabled
2022-12-12Fix reference to test directory pathEelco Dolstra
2022-12-12Enable some language tests that were accidentally disabledEelco Dolstra
This didn't run because the corresponding .exp file didn't exist.
2022-12-12Allow to disable global flake-registry with ""Benoit de Chezelles
2022-12-12Support flake references in the old CLIEelco Dolstra
Fixes #7026.
2022-12-12Merge pull request #7421 from edolstra/lazy-trees-trivial-changesEelco Dolstra
Trivial changes from the lazy-trees branch
2022-12-12Merge branch 'master' into indexed-store-path-outputsJohn Ericson
2022-12-09Remove tests for --repeatEelco Dolstra
https://hydra.nixos.org/build/201125739
2022-12-08Fix `nix log` with CA derivationsregnat
Fix #6209 When trying to run `nix log <installable>`, try first to resolve the derivation pointed to by `<installable>` as it is the resolved one that holds the build log. This has a couple of shortcomings: 1. It’s expensive as it requires re-reading the derivation 2. It’s brittle because if the derivation doesn’t exist anymore or can’t be resolved (which is the case if any one of its build inputs is missing), then we can’t access the log anymore However, I don’t think we can do better (at least not right now). The alternatives I see are: 1. Copy the build log for the un-resolved derivation. But that means a lot of duplication 2. Store the results of the resolving in the db. Which might be the best long-term solution, but leads to a whole new class of potential issues.
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-12-06tests: don't refer to TMPDIRNaïm Favier
2022-12-02tests/fetchGitSubmodules: fix for newer GitLinus Heckemann
2022-12-01Really fix 'nix store make-content-addressed --json'Eelco Dolstra
https://hydra.nixos.org/log/mcgypcf9vj4n8vdmw7lj3l05c899v73w-nix-2.12.0pre20221201_16b03f0-x86_64-unknown-linux-musl.drv
2022-11-29Merge pull request #3600 from NixOS/auto-uid-allocationEelco Dolstra
Automatic UID allocation
2022-11-28Add a setting for enabling cgroupsEelco Dolstra
2022-11-27Fix evaluationEelco Dolstra
2022-11-27Add tests for auto-uid-allocation, uid-range and cgroupsEelco Dolstra
2022-11-25Merge branch 'master' into indexed-store-path-outputsJohn Ericson
2022-11-23add explanation and testTaeer Bar-Yam
2022-11-16Merge pull request #7134 from yorickvP/disable-dbg-on-completeThéophane Hufschmitt
Temporarily disable the debugger during completion evaluation
2022-11-15Merge pull request #7283 from hercules-ci/issue-6572Théophane Hufschmitt
Fix #6572 `requires non-existent output`
2022-11-14tests: Reproduce #6572Robert Hensing
2022-11-14Test that the result of `readFile` gets ref-scannedThéophane Hufschmitt
2022-11-03tests/impure-derivations.sh: remove unknown experimental feature 'ca-references'Artturin
ca-references was stabilized in d589a6aa8a5d0c9f391400d7e0e209106e89c857
2022-11-03SourceExprCommand: swallow EvalError, add tests for thisYorick van Pelt
Completing things that would error would print an ugly error in the middle of your command line. Avoid printing this error.