diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-12-23 18:42:29 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-12-23 18:42:29 +0100 |
commit | 201f7c00c4c7cf6e6b4f5296ff35f34c48d1c701 (patch) | |
tree | 908410c6edbecc46c5a1aea58efc2414cd6bb7c7 | |
parent | style(treewide): Format (diff) | |
download | nixos-server-201f7c00c4c7cf6e6b4f5296ff35f34c48d1c701.tar.gz nixos-server-201f7c00c4c7cf6e6b4f5296ff35f34c48d1c701.zip |
test(scripts/lint_missing_tests.sh): Remove
This functionality is now available via the `coImport` feature in the `mkByName` `nixLib` function.
-rwxr-xr-x | scripts/lint_missing_tests.sh | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/scripts/lint_missing_tests.sh b/scripts/lint_missing_tests.sh deleted file mode 100755 index dffb86e..0000000 --- a/scripts/lint_missing_tests.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env sh - -# Shell library {{{ -die() { - echo "$1" >&2 - exit 1 -} -warning() { - eprintln "\033[1;91m==> WARNING:\033[0m" "\033[1;93m$*\033[0m" -} -eprintln() { - >&2 println "$@" -} -println() { - printf "$*\n" -} -# }}} - -test_template() { - test_name="$(basename "$1")" - cat <<EOF -{pkgs}: -pkgs.testers.runNixOSTest { - name = "$test_name"; - - nodes.server = { pkgs, ... }: { - networking = { - firewall = { - allowedTCPPorts = [ 80 ]; - }; - }; - services.nginx = { - enable = true; - virtualHosts."server" = {}; - }; - }; - - nodes.client = { pkgs, ... }: { - environment.systemPackages = with pkgs; [ - curl - ]; - }; - - testScript = '' - server.wait_for_unit("default.target") - client.wait_for_unit("default.target") - client.succeed("curl http://server/ | grep -o \"Welcome to nginx!\"") - ''; -} -EOF -} - -cd "$(dirname "$0")/.." || die "Bug: The root dir does not exist" - -fd default.nix ./modules | while IFS= read -r dir; do - mkdir --parents "tests/$(dirname "$dir")" - - test_file="$(realpath --relative-to="$(pwd)" "tests/$(dirname "$dir")/test.nix")" - dir="$(realpath --relative-to="$(pwd)" "$dir")" - - if [ "$1" = generate ]; then - test_template "$dir" >"$test_file" - else - warning "'$dir' is missing it's test (at '$test_file')!" - fi -done |