mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
shellcheck fix: tests/functional/parallel.sh
This commit is contained in:
parent
4dc5dbaba2
commit
ef17baf50d
2 changed files with 7 additions and 7 deletions
|
|
@ -106,7 +106,6 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
excludes = [
|
excludes = [
|
||||||
# We haven't linted these files yet
|
# We haven't linted these files yet
|
||||||
''^tests/functional/parallel\.sh$''
|
|
||||||
''^tests/functional/pass-as-file\.sh$''
|
''^tests/functional/pass-as-file\.sh$''
|
||||||
''^tests/functional/path-from-hash-part\.sh$''
|
''^tests/functional/path-from-hash-part\.sh$''
|
||||||
''^tests/functional/path-info\.sh$''
|
''^tests/functional/path-info\.sh$''
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
# shellcheck shell=bash
|
||||||
source common.sh
|
source common.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -8,7 +9,7 @@ TODO_NixOS
|
||||||
|
|
||||||
clearStore
|
clearStore
|
||||||
|
|
||||||
rm -f $_NIX_TEST_SHARED.cur $_NIX_TEST_SHARED.max
|
rm -f "$_NIX_TEST_SHARED".cur "$_NIX_TEST_SHARED".max
|
||||||
|
|
||||||
outPath=$(nix-build -j10000 parallel.nix --no-out-link)
|
outPath=$(nix-build -j10000 parallel.nix --no-out-link)
|
||||||
|
|
||||||
|
|
@ -17,8 +18,8 @@ echo "output path is $outPath"
|
||||||
text=$(cat "$outPath")
|
text=$(cat "$outPath")
|
||||||
if test "$text" != "abacade"; then exit 1; fi
|
if test "$text" != "abacade"; then exit 1; fi
|
||||||
|
|
||||||
if test "$(cat $_NIX_TEST_SHARED.cur)" != 0; then fail "wrong current process count"; fi
|
if test "$(cat "$_NIX_TEST_SHARED".cur)" != 0; then fail "wrong current process count"; fi
|
||||||
if test "$(cat $_NIX_TEST_SHARED.max)" != 3; then fail "not enough parallelism"; fi
|
if test "$(cat "$_NIX_TEST_SHARED".max)" != 3; then fail "not enough parallelism"; fi
|
||||||
|
|
||||||
|
|
||||||
# Second, test that parallel invocations of nix-build perform builds
|
# Second, test that parallel invocations of nix-build perform builds
|
||||||
|
|
@ -27,7 +28,7 @@ echo "testing multiple nix-build -j1..."
|
||||||
|
|
||||||
clearStore
|
clearStore
|
||||||
|
|
||||||
rm -f $_NIX_TEST_SHARED.cur $_NIX_TEST_SHARED.max
|
rm -f "$_NIX_TEST_SHARED".cur "$_NIX_TEST_SHARED".max
|
||||||
|
|
||||||
drvPath=$(nix-instantiate parallel.nix --argstr sleepTime 15)
|
drvPath=$(nix-instantiate parallel.nix --argstr sleepTime 15)
|
||||||
|
|
||||||
|
|
@ -54,5 +55,5 @@ wait $pid2 || fail "instance 2 failed: $?"
|
||||||
wait $pid3 || fail "instance 3 failed: $?"
|
wait $pid3 || fail "instance 3 failed: $?"
|
||||||
wait $pid4 || fail "instance 4 failed: $?"
|
wait $pid4 || fail "instance 4 failed: $?"
|
||||||
|
|
||||||
if test "$(cat $_NIX_TEST_SHARED.cur)" != 0; then fail "wrong current process count"; fi
|
if test "$(cat "$_NIX_TEST_SHARED".cur)" != 0; then fail "wrong current process count"; fi
|
||||||
if test "$(cat $_NIX_TEST_SHARED.max)" != 3; then fail "not enough parallelism"; fi
|
if test "$(cat "$_NIX_TEST_SHARED".max)" != 3; then fail "not enough parallelism"; fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue