lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

nixos/homer: add tests

+74 -1
+1
nixos/tests/all-tests.nix
··· 436 436 hedgedoc = handleTest ./hedgedoc.nix {}; 437 437 herbstluftwm = handleTest ./herbstluftwm.nix {}; 438 438 homebox = handleTest ./homebox.nix {}; 439 + homer = handleTest ./homer {}; 439 440 homepage-dashboard = handleTest ./homepage-dashboard.nix {}; 440 441 honk = runTest ./honk.nix; 441 442 installed-tests = pkgs.recurseIntoAttrs (handleTest ./installed-tests {});
+30
nixos/tests/homer/caddy.nix
··· 1 + import ../make-test-python.nix ( 2 + { lib, ... }: 3 + 4 + { 5 + name = "homer-caddy"; 6 + meta.maintainers = with lib.maintainers; [ stunkymonkey ]; 7 + 8 + nodes.machine = 9 + { pkgs, ... }: 10 + { 11 + services.homer = { 12 + enable = true; 13 + virtualHost = { 14 + caddy.enable = true; 15 + domain = "localhost:80"; 16 + }; 17 + settings = { 18 + title = "testing"; 19 + }; 20 + }; 21 + }; 22 + 23 + testScript = '' 24 + machine.wait_for_unit("caddy.service") 25 + machine.wait_for_open_port(80) 26 + machine.succeed("curl --fail --show-error --silent http://localhost:80/ | grep '<title>Homer</title>'") 27 + machine.succeed("curl --fail --show-error --silent http://localhost:80/assets/config.yml | grep 'title: testing'") 28 + ''; 29 + } 30 + )
+6
nixos/tests/homer/default.nix
··· 1 + { system, pkgs, ... }: 2 + 3 + { 4 + caddy = import ./caddy.nix { inherit system pkgs; }; 5 + nginx = import ./nginx.nix { inherit system pkgs; }; 6 + }
+30
nixos/tests/homer/nginx.nix
··· 1 + import ../make-test-python.nix ( 2 + { lib, ... }: 3 + 4 + { 5 + name = "homer-nginx"; 6 + meta.maintainers = with lib.maintainers; [ stunkymonkey ]; 7 + 8 + nodes.machine = 9 + { pkgs, ... }: 10 + { 11 + services.homer = { 12 + enable = true; 13 + virtualHost = { 14 + nginx.enable = true; 15 + domain = "localhost"; 16 + }; 17 + settings = { 18 + title = "testing"; 19 + }; 20 + }; 21 + }; 22 + 23 + testScript = '' 24 + machine.wait_for_unit("nginx.service") 25 + machine.wait_for_open_port(80) 26 + machine.succeed("curl --fail --show-error --silent http://localhost:80/ | grep '<title>Homer</title>'") 27 + machine.succeed("curl --fail --show-error --silent http://localhost:80/assets/config.yml | grep 'title: testing'") 28 + ''; 29 + } 30 + )
+7 -1
pkgs/by-name/ho/homer/package.nix
··· 6 6 nodejs, 7 7 dart-sass, 8 8 nix-update-script, 9 + nixosTests, 9 10 }: 10 11 stdenvNoCC.mkDerivation rec { 11 12 pname = "homer"; ··· 54 55 runHook postInstall 55 56 ''; 56 57 57 - passthru.updateScript = nix-update-script { }; 58 + passthru = { 59 + updateScript = nix-update-script { }; 60 + tests = { 61 + inherit (nixosTests.homer) caddy nginx; 62 + }; 63 + }; 58 64 59 65 meta = with lib; { 60 66 description = "A very simple static homepage for your server.";