aboutsummaryrefslogtreecommitdiff
path: root/tests/local.mk
AgeCommit message (Collapse)Author
2023-02-27Merge pull request #7796 from hercules-ci/fix-7263Théophane Hufschmitt
Ensure that `self.outPath == ./.`
2023-02-23Clean up daemon handlingJohn Ericson
Split `common.sh` into the vars and functions definitions vs starting the daemon (and possibly other initialization logic). This way, `init.sh` can just `source` the former. Trying to start the daemon before `nix.conf` is written will fail because `nix daemon` requires `--experimental-features 'nix-command'`. `killDaemon` is idempotent, so it's safe to call when no daemon is running. `startDaemon` and `killDaemon` use the PID (which is now exported to subshells) to decide whether there is work to be done, rather than `NIX_REMOTE`, which might conceivably be set differently even if a daemon is running. `startDaemon` and `killDaemon` can save/restore the old `NIX_REMOTE` as `NIX_REMOTE_OLD`. `init.sh` kills daemon before deleting everything (including the daemon socket).
2023-02-23Make init.sh safe to run twiceJohn Ericson
`init.sh` is tested on its own. We used to do that. I deleted it in 4720853129b6866775edd9f90ad6f10701f98a3c but I am not sure why. Better to just restore it; at one point working on this every other test passed, so seems good to check whether `init.sh` can be run twice. We don't *need* to run `init.sh` twice, but I want to try to make our tests as robust as possible so that manual debugging (where tests for better or worse might be run ways that we didn't expect) is less fragile.
2023-02-22flakes: Ensure that `self.outPath == ./.`Robert Hensing
Users expect `self` to refer to the directory where the `flake.nix` file resides.
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-01-30Merge pull request #5226 from NixOS/client-side-profilesEelco Dolstra
Move the default profiles to the user’s home
2023-01-27Add a test for `nix flake show`Théophane Hufschmitt
2023-01-17Test the migration of the user profilesThéophane Hufschmitt
2023-01-10Merge remote-tracking branch 'origin/master' into fix-7417Eelco Dolstra
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`)
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-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-10-18Add command 'nix store path-from-hash-part'Eelco Dolstra
This exposes the Store::queryPathFromHashPart() interface in the CLI.
2022-07-18Merge pull request #6784 from tweag/completion-testThéophane Hufschmitt
Add some tests for the CLI completion
2022-07-13Split off 'nix flake check' testsEelco Dolstra
2022-07-13Move flake-searching.sh and make it less dependent on gitEelco Dolstra
2022-07-13Move flake-local-settings.shEelco Dolstra
2022-07-13Move the 'nix bundle' testsEelco Dolstra
Note: these were previously not actually called.
2022-07-13Split off following paths testsEelco Dolstra
2022-07-13Split off 'nix flake init' testsEelco Dolstra
2022-07-13Split off the circular flake import testsEelco Dolstra
2022-07-13Split off the Mercurial flake testsEelco Dolstra
2022-07-13Move flakes tests to a subdirectoryEelco Dolstra
2022-07-12Fix the name of the completions testThéophane Hufschmitt
2022-07-12Add some tests for the CLI completionThéophane Hufschmitt
2022-06-22Enable/fix tests in nix-staticEelco Dolstra
pkgsStatic is apparently considered a cross environment, so checkPhase and installCheckPhase are disabled even when we ask for them.
2022-05-19fetchTree: Allow fetching plain filesTony Olagbaiye
Add a new `file` fetcher type, which will fetch a plain file over http(s), or from the local file. Because plain `http(s)://` or `file://` urls can already correspond to `tarball` inputs (if the path ends-up with a know archive extension), the URL parsing logic is a bit convuluted in that: - {http,https,file}:// urls will be interpreted as either a tarball or a file input, depending on the extensions of the path part (so `https://foo.com/bar` will be a `file` input and `https://foo.com/bar.tar.gz` as a `tarball` input) - `file+{something}://` urls will be interpreted as `file` urls (with the `file+` part removed) - `tarball+{something}://` urls will be interpreted as `tarball` urls (with the `tarball+` part removed) Fix #3785 Co-Authored-By: Tony Olagbaiye <me@fron.io>
2022-04-21nix: add (failing) selfreference test for multiple realizationsSergei Trofimovich
The test illustrates failure in issue #5320. Here derivation and it's built input have identical CA sotre path. As a result we generate extraneout reference to build input: $ make installcheck ... ran test tests/selfref-gc.sh... [PASS] ran test tests/ca/selfref-gc.sh... [FAIL] ... deleting '/tmp/.../tests/ca/selfref-gc/store/iqciq1mpg5hc7p6a52fp2bjxbyc9av0v-selfref-gc' deleting '/tmp/...tests/ca/selfref-gc/store/zh0kwpnirw3qbv6dl1ckr1y0kd5aw6ax-selfref-gc.drv' error: executing SQLite statement 'delete from ValidPaths where path = '/tmp/.../tests/ca/selfref-gc/store/fsjq0k146r85lsh01l0icl30rnhv7z72-selfref-gc';': constraint failed (in '/tmp/.../tests/ca/selfref-gc/var/nix/db/db.sqlite')
2022-04-19Merge branch 'issue-6075' of https://github.com/kamadorueda/nixEelco Dolstra
2022-04-14fix: ensure apps are apps and packages are packagesTom Bereknyei
2022-03-31Add support for impure derivationsEelco Dolstra
Impure derivations are derivations that can produce a different result every time they're built. Example: stdenv.mkDerivation { name = "impure"; __impure = true; # marks this derivation as impure outputHashAlgo = "sha256"; outputHashMode = "recursive"; buildCommand = "date > $out"; }; Some important characteristics: * This requires the 'impure-derivations' experimental feature. * Impure derivations are not "cached". Thus, running "nix-build" on the example above multiple times will cause a rebuild every time. * They are implemented similar to CA derivations, i.e. the output is moved to a content-addressed path in the store. The difference is that we don't register a realisation in the Nix database. * Pure derivations are not allowed to depend on impure derivations. In the future fixed-output derivations will be allowed to depend on impure derivations, thus forming an "impurity barrier" in the dependency graph. * When sandboxing is enabled, impure derivations can access the network in the same way as fixed-output derivations. In relaxed sandboxing mode, they can access the local filesystem.
2022-03-24Add a test for fetchClosure and 'nix store make-content-addressed'Eelco Dolstra
2022-03-17Merge pull request #6270 from Artturin/stdinevalThéophane Hufschmitt
nix: allow using --file - to read from stdin
2022-03-16add tests for nix eval and nix-instantiateArtturin
2022-03-15Implement simple test for `path`-fetcher setting a correct `lastModifiedDate`Maximilian Bosch
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2022-03-11nix-fmt: add commandKevin Amado
2022-03-07Add some end-to-end tests for the suggestionsregnat
2022-03-02Add basic tests for 'nix profile'Eelco Dolstra
Fixes #6193.
2022-03-02tests: Rename nix-profile.sh -> bash-profile.shEelco Dolstra
2022-02-24Sort the tests by wall timeregnat
The tests are scheduled in the order they appear, so running the long ones first slightly improves the scheduling. On my machine, this decreases the time of `make install` from 40s to 36s
2022-01-28Merge branch 'master' into bundler_drvtomberek
2022-01-27Don’t require `NIX_PATH` entries to be valid pathsregnat
It’s totally valid to have entries in `NIX_PATH` that aren’t valid paths (they can even be arbitrary urls or `channel:<channel-name>`). Fix #5998 and #5980
2022-01-26Add some tests for `nix store ping`regnat
Always good to have :)
2022-01-25bundler: add tests and change defaults to use a derivationTom Bereknyei
2022-01-18Add a simple test for `nix why-depends`regnat
2022-01-18Merge pull request #5720 from tomberek/flake_searchThéophane Hufschmitt
flakes: search up to git or filesystem boundary
2022-01-09Add test for readFile keeping contextNikolay Amiantov
2021-12-23Merge branch 'master' into flake_searchtomberek
2021-12-21Fix IFD with CA derivationsregnat
Rewrite the string taken by the IFD-like primops to contain the actual output paths of the derivations rather than the placeholders Fix #5805