Eelco Dolstra
95437b90fc
lockFlake(): When updating a lock, respect the input's lock file
2025-07-09 19:19:15 +02:00
Vladimír Čunát
77f6b6532f
tests: fixup with jq-1.8.0
2025-06-18 10:11:50 +02:00
Eelco Dolstra
824e0d51fe
Test lock file contents more precisely
2025-05-13 10:40:24 +02:00
Jörg Thalheim
6405d6822d
tests/flakes: add regression test for resolving user flakes
2025-04-25 10:34:41 +02:00
Eelco Dolstra
68de26d38a
lockFlake(): Allow registry lookups for the top-level flake
...
Fixes #13050 .
2025-04-24 18:59:10 +02:00
Eelco Dolstra
dda265f09a
Reapply "Actually ignore system/user registries during locking"
...
This reverts commit 3b5f0d9fb3 .
2025-04-24 17:33:27 +02:00
Jörg Thalheim
3b5f0d9fb3
Revert "Actually ignore system/user registries during locking"
...
This reverts commit 77d4316353 .
2025-04-24 11:28:11 +02:00
Eelco Dolstra
77d4316353
Actually ignore system/user registries during locking
...
Something went wrong in #12068 so this didn't work. Also added a test.
2025-04-09 17:59:51 +02:00
John Ericson
e02026adae
Merge pull request #12254 from DeterminateSystems/fix-relative-path-on-cli
...
Fix relative 'path:' flakerefs in the CLI
2025-01-15 15:19:56 -05:00
Eelco Dolstra
ff8e2fe84e
Fix relative 'path:' flakerefs in the CLI
...
And handle relative 'git+file:' flakerefs while we're at it (these
crashed with an assertion failure).
Fixes #12248 .
2025-01-14 17:30:13 +01:00
Robert Hensing
d9a50c0af2
Clarify cd call in tests/functional/flakes/flakes.sh
2025-01-10 09:57:54 +01:00
Bryan Lai
9d088fa502
tests/flakes: check git+file:./${submodule} protocol
...
Relative, local git repo used to work (for submodules), but it
fails after 3e0129ce3b .
This commit adds a test to prevent such failure in the future.
2025-01-10 11:37:29 +08:00
Eelco Dolstra
757ea70644
Add a test
2024-12-17 13:13:39 +01:00
Eelco Dolstra
6832ee5d6f
Move non-flake input tests into a separate file
2024-11-20 19:51:04 +01:00
Eelco Dolstra
e1cb905aca
Move --commit-lock-file-summary tests into a separate file
2024-11-20 18:42:33 +01:00
Eelco Dolstra
5533b0c735
Move shebang flake tests into a separate test
2024-11-20 18:08:31 +01:00
John Ericson
9d2ed0a7d3
No longer copy functional tests to the build dir
...
This should make `_NIX_TEST_ACCEPT=1` work again, fixing #11369 .
Progress on #2503
2024-11-03 16:42:38 -05:00
Eelco Dolstra
c5a4dfa660
nix flake {metadata,archive}: Fix chroot stores
...
Fixes
$ nix flake metadata --store /tmp/nix nixpkgs
error: path '/tmp/nix/nix/store/65xpqkz92d9j7k5ric4z8lzhiigxsfbg-source/flake.nix' is not in the Nix store
This has been broken since 598deb2b23 .
2024-09-09 15:41:38 +02:00
Eelco Dolstra
1ff186fc6e
nix flake metadata: Show flake fingerprint
...
This is useful for testing/debugging and maybe for sharing eval caches
(since it tells you what file in ~/.cache/nix/eval-cache-v5 to copy).
2024-07-03 17:00:30 +02:00
Cole Helbling
9e9730ef0f
Test that commit-lock-file-summary and its alias work
2024-06-28 14:53:40 -07:00
Robert Hensing
8557d79650
tests/functional: Skip tests that don't work in NixOS environment yet
2024-06-20 14:54:11 +02:00
John Ericson
10f864c5ae
Ensure all functional scripts are (a) executable (b) have shebang
...
This is good for shebang, and also good for future build system
simplifications
2024-05-28 12:46:24 -04:00
Eelco Dolstra
1f41682217
Update tests/functional/flakes/flakes.sh
...
Co-authored-by: John Ericson <git@JohnEricson.me>
2024-04-30 18:10:16 +02:00
Eelco Dolstra
f29a220b70
Test that the root of a tree produces /nix/store/<hash1>-<hash2>-source
2024-04-30 17:25:35 +02:00
Eelco Dolstra
503be57bbd
Test baseNameOf behaviour on the root of a flake
2024-04-30 15:43:33 +02:00
Eelco Dolstra
458441c637
Test dirOf behaviour on the root of a flake
2024-04-30 15:34:38 +02:00
Cyclic4179
9f7b2b93ce
fixup! add flakes.sh test for shebang supported types of comments
2024-03-27 15:03:54 +01:00
Cyclic4179
6227cd06bd
add flakes.sh test for shebang supported types of comments
2024-03-27 14:55:02 +01:00
Olmo Kramer
b1ad729add
Add test for nix flake update with multiple inputs
2024-03-03 13:59:39 +01:00
Fabian Möller
994f1b5c0d
Add test cases for flake urls with fragments
2023-12-11 16:05:34 +01:00
Robert Hensing
466271568b
nix: Parse --file relative to shebang script
2023-11-07 13:24:01 -05:00
Robert Hensing
198bc22e3b
nix: Add command baseDir to parse --expr relative to shebang script
2023-11-07 13:24:01 -05:00
Robert Hensing
20ff61ab25
nix: Reserve shebang line syntax and only parse double backtick quotes
...
Being restrictive about syntax leaves opportunity to improve the
syntax and functionality later.
2023-11-07 13:24:01 -05:00
Tom Bereknyei
06f3583b1c
feat: break out of shebang processing for non-comments
2023-11-07 13:24:01 -05:00
Tom Bereknyei
bfcbf3b5bf
doc: shebang release notes, docs, tests
...
fix: release notes
2023-11-07 13:24:01 -05:00
Tom Bereknyei
eea5a003d9
fix: test to ensure arguments are passed
2023-11-07 13:24:01 -05:00
Tom Bereknyei
74210c12fe
Shellbang support with flakes
...
Enables shebang usage of nix shell. All arguments with `#! nix` get
added to the nix invocation. This implementation does NOT set any
additional arguments other than placing the script path itself as the
first argument such that the interpreter can utilize it.
Example below:
```
#!/usr/bin/env nix
#! nix shell --quiet
#! nix nixpkgs#bash
#! nix nixpkgs#shellcheck
#! nix nixpkgs#hello
#! nix --ignore-environment --command bash
# shellcheck shell=bash
set -eu
shellcheck "$0" || exit 1
function main {
hello
echo 0:"$0" 1:"$1" 2:"$2"
}
"$@"
```
fix: include programName usage
EDIT: For posterity I've changed shellwords to shellwords2 in order
not to interfere with other changes during a rebase.
shellwords2 is removed in a later commit. -- roberth
2023-11-07 13:24:01 -05:00
Felix Uhl
c7dcdb8325
Overhaul nix flake update and lock commands
...
Closes #5110
2023-10-31 15:33:57 +01:00
John Ericson
68c81c7375
Put functional tests in tests/functional
...
I think it is bad for these reasons when `tests/` contains a mix of
functional and integration tests
- Concepts is harder to understand, the documentation makes a good
unit vs functional vs integration distinction, but when the
integration tests are just two subdirs within `tests/` this is not
clear.
- Source filtering in the `flake.nix` is more complex. We need to
filter out some of the dirs from `tests/`, rather than simply pick
the dirs we want and take all of them. This is a good sign the
structure of what we are trying to do is not matching the structure
of the files.
With this change we have a clean:
```shell-session
$ git show 'HEAD:tests'
tree HEAD:tests
functional/
installer/
nixos/
```
2023-10-06 09:05:56 -04:00