mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
parent
28e1b64f0d
commit
754a229d74
2 changed files with 41 additions and 43 deletions
|
@ -516,7 +516,7 @@ in
|
||||||
ghostunnel = handleTest ./ghostunnel.nix { };
|
ghostunnel = handleTest ./ghostunnel.nix { };
|
||||||
gitdaemon = handleTest ./gitdaemon.nix { };
|
gitdaemon = handleTest ./gitdaemon.nix { };
|
||||||
gitea = handleTest ./gitea.nix { giteaPackage = pkgs.gitea; };
|
gitea = handleTest ./gitea.nix { giteaPackage = pkgs.gitea; };
|
||||||
github-runner = handleTest ./github-runner.nix { };
|
github-runner = runTest ./github-runner.nix;
|
||||||
gitlab = runTest ./gitlab.nix;
|
gitlab = runTest ./gitlab.nix;
|
||||||
gitolite = handleTest ./gitolite.nix { };
|
gitolite = handleTest ./gitolite.nix { };
|
||||||
gitolite-fcgiwrap = handleTest ./gitolite-fcgiwrap.nix { };
|
gitolite-fcgiwrap = handleTest ./gitolite-fcgiwrap.nix { };
|
||||||
|
|
|
@ -1,49 +1,47 @@
|
||||||
import ./make-test-python.nix (
|
{ pkgs, ... }:
|
||||||
{ pkgs, ... }:
|
{
|
||||||
{
|
name = "github-runner";
|
||||||
name = "github-runner";
|
meta = with pkgs.lib.maintainers; {
|
||||||
meta = with pkgs.lib.maintainers; {
|
maintainers = [ veehaitch ];
|
||||||
maintainers = [ veehaitch ];
|
};
|
||||||
};
|
nodes.machine =
|
||||||
nodes.machine =
|
{ pkgs, ... }:
|
||||||
{ pkgs, ... }:
|
{
|
||||||
{
|
services.github-runners.test = {
|
||||||
services.github-runners.test = {
|
enable = true;
|
||||||
enable = true;
|
url = "https://github.com/yaxitech";
|
||||||
url = "https://github.com/yaxitech";
|
tokenFile = builtins.toFile "github-runner.token" "not-so-secret";
|
||||||
tokenFile = builtins.toFile "github-runner.token" "not-so-secret";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.github-runners.test-disabled = {
|
|
||||||
enable = false;
|
|
||||||
url = "https://github.com/yaxitech";
|
|
||||||
tokenFile = builtins.toFile "github-runner.token" "not-so-secret";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.dummy-github-com = {
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
before = [ "github-runner-test.service" ];
|
|
||||||
script = "${pkgs.netcat}/bin/nc -Fl 443 | true && touch /tmp/registration-connect";
|
|
||||||
};
|
|
||||||
networking.hosts."127.0.0.1" = [ "api.github.com" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
services.github-runners.test-disabled = {
|
||||||
start_all()
|
enable = false;
|
||||||
|
url = "https://github.com/yaxitech";
|
||||||
|
tokenFile = builtins.toFile "github-runner.token" "not-so-secret";
|
||||||
|
};
|
||||||
|
|
||||||
machine.wait_for_unit("dummy-github-com")
|
systemd.services.dummy-github-com = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
before = [ "github-runner-test.service" ];
|
||||||
|
script = "${pkgs.netcat}/bin/nc -Fl 443 | true && touch /tmp/registration-connect";
|
||||||
|
};
|
||||||
|
networking.hosts."127.0.0.1" = [ "api.github.com" ];
|
||||||
|
};
|
||||||
|
|
||||||
try:
|
testScript = ''
|
||||||
machine.wait_for_unit("github-runner-test")
|
start_all()
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
out = machine.succeed("journalctl -u github-runner-test")
|
machine.wait_for_unit("dummy-github-com")
|
||||||
assert "Self-hosted runner registration" in out, "did not read runner registration header"
|
|
||||||
|
|
||||||
machine.wait_until_succeeds("test -f /tmp/registration-connect")
|
try:
|
||||||
|
machine.wait_for_unit("github-runner-test")
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
machine.fail("systemctl list-unit-files | grep test-disabled")
|
out = machine.succeed("journalctl -u github-runner-test")
|
||||||
'';
|
assert "Self-hosted runner registration" in out, "did not read runner registration header"
|
||||||
}
|
|
||||||
)
|
machine.wait_until_succeeds("test -f /tmp/registration-connect")
|
||||||
|
|
||||||
|
machine.fail("systemctl list-unit-files | grep test-disabled")
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue