From 5d3d6037d8b92823e5cb106fa8d155a1b8333481 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 10 Mar 2025 20:27:45 +0100 Subject: [PATCH] nixos/tests/go-neb: migrate to runTest Part of #386873 --- nixos/tests/all-tests.nix | 2 +- nixos/tests/go-neb.nix | 95 ++++++++++++++++++++------------------- 2 files changed, 49 insertions(+), 48 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 7f463285a5d1..7a7b01238b6e 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -460,7 +460,7 @@ in { gnupg = handleTest ./gnupg.nix {}; goatcounter = handleTest ./goatcounter.nix {}; go-camo = handleTest ./go-camo.nix { }; - go-neb = handleTest ./go-neb.nix {}; + go-neb = runTest ./go-neb.nix; gobgpd = handleTest ./gobgpd.nix {}; gocd-agent = handleTest ./gocd-agent.nix {}; gocd-server = handleTest ./gocd-server.nix {}; diff --git a/nixos/tests/go-neb.nix b/nixos/tests/go-neb.nix index 38cf89c2a352..4aea2d436760 100644 --- a/nixos/tests/go-neb.nix +++ b/nixos/tests/go-neb.nix @@ -1,53 +1,54 @@ -import ./make-test-python.nix ( - { pkgs, ... }: - { - name = "go-neb"; - meta = with pkgs.lib.maintainers; { - maintainers = [ - hexa - maralorn - ]; - }; +{ + pkgs, + ... +}: +{ + name = "go-neb"; + meta = with pkgs.lib.maintainers; { + maintainers = [ + hexa + maralorn + ]; + }; - nodes = { - server = { - services.go-neb = { - enable = true; - baseUrl = "http://localhost"; - secretFile = pkgs.writeText "secrets" "ACCESS_TOKEN=changeme"; - config = { - clients = [ - { - UserId = "@test:localhost"; - AccessToken = "$ACCESS_TOKEN"; - HomeServerUrl = "http://localhost"; - Sync = false; - AutoJoinRooms = false; - DisplayName = "neverbeseen"; - } - ]; - services = [ - { - ID = "wikipedia_service"; - Type = "wikipedia"; - UserID = "@test:localhost"; - Config = { }; - } - ]; - }; + nodes = { + server = { + services.go-neb = { + enable = true; + baseUrl = "http://localhost"; + secretFile = pkgs.writeText "secrets" "ACCESS_TOKEN=changeme"; + config = { + clients = [ + { + UserId = "@test:localhost"; + AccessToken = "$ACCESS_TOKEN"; + HomeServerUrl = "http://localhost"; + Sync = false; + AutoJoinRooms = false; + DisplayName = "neverbeseen"; + } + ]; + services = [ + { + ID = "wikipedia_service"; + Type = "wikipedia"; + UserID = "@test:localhost"; + Config = { }; + } + ]; }; }; }; + }; - testScript = '' - start_all() - server.wait_for_unit("go-neb.service") - server.wait_until_succeeds("curl -fL http://localhost:4050/services/hooks/d2lraXBlZGlhX3NlcnZpY2U") - server.succeed( - "journalctl -eu go-neb -o cat | grep -q service_id=wikipedia_service", - "grep -q changeme /var/run/go-neb/config.yaml", - ) - ''; + testScript = '' + start_all() + server.wait_for_unit("go-neb.service") + server.wait_until_succeeds("curl -fL http://localhost:4050/services/hooks/d2lraXBlZGlhX3NlcnZpY2U") + server.succeed( + "journalctl -eu go-neb -o cat | grep -q service_id=wikipedia_service", + "grep -q changeme /var/run/go-neb/config.yaml", + ) + ''; - } -) +}