diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/fetchers.sh | 91 | ||||
-rwxr-xr-x | tests/functional/install-darwin.sh | 2 | ||||
-rw-r--r-- | tests/functional/lang/parse-fail-eof-pos.err.exp | 2 | ||||
-rw-r--r-- | tests/functional/lang/parse-fail-undef-var-2.err.exp | 2 | ||||
-rw-r--r-- | tests/functional/lang/parse-fail-utf8.err.exp | 2 | ||||
-rw-r--r-- | tests/functional/meson.build | 1 | ||||
-rwxr-xr-x | tests/functional/nix-daemon-untrusting.sh | 2 | ||||
-rwxr-xr-x | tests/functional/push-to-store-old.sh | 2 | ||||
-rwxr-xr-x | tests/functional/push-to-store.sh | 2 | ||||
-rw-r--r-- | tests/nixos/tarball-flakes.nix | 2 |
10 files changed, 8 insertions, 100 deletions
diff --git a/tests/functional/fetchers.sh b/tests/functional/fetchers.sh deleted file mode 100644 index 0f888dc33..000000000 --- a/tests/functional/fetchers.sh +++ /dev/null @@ -1,91 +0,0 @@ -source common.sh - -requireGit - -clearStore - -testFetchTreeError() { - rawFetchTreeArg="${1?fetchTree arg missing}" - messageSubstring="${2?messageSubstring missing}" - - output="$(nix eval --impure --raw --expr "(builtins.fetchTree $rawFetchTreeArg).outPath" 2>&1)" && status=0 || status=$? - grepQuiet "$messageSubstring" <<<"$output" - test "$status" -ne 0 -} - -# github/gitlab/sourcehut fetcher input validation -for provider in github gitlab sourcehut; do - # ref/rev validation - testFetchTreeError \ - "{ type = \"$provider\"; owner = \"foo\"; repo = \"bar\"; ref = \",\"; }" \ - "URL '$provider:foo/bar' contains an invalid branch/tag name" - - testFetchTreeError \ - "\"$provider://host/foo/bar/,\"" \ - "URL '$provider:foo/bar', ',' is not a commit hash or a branch/tag name" - - testFetchTreeError \ - "\"$provider://host/foo/bar/f16d8f43dd0998cdb315a2cccf2e4d10027e7ca4?rev=abc\"" \ - "URL '$provider://host/foo/bar/f16d8f43dd0998cdb315a2cccf2e4d10027e7ca4?rev=abc' already contains a ref or rev" - - testFetchTreeError \ - "\"$provider://host/foo/bar/ref?ref=ref2\"" \ - "URL '$provider://host/foo/bar/ref?ref=ref2' already contains a ref or rev" - - # host validation - testFetchTreeError \ - "{ type = \"$provider\"; owner = \"foo\"; repo = \"bar\"; host = \"git_hub.com\"; }" \ - "URL '$provider:foo/bar' contains an invalid instance host" - - testFetchTreeError \ - "\"$provider://host/foo/bar/ref?host=git_hub.com\"" \ - "URL '$provider:foo/bar' contains an invalid instance host" - - # invalid attributes - testFetchTreeError \ - "{ type = \"$provider\"; owner = \"foo\"; repo = \"bar\"; wrong = true; }" \ - "unsupported input attribute 'wrong'" - - testFetchTreeError \ - "\"$provider://host/foo/bar/ref?wrong=1\"" \ - "unsupported input attribute 'wrong'" -done - -# unsupported attributes w/ tarball fetcher -testFetchTreeError \ - "\"https://host/foo?wrong=1\"" \ - "unsupported tarball input attribute 'wrong'. If you wanted to fetch a tarball with a query parameter, please use '{ type = \"tarball\"; url = \"...\"; }" - -# test for unsupported attributes / validation in git fetcher -testFetchTreeError \ - "\"git+https://github.com/owner/repo?invalid=1\"" \ - "unsupported Git input attribute 'invalid'" - -testFetchTreeError \ - "\"git+https://github.com/owner/repo?url=foo\"" \ - "URL 'git+https://github.com/owner/repo?url=foo' must not override url via query param!" - -testFetchTreeError \ - "\"git+https://github.com/owner/repo?ref=foo.lock\"" \ - "invalid Git branch/tag name 'foo.lock'" - -testFetchTreeError \ - "{ type = \"git\"; url =\"https://github.com/owner/repo\"; ref = \"foo.lock\"; }" \ - "invalid Git branch/tag name 'foo.lock'" - -# same for mercurial -testFetchTreeError \ - "\"hg+https://forge.tld/owner/repo?invalid=1\"" \ - "unsupported Mercurial input attribute 'invalid'" - -testFetchTreeError \ - "{ type = \"hg\"; url = \"https://forge.tld/owner/repo\"; invalid = 1; }" \ - "unsupported Mercurial input attribute 'invalid'" - -testFetchTreeError \ - "\"hg+https://forge.tld/owner/repo?ref=,\"" \ - "invalid Mercurial branch/tag name ','" - -testFetchTreeError \ - "{ type = \"hg\"; url = \"https://forge.tld/owner/repo\"; ref = \",\"; }" \ - "invalid Mercurial branch/tag name ','" diff --git a/tests/functional/install-darwin.sh b/tests/functional/install-darwin.sh index ea2b75323..c785437f4 100755 --- a/tests/functional/install-darwin.sh +++ b/tests/functional/install-darwin.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash set -eux diff --git a/tests/functional/lang/parse-fail-eof-pos.err.exp b/tests/functional/lang/parse-fail-eof-pos.err.exp index ef9ca381c..fc56897e4 100644 --- a/tests/functional/lang/parse-fail-eof-pos.err.exp +++ b/tests/functional/lang/parse-fail-eof-pos.err.exp @@ -1,4 +1,4 @@ -error: syntax error, unexpected end of file +error: syntax error, unexpected end of file, expecting expression at «stdin»:3:1: 2| # no content 3| diff --git a/tests/functional/lang/parse-fail-undef-var-2.err.exp b/tests/functional/lang/parse-fail-undef-var-2.err.exp index 393c454dd..d1728f125 100644 --- a/tests/functional/lang/parse-fail-undef-var-2.err.exp +++ b/tests/functional/lang/parse-fail-undef-var-2.err.exp @@ -1,4 +1,4 @@ -error: syntax error, unexpected ':', expecting '}' +error: syntax error, expecting '}' at «stdin»:3:13: 2| 3| f = {x, y : ["baz" "bar" z "bat"]}: x + y; diff --git a/tests/functional/lang/parse-fail-utf8.err.exp b/tests/functional/lang/parse-fail-utf8.err.exp index 1c83f6eb3..81df9dc8a 100644 --- a/tests/functional/lang/parse-fail-utf8.err.exp +++ b/tests/functional/lang/parse-fail-utf8.err.exp @@ -1,4 +1,4 @@ -error: syntax error, unexpected invalid token, expecting end of file +error: syntax error, expecting end of file at «stdin»:1:5: 1| 123 é 4 | ^ diff --git a/tests/functional/meson.build b/tests/functional/meson.build index f1c97f996..eede1834c 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -93,7 +93,6 @@ functional_tests_scripts = [ 'fetchGitRefs.sh', 'gc-runtime.sh', 'tarball.sh', - 'fetchers.sh', 'fetchGit.sh', 'fetchurl.sh', 'fetchPath.sh', diff --git a/tests/functional/nix-daemon-untrusting.sh b/tests/functional/nix-daemon-untrusting.sh index bcdb70989..22f0d45ae 100755 --- a/tests/functional/nix-daemon-untrusting.sh +++ b/tests/functional/nix-daemon-untrusting.sh @@ -1,3 +1,3 @@ -#!/bin/sh +#!/usr/bin/env bash exec nix-daemon --force-untrusted "$@" diff --git a/tests/functional/push-to-store-old.sh b/tests/functional/push-to-store-old.sh index 4187958b2..21f55b70e 100755 --- a/tests/functional/push-to-store-old.sh +++ b/tests/functional/push-to-store-old.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash set -x set -e diff --git a/tests/functional/push-to-store.sh b/tests/functional/push-to-store.sh index 9e4e475e0..fe551179e 100755 --- a/tests/functional/push-to-store.sh +++ b/tests/functional/push-to-store.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash set -x set -e diff --git a/tests/nixos/tarball-flakes.nix b/tests/nixos/tarball-flakes.nix index 5deba4a12..ca7627bd1 100644 --- a/tests/nixos/tarball-flakes.nix +++ b/tests/nixos/tarball-flakes.nix @@ -69,7 +69,7 @@ in # Check that we got redirected to the immutable URL. locked_url = info["locked"]["url"] - assert locked_url == "http://localhost/stable/${nixpkgs.rev}.tar.gz?rev=${nixpkgs.rev}&revCount=1234", f"{locked_url=} != http://localhost/stable/${nixpkgs.rev}.tar.gz" + assert locked_url == "http://localhost/stable/${nixpkgs.rev}.tar.gz", f"{locked_url=} != http://localhost/stable/${nixpkgs.rev}.tar.gz" # Check that we got the rev and revCount attributes. revision = info["revision"] |