diff options
author | Muhammad Falak R Wani <falakreyaz@gmail.com> | 2024-03-20 10:24:40 +0530 |
---|---|---|
committer | Adam Stephens <adam@valkor.net> | 2024-03-20 09:25:38 -0400 |
commit | f3a20533b7f75b03f350ef3b4d51b0b829b1d33d (patch) | |
tree | 5d559f7ffe098118effb2ee00ef0b8ff44aaf85e /pkgs/shells/fish | |
parent | ce9d71e62b5374ed9e4328d093e45da4a6c0da7b (diff) |
fish: fix passthru tests for darwin
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Diffstat (limited to 'pkgs/shells/fish')
-rw-r--r-- | pkgs/shells/fish/default.nix | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/pkgs/shells/fish/default.nix b/pkgs/shells/fish/default.nix index 91b3ce0b0eb9d..0013c205f31f2 100644 --- a/pkgs/shells/fish/default.nix +++ b/pkgs/shells/fish/default.nix @@ -308,7 +308,7 @@ let passthru = { shellPath = "/bin/fish"; tests = { - nixos = nixosTests.fish; + nixos = lib.optionalAttrs stdenv.isLinux nixosTests.fish; # Test the fish_config tool by checking the generated splash page. # Since the webserver requires a port to run, it is not started. @@ -322,18 +322,17 @@ let # if we don't set `delete=False`, the file will get cleaned up # automatically (leading the test to fail because there's no # tempfile to check) - sed -e 's@, mode="w"@, mode="w", delete=False@' -i webconfig.py + ${lib.getExe gnused} -e 's@, mode="w"@, mode="w", delete=False@' -i webconfig.py # we delete everything after the fileurl is assigned - sed -e '/fileurl =/q' -i webconfig.py + ${lib.getExe gnused} -e '/fileurl =/q' -i webconfig.py echo "print(fileurl)" >> webconfig.py # and check whether the message appears on the page - cat (${python3}/bin/python ./webconfig.py \ - | tail -n1 | sed -ne 's|.*\(/build/.*\)|\1|p' \ - ) | grep 'a href="http://localhost.*Start the Fish Web config' - # cannot test the http server because it needs a localhost port + cat (${python3}/bin/python ./webconfig.py \ + | tail -n1 | ${lib.getExe gnused} -e 's|file://||' \ + ) | ${lib.getExe gnugrep} -q 'a href="http://localhost.*Start the Fish Web config' ''; in runCommand "test-web-config" { } '' |