aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2020-07-30Add test for builtins.pathMatthew Bauer
2020-07-30Merge remote-tracking branch 'origin/master' into substitute-other-storedirMatthew Bauer
2020-07-28Restore backwards-compat for current `builtins.fetchGit`Maximilian Bosch
If a repo is dirty, it used to return a `rev` object with an "empty" sha1 (0000000000000000000000000000000000000000). Please note that this only applies for `builtins.fetchGit` and *not* for `builtins.fetchTree{ type = "git"; }`.
2020-07-28Merge legacy `fetchGit`-builtin with the generic `fetchTree`-functionMaximilian Bosch
The original idea was to implement a git-fetcher in Nix's core that supports content hashes[1]. In #3549[2] it has been suggested to actually use `fetchTree` for this since it's a fairly generic wrapper over the new fetcher-API[3] and already supports content-hashes. This patch implements a new git-fetcher based on `fetchTree` by incorporating the following changes: * Removed the original `fetchGit`-implementation and replaced it with an alias on the `fetchTree` implementation. * Ensured that the `git`-fetcher from `libfetchers` always computes a content-hash and returns an "empty" revision on dirty trees (the latter one is needed to retain backwards-compatibility). * The hash-mismatch error in the fetcher-API exits with code 102 as it usually happens whenever a hash-mismatch is detected by Nix. * Removed the `flakes`-feature-flag: I didn't see a reason why this API is so tightly coupled to the flakes-API and at least `fetchGit` should remain usable without any feature-flags. * It's only possible to specify a `narHash` for a `git`-tree if either a `ref` or a `rev` is given[4]. * It's now possible to specify an URL without a protocol. If it's missing, `file://` is automatically added as it was the case in the original `fetchGit`-implementation. [1] https://github.com/NixOS/nix/pull/3216 [2] https://github.com/NixOS/nix/pull/3549#issuecomment-625194383 [3] https://github.com/NixOS/nix/pull/3459 [4] https://github.com/NixOS/nix/pull/3216#issuecomment-553956703
2020-07-17Test relative store pathsCarlo Nucera
2020-07-17parseFlakeRef(): Only search for the top-level directory for CLI flakerefsEelco Dolstra
2020-07-14Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-07-13Add a test for local NAR cachingEelco Dolstra
2020-07-13Fix 'nix verify --all' on a binary cache and add a testEelco Dolstra
2020-07-13Add a test for DWARF debug info index generationEelco Dolstra
2020-07-13Add a test for NAR listing generationEelco Dolstra
2020-07-10Merge remote-tracking branch 'origin/master' into substitute-other-storedirMatthew Bauer
2020-07-06nix develop: Support derivations with multiple outputsEelco Dolstra
2020-07-06Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-07-03Merge branch 'master' into add-traceBen Burdette
2020-07-03Merge pull request #3778 from tweag/parallel-testsEelco Dolstra
Parallel tests fixes
2020-07-03Hopefully fix macOS test failureEelco Dolstra
2020-07-03Shorten the path to the test rootregnat
Fix a socket length failure on the OSX builders
2020-07-03Fix the test dependenciesregnat
Reuse the pre-existing list rather than the one written as part of #3777
2020-07-02Add test for nix developEelco Dolstra
2020-07-02Merge remote-tracking branch 'origin/master' into substitute-other-storedirMatthew Bauer
2020-07-02Set gc-reserved-space to 0 in testsEelco Dolstra
This reduces the amount of disk space needed to run the tests from half a gigabyte to 10 megabytes.
2020-07-02Make the gc-auto test more reliableregnat
Use a fifo pipe to handle the synchronisation between the different threads rather than relying on delays
2020-07-02Make the gc-concurrent test more reliableregnat
Use a fifo pipe to handle the synchronisation between the different threads rather than relying on delays
2020-07-02Run the tests in parallelregnat
Cause the time needed to run the testsuite to drop from ~4mins to ~40s
2020-06-30'from string'Ben Burdette
2020-06-30Merge remote-tracking branch 'origin/master' into substitute-other-storedirMatthew Bauer
2020-06-30Merge branch 'master' into add-traceBen Burdette
2020-06-26Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-06-25build-remote.sh: Test LegacySSHStoreEelco Dolstra
2020-06-24nixCode -> LinesOfCodeBen Burdette
2020-06-18Merge branch 'master' into caveman-LOCsBen Burdette
2020-06-18github: Respect default branchEelco Dolstra
2020-06-17Merge remote-tracking branch 'origin/master' into substitute-other-storedirMatthew Bauer
2020-06-17Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-06-13Remove -vvvvv from tests/fetchurl.sh nix-build callMatthew Bauer
2020-06-13Correctly substitute from different storeDirMatthew Bauer
Originally, the test was only checking for different “real” storeDir. That’s an easy case to handle, but the much harder one is if different virtual store dirs are used. To do this, we need the SubstitutionGoal to know about the ca, so it can recalculate the path to copy it over. An important note here is that the store path passed to copyStorePath needs to be one for srcStore - so that queryPathInfo works properly. This also adds an error message when the store path from queryPathInfo is different from the one we requested.
2020-06-12Fix SRI testMatthew Bauer
We can’t use custom name here because different names will have different store paths. This is a limitation of the Store API’s reliance on store paths. We might be able to get around the above in the future by using a dummy name for certain fixed output paths.
2020-06-12Debug when storePath changesMatthew Bauer
these rewrites should be transparent, but they are important to know about when debugging
2020-06-12Replace --hashed-mirrors with substituters testMatthew Bauer
2020-06-11Merge remote-tracking branch 'upstream/master' into errors-phase-2Ben Burdette
2020-06-11Represent 'follows' inputs explicitly in the lock fileEelco Dolstra
This fixes an issue where lockfile generation was not idempotent: after updating a lockfile, a "follows" node would end up pointing to a new copy of the node, rather than to the original node.
2020-06-08Merge branch 'errors-phase-2' into caveman-LOCsBen Burdette
2020-06-08Actually test nix-env with a remote storeregnat
The `remote-store` test loads the `user-env` one to test nix-env when using the daemon, but actually does it incorrectly because every test starts (in `common.sh`) by resetting the value of `NIX_REMOTE`, meaning that the `user-env` test will never use the daemon. Fix this by setting `NIX_REMOTE_` before sourcing `user-env.sh` in the `remote-store` test, so that `NIX_REMOTE` is correctly set inside the test
2020-06-04nix flake init: Add a '--template' flagEelco Dolstra
The initial contents of the flake is specified by the 'templates.<name>' or 'defaultTemplate' output of another flake. E.g. outputs = { self }: { templates = { nixos-container = { path = ./nixos-container; description = "An example of a NixOS container"; }; }; }; allows $ nix flake init -t templates#nixos-container Also add a command 'nix flake new', which is identical to 'nix flake init' except that it initializes a specified directory rather than the current directory.
2020-06-03update error grepBen Burdette
2020-06-03Merge remote-tracking branch 'upstream/master' into errors-phase-2Ben Burdette
2020-06-03Fix GitHub testEelco Dolstra
2020-06-03Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-05-30Improve ref validity checking in fetchGitNikola Knezevic
The previous regex was too strict and did not match what git was allowing. It could lead to `fetchGit` not accepting valid branch names, even though they exist in a repository (for example, branch names containing `/`, which are pretty standard, like `release/1.0` branches). The new regex defines what a branch name should **NOT** contain. It takes the definitions from `refs.c` in https://github.com/git/git and `git help check-ref-format` pages. This change also introduces a test for ref name validity checking, which compares the result from Nix with the result of `git check-ref-format --branch`.