aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2021-10-28Merge remote-tracking branch 'origin/master' into non-blocking-gcEelco Dolstra
2021-10-26Make experimental-features a proper typeregnat
Rather than having them plain strings scattered through the whole codebase, create an enum containing all the known experimental features. This means that - Nix can now `warn` when an unkwown experimental feature is passed (making it much nicer to spot typos and spot deprecated features) - It’s now easy to remove a feature altogether (once the feature isn’t experimental anymore or is dropped) by just removing the field for the enum and letting the compiler point us to all the now invalid usages of it.
2021-10-15Revert "Fix referrers test"Eelco Dolstra
This reverts commit e31a48366f19d5fa452df6273e817a4ea5516e50. Unnecessary after 0be8cc1466f317e33977590510bac4b18471f0ce.
2021-10-15Add a test for the non-blocking GCEelco Dolstra
2021-10-15Disable the eval-store test when using the daemonregnat
Using the daemon will break most of the assumptions of this test, so it’s as simple to just disable it
2021-10-15Fix test against old daemonEelco Dolstra
2021-10-14Fix the min bound for the structured-attrs testregnat
The min bound written corresponds to the date of the commit that introduced the change, but it only got merged on master some weeks later. Since the version is essentially the commit date, that means that there’s a whole range of commits on master (including the current `nixUnstable`) that have a higher version but don’t contain the required change.
2021-10-14Fix the `isDaemonNewer` checkregnat
- Don’t hardcode the “newer” version - Remove an ill-placed `return`
2021-10-14pathInfoCache: Use the entire base name as the cache keyEelco Dolstra
This fixes a bug in the garbage collector where if a path /nix/store/abcd-foo is valid, but we do a isValidPath("/nix/store/abcd-foo.lock") first, then a negative entry for /nix/store/abcd is added to pathInfoCache, so /nix/store/abcd-foo is subsequently considered invalid and deleted.
2021-10-13Fix referrers testEelco Dolstra
This test broke the assumption that the hash parts of store paths are unique.
2021-10-13tests/multiple-outputs.sh: Assert empty storeEelco Dolstra
2021-10-13Non-blocking garbage collectorEelco Dolstra
The garbage collector no longer blocks other processes from adding/building store paths or adding GC roots. To prevent the collector from deleting store paths just added by another process, processes need to connect to the garbage collector via a Unix domain socket to register new temporary roots.
2021-10-12Add compression level for NARsTom Bereknyei
Based off on @dtzWill's #2276
2021-10-07Adds a test for nss preload mechanismArthur Gautier
This tests for the fix implemented in #5224 Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-10-07Allow builtins.{path,filterSource} on paths with a contextEelco Dolstra
We now build the context (so this has the side-effect of making builtins.{path,filterSource} work on derivations outputs, if IFD is enabled) and then check that the path has no references (which is what we really care about).
2021-10-06Add a test for builtins.path in a flakeEelco Dolstra
2021-10-06Make Mercurial optional for the flakes testsEelco Dolstra
2021-10-01Merge pull request #5167 from Ma27/keep-failed-on-ssh-remote-buildEelco Dolstra
nix-store --serve: pass on `settings.keepFailed` from SSH store
2021-09-29Merge pull request #5295 from Ma27/bmcheck-fod-mismatchEelco Dolstra
build: also throw hash-mismatch errors if `buildMode == bmCheck`
2021-09-27build: also throw hash-mismatch errors if `buildMode == bmCheck`Maximilian Bosch
This actually bit me quite recently in `nixpkgs` because I assumed that `nix-build --check` would also error out if hashes don't match anymore[1] and so I wrongly assumed that I couldn't reproduce the mismatch error. The fix is rather simple, during the output registration a so-called `delayedException` is instantiated e.g. if a FOD hash-mismatch occurs. However, in case of `nix-build --check` (or `--rebuild` in case of `nix build`), the code-path where this exception is thrown will never be reached. By adding that check to the if-clause that causes an early exit in case of `bmCheck`, the issue is gone. Also added a (previously failing) test-case to demonstrate the problem. [1] https://github.com/NixOS/nixpkgs/pull/139238, the underlying issue was that `nix-prefetch-git` returns different hashes than `fetchgit` because the latter one fetches submodules by default.
2021-09-27Fix 'error: reading a line: Input/output error' in startBuilder()Eelco Dolstra
With -vvvv, the ProgressBar was polluting the stderr of the child, messing up its \2 message to the parent.
2021-09-22Revert "Merge pull request #4922 from nrdxp/default-submodules"Eelco Dolstra
This reverts commit 6678e98411cd3bfe8143a4ba1b35d1451babce32, reversing changes made to 90b2dd570cbd8313a8cf45b3cf66ddef2bb06e07.
2021-09-21path fetcher: Fix relative path checkEelco Dolstra
2021-09-15Merge branch 'mh/fix-chroot-eval' of https://github.com/obsidiansystems/nixEelco Dolstra
2021-09-14Merge branch 'tomberek/show_json' of https://github.com/tomberek/nixEelco Dolstra
2021-09-13tests: Fix the recursive test with the daemonregnat
Add the `recursive-nix` experimental-feature to the daemon, as the test will otherwise fail
2021-09-08Ensure nix flake show produces valid jsonTom Bereknyei
2021-09-07Merge pull request #4922 from nrdxp/default-submodulesShea Levy
libfetchers/git: fetch submodules by default
2021-09-02parseInstallables(): Parse store paths as store pathsEelco Dolstra
If the store path contains a flake, this means that a command like "nix path-info /path" will show info about /path, not about the default output of the flake in /path. If you want the latter, you can explicitly ask for it by doing "nix path-info path:/path". Fixes #4568.
2021-09-02Failing test case for flake in storeStéphan Kochen
2021-09-01Merge pull request #5066 from Radvendii/masterEelco Dolstra
add antiquotations to paths
2021-08-31tests/fetchurl.sh: Be verbose to help debug darwin eof bug #2794Robert Hensing
2021-08-31nix-store --serve: pass on `settings.keepFailed` from SSH storeMaximilian Bosch
When doing e.g. nix-build -A package --keep-failed --option \ builders \ 'ssh://mfhydra?remote-store=/home/bosch/store x86_64-linux - 10 4 big-parallel' this doesn't work properly because this build-setting is ignored. I changed this behavior by passing the `settings.keepFailed` through the serve-protocol to remote machines to make sure that I can introspect the build-directory (which is particularly helpful when I have to look at a `config.log` from a failed build for instance).
2021-08-17Add tests for flake follow pathsAlex Zero
2021-08-06Fix disabled case in local store testMadeline Haraj
2021-08-06path antiquotations: rename confusing testTaeer Bar-Yam
2021-08-06add path antiqutations testTaeer Bar-Yam
2021-07-31nix-shell -p: pass --arg values as nixpkgs paramsldesgoui
2021-07-27Remove the right socket before starting the daemonregnat
For some reason, an old socket occasionally stays here on OSX, causing the subsequent tests to fail
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-07-27Add --eval-store testEelco Dolstra
2021-07-21Merge branch 'balsoft/no-registries' of https://github.com/serokell/nixEelco Dolstra
2021-07-20Properly lock the builds of CA derivationsregnat
Make sure that we can’t build the same derivation twice at the same time. Fix https://github.com/NixOS/nix/issues/5029
2021-07-16Add use-registries config option (and deprecate --no-registries flag)Alexander Bantyev
Some people want to avoid using registries at all on their system; Instead of having to add --no-registries to every command, this commit allows to set use-registries = false in the config. --no-registries is still allowed everywhere it was allowed previously, but is now deprecated. Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2021-07-16Forward the whole Nix config to the repl subprocessesregnat
Fill `NIX_CONFIG` with the value of the current Nix configuration before calling the nix subprocesses in the repl That way the whole configuration (including the possible `experimental-features`, a possibly `--store` option or whatever) will be made available. This is required for example to make `nix repl` work with a custom `--store`
2021-07-12Merge branch 'master' into structured-attrs-shellMaximilian Bosch
Conflicts: src/nix/develop.cc src/nix/get-env.sh tests/shell.nix
2021-07-09nix print-dev-env: Add --json flagEelco Dolstra
2021-07-09nix develop: Add a test for bash functionsEelco Dolstra
2021-07-09Add test for #4992Eelco Dolstra
2021-07-09nix develop: Add a test for arraysEelco Dolstra