aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2023-02-14container test: make /etc writableYorick van Pelt
2023-02-14Don't allow writing to /etcYorick van Pelt
2023-02-10Test `nix build --json` return output paths in floating CA caseJohn Ericson
Adding a test to ensure there is no regression. The tests that are split out of `tests/build.sh` are ones that don't yet work with CA derivation. I have not yet evaluated whether they should or not. This behavior, reported missing in issue #4661, already got fixed in PR #4818, but didn't get a test case then.
2023-02-10Merge pull request #7797 from hercules-ci/tests-set-ps4Eelco Dolstra
tests: Add command source locations to test log
2023-02-10Merge pull request #7802 from edolstra/fix-7783Eelco Dolstra
Fix PID namespace support check
2023-02-10Merge pull request #5588 from tweag/balsoft/xdgThéophane Hufschmitt
Follow XDG Base Directory standard
2023-02-10Add regression testEelco Dolstra
2023-02-10A setting to follow XDG Base Directory standardAlexander Bantyev
XDG Base Directory is a standard for locations for storing various files. Nix has a few files which seem to fit in the standard, but currently use a custom location directly in the user's ~, polluting it: - ~/.nix-profile - ~/.nix-defexpr - ~/.nix-channels This commit adds a config option (use-xdg-base-directories) to follow the XDG spec and instead use the following locations: - $XDG_STATE_HOME/nix/profile - $XDG_STATE_HOME/nix/defexpr - $XDG_STATE_HOME/nix/channels If $XDG_STATE_HOME is not set, it is assumed to be ~/.local/state. Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> Co-authored-by: Tim Fenney <kodekata@gmail.com> Co-authored-by: pasqui23 <pasqui23@users.noreply.github.com> Co-authored-by: Artturin <Artturin@artturin.com> Co-authored-by: John Ericson <Ericson2314@Yahoo.com>
2023-02-10Merge pull request #7775 from hercules-ci/test-authorizationRobert Hensing
Add a basic daemon authorization test
2023-02-10tests/authorization: Simplify assertionRobert Hensing
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2023-02-09tests: Add command source locations to test logRobert Hensing
2023-02-09Merge pull request #7754 from obsidiansystems/narrower-scope-derivation-flagThéophane Hufschmitt
Scope down `--derivation` to just the commands that use it
2023-02-07Add some testsEelco Dolstra
2023-02-07Add a basic daemon authorization testRobert Hensing
2023-02-04Remove `--derivation` from testJohn Ericson
It doesn't do anything here, and in the next commit `show-derivation will no longer accept this flag.
2023-02-01Merge pull request #7723 from yorickvP/nix-store-ping-jsonEelco Dolstra
nix store ping: add --json flag
2023-01-31nix flake show: Ignore empty attrsetsRobert Hensing
For frameworks it's important that structures are as lazy as possible to prevent infinite recursions, performance issues and errors that aren't related to the thing to evaluate. As a consequence, they have to emit more attributes than strictly (sic) necessary. However, these attributes with empty values are not useful to the user so we omit them.
2023-01-31tests/store-ping: test nix store ping --jsonYorick van Pelt
2023-01-30Merge pull request #5226 from NixOS/client-side-profilesEelco Dolstra
Move the default profiles to the user’s home
2023-01-30Merge pull request #6988 from max-privatevoid/pr-flake-show-foreignThéophane Hufschmitt
nix flake show: don't evaluate derivations for foreign systems by default
2023-01-30Fix the flakes init testThéophane Hufschmitt
Things leading to another...
2023-01-30Fix the flakes/show testThéophane Hufschmitt
Don't hardcode “x86_64-linux” as this won't work too nicely on other platforms
2023-01-30Merge branch 'master' into referenceablePathsThéophane Hufschmitt
2023-01-30Merge pull request #7689 from ncfavier/nix-path-restrict-evalThéophane Hufschmitt
getDefaultNixPath: actually respect `{restrict,pure}-eval`
2023-01-27Merge pull request #7648 from hercules-ci/move-nixos-testsThéophane Hufschmitt
Move nixos tests
2023-01-27getDefaultNixPath: actually respect `{restrict,pure}-eval`Naïm Favier
Previously, getDefaultNixPath was called too early: at initialisation time, before CLI and config have been processed, when `restrictEval` and `pureEval` both have their default value `false`. Call it when initialising the EvalState instead, and use `setDefault`.
2023-01-27Add a test for `nix flake show`Théophane Hufschmitt
2023-01-23Tighten up the `exportReferencesGraph` testsAndrea Ciceri
Add an `$` at the end of the `grep` regex. Without it, `checkRef foo` would always imply `checkRef foo.drv`. We want to tell these situations apart to more precisely test what is going on.
2023-01-23Merge pull request #7595 from cole-h/show-setting-valueEelco Dolstra
nix/show-config: allow getting the value of a specific setting
2023-01-23Merge pull request #7447 from aakropotkin/read-file-typeRobert Hensing
Read file type
2023-01-22primop: add readFileType, optimize readDirAlex Ameen
Allows checking directory entry type of a single file/directory. This was added to optimize the use of `builtins.readDir` on some filesystems and operating systems which cannot detect this information using POSIX's `readdir`. Previously `builtins.readDir` would eagerly use system calls to lookup these filetypes using other interfaces; this change makes these operations lazy in the attribute values for each file with application of `builtins.readFileType`.
2023-01-21Expand tests to reproduce #7655John Ericson
The original `builtins.getContext` test from 1d757292d0cb78beec32fcdfe15c2944a4bc4a95 would have caught this. The problem is that b30be6b450f872f8be6dc8afa28f4b030fa8d1d1 adding `builtins.appendContext` modified that test to make it test too much at once, rather than adding a separate test. We now have isolated tests for both functions, and also a property test showing everything put together (in the form of an eta rule for strings with context). This is better coverage and properly reproduces the bug.
2023-01-20Use the official, documented NixOS runTest interfaceRobert Hensing
2023-01-20tests: Move NixOS tests to tests/nixosRobert Hensing
This will allow contributors to find them more easily.
2023-01-18Fix indentationEelco Dolstra
2023-01-18Add some tests for illegal output namesEelco Dolstra
2023-01-18OutputSpec: Allow all valid output namesEelco Dolstra
Fixes #7624.
2023-01-17Test the migration of the user profilesThéophane Hufschmitt
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