resync hydra with upstream #4

Merged
ahuston-0 merged 36 commits from feature/resync into add-gitea-pulls 2025-04-09 11:38:41 -04:00
Showing only changes of commit eddc234915 - Show all commits

View File

@ -27,8 +27,7 @@ in
{ {
install = forEachSystem (system: install = forEachSystem (system:
with import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; }; (import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; }).simpleTest {
simpleTest {
name = "hydra-install"; name = "hydra-install";
nodes.machine = hydraServer; nodes.machine = hydraServer;
testScript = testScript =
@ -43,8 +42,7 @@ in
}); });
notifications = forEachSystem (system: notifications = forEachSystem (system:
with import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; }; (import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; }).simpleTest {
simpleTest {
name = "hydra-notifications"; name = "hydra-notifications";
nodes.machine = { nodes.machine = {
imports = [ hydraServer ]; imports = [ hydraServer ];
@ -56,7 +54,7 @@ in
''; '';
services.influxdb.enable = true; services.influxdb.enable = true;
}; };
testScript = '' testScript = { nodes, ... }: ''
machine.wait_for_job("hydra-init") machine.wait_for_job("hydra-init")
# Create an admin account and some other state. # Create an admin account and some other state.
@ -87,7 +85,7 @@ in
# Setup the project and jobset # Setup the project and jobset
machine.succeed( machine.succeed(
"su - hydra -c 'perl -I ${config.services.hydra-dev.package.perlDeps}/lib/perl5/site_perl ${./t/setup-notifications-jobset.pl}' >&2" "su - hydra -c 'perl -I ${nodes.machine.services.hydra-dev.package.perlDeps}/lib/perl5/site_perl ${./t/setup-notifications-jobset.pl}' >&2"
) )
# Wait until hydra has build the job and # Wait until hydra has build the job and
@ -101,9 +99,7 @@ in
}); });
gitea = forEachSystem (system: gitea = forEachSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in (import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; }).makeTest {
with import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; };
makeTest {
name = "hydra-gitea"; name = "hydra-gitea";
nodes.machine = { pkgs, ... }: { nodes.machine = { pkgs, ... }: {
imports = [ hydraServer ]; imports = [ hydraServer ];
@ -129,7 +125,7 @@ in
networking.firewall.allowedTCPPorts = [ 3000 ]; networking.firewall.allowedTCPPorts = [ 3000 ];
}; };
skipLint = true; skipLint = true;
testScript = testScript = { pkgs, ... }:
let let
scripts.mktoken = pkgs.writeText "token.sql" '' scripts.mktoken = pkgs.writeText "token.sql" ''
INSERT INTO access_token (id, uid, name, created_unix, updated_unix, token_hash, token_salt, token_last_eight, scope) VALUES (1, 1, 'hydra', 1617107360, 1617107360, 'a930f319ca362d7b49a4040ac0af74521c3a3c3303a86f327b01994430672d33b6ec53e4ea774253208686c712495e12a486', 'XRjWE9YW0g', '31d3a9c7', 'all'); INSERT INTO access_token (id, uid, name, created_unix, updated_unix, token_hash, token_salt, token_last_eight, scope) VALUES (1, 1, 'hydra', 1617107360, 1617107360, 'a930f319ca362d7b49a4040ac0af74521c3a3c3303a86f327b01994430672d33b6ec53e4ea774253208686c712495e12a486', 'XRjWE9YW0g', '31d3a9c7', 'all');