diff options
author | Keanu Kerr <keanu@kerr.us> | 2024-01-03 22:35:12 +0100 |
---|---|---|
committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2024-01-17 11:10:28 +0100 |
commit | 28c4666e8b94ad87c8bc1801b7bf2441fca95e0c (patch) | |
tree | 963b32587b334372e7a03fe7cafb26a41fb3bacd /pkgs/test | |
parent | 9f8559e0ff9b5ccbf7b50b0f403c287bceb9c85f (diff) | |
download | nixlib-28c4666e8b94ad87c8bc1801b7bf2441fca95e0c.tar nixlib-28c4666e8b94ad87c8bc1801b7bf2441fca95e0c.tar.gz nixlib-28c4666e8b94ad87c8bc1801b7bf2441fca95e0c.tar.bz2 nixlib-28c4666e8b94ad87c8bc1801b7bf2441fca95e0c.tar.lz nixlib-28c4666e8b94ad87c8bc1801b7bf2441fca95e0c.tar.xz nixlib-28c4666e8b94ad87c8bc1801b7bf2441fca95e0c.tar.zst nixlib-28c4666e8b94ad87c8bc1801b7bf2441fca95e0c.zip |
tests.nixpkgs-check-by-name: added test that fails multiple validity checks
Diffstat (limited to 'pkgs/test')
11 files changed, 26 insertions, 0 deletions
diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/default.nix @@ -0,0 +1 @@ +import <test-nixpkgs> { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected new file mode 100644 index 000000000000..a05527312aa2 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/expected @@ -0,0 +1,14 @@ +pkgs/by-name/A: Invalid directory name "A", must be at most 2 ASCII characters consisting of a-z, 0-9, "-" or "_". +pkgs/by-name/A/fo@: Invalid package directory name "fo@", must be ASCII characters consisting of a-z, A-Z, 0-9, "-" or "_". +pkgs/by-name/A/fo@: Path foo.nix is a symlink which cannot be resolved: No such file or directory (os error 2). +pkgs/by-name/A/fo@: Path package.nix is a symlink pointing to a path outside the directory of that package. +pkgs/by-name/aa: This is a file, but it should be a directory. +pkgs/by-name/ba/bar: This path is a file, but it should be a directory. +pkgs/by-name/ba/baz: "package.nix" must be a file. +pkgs/by-name/ba/foo: Incorrect directory location, should be pkgs/by-name/fo/foo instead. +pkgs/by-name/ba/foo: File invalid.nix could not be parsed by rnix: unexpected token at 28..29 +pkgs/by-name/ba/foo: File package.nix at line 2 contains the path expression "/bar" which cannot be resolved: No such file or directory (os error 2). +pkgs/by-name/ba/foo: File package.nix at line 3 contains the path expression "../." which may point outside the directory of that package. +pkgs/by-name/ba/foo: File package.nix at line 4 contains the nix search path expression "<nixpkgs>" which may point outside the directory of that package. +pkgs/by-name/ba/foo: File package.nix at line 5 contains the path expression "./${"test"}", which is not yet supported and may point outside the directory of that package. +pkgs/by-name/fo/foo: Missing required "package.nix" file. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/A/fo@/foo.nix b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/A/fo@/foo.nix new file mode 120000 index 000000000000..5b25acea3f25 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/A/fo@/foo.nix @@ -0,0 +1 @@ +../../../../foo.nix \ No newline at end of file diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/A/fo@/package.nix b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/A/fo@/package.nix new file mode 120000 index 000000000000..f079163d158a --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/A/fo@/package.nix @@ -0,0 +1 @@ +../../../../someDrv.nix \ No newline at end of file diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/aa b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/aa new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/aa diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/bar b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/bar new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/bar diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/baz/package.nix/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/baz/package.nix/default.nix new file mode 100644 index 000000000000..a1b92efbbadb --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/baz/package.nix/default.nix @@ -0,0 +1 @@ +{ someDrv }: someDrv diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/foo/invalid.nix b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/foo/invalid.nix new file mode 100644 index 000000000000..ee6b002a529b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/foo/invalid.nix @@ -0,0 +1 @@ +this is not a valid nix file! diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/foo/package.nix b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/foo/package.nix new file mode 100644 index 000000000000..b552ce8c34c0 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/ba/foo/package.nix @@ -0,0 +1,6 @@ +{ someDrv }: someDrv // { + escape = /bar; + escape = ../.; + nixPath = <nixpkgs>; + pathWithSubexpr = ./${"test"}; +} diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/fo/foo/.git-keep b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/fo/foo/.git-keep new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/pkgs/by-name/fo/foo/.git-keep diff --git a/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/someDrv.nix b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/someDrv.nix new file mode 100644 index 000000000000..a1b92efbbadb --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/multiple-failures/someDrv.nix @@ -0,0 +1 @@ +{ someDrv }: someDrv |