Skip to content

Commit

Permalink
Merge pull request NixOS#1361 from Ma27/fix-gitea-test
Browse files Browse the repository at this point in the history
flake: fix gitea integration test
  • Loading branch information
ajs124 authored Mar 8, 2024
2 parents c45c065 + 806c375 commit 8f56209
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
16 changes: 6 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,9 @@
root=d7f16a3412e01a43a414535b16007c6931d3a9c7
</gitea_authorization>
'';
nixpkgs.config.permittedInsecurePackages = [ "gitea-1.19.4" ];
nix = {
distributedBuilds = true;
buildMachines = [{
hostName = "localhost";
systems = [ system ];
}];
binaryCaches = [ ];
settings.substituters = [ ];
};
services.gitea = {
enable = true;
Expand All @@ -202,7 +198,7 @@
testScript =
let
scripts.mktoken = pkgs.writeText "token.sql" ''
INSERT INTO access_token (id, uid, name, created_unix, updated_unix, token_hash, token_salt, token_last_eight) VALUES (1, 1, 'hydra', 1617107360, 1617107360, 'a930f319ca362d7b49a4040ac0af74521c3a3c3303a86f327b01994430672d33b6ec53e4ea774253208686c712495e12a486', 'XRjWE9YW0g', '31d3a9c7');
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');
'';

scripts.git-setup = pkgs.writeShellScript "setup.sh" ''
Expand Down Expand Up @@ -357,9 +353,9 @@
response = json.loads(data)
assert len(response) == 2, "Expected exactly two status updates for latest commit!"
assert response[0]['status'] == "success", "Expected latest status to be success!"
assert response[1]['status'] == "pending", "Expected first status to be pending!"
assert len(response) == 2, "Expected exactly three status updates for latest commit (queued, finished)!"
assert response[0]['status'] == "success", "Expected finished status to be success!"
assert response[1]['status'] == "pending", "Expected queued status to be pending!"
machine.shutdown()
'';
Expand Down
4 changes: 0 additions & 4 deletions src/lib/Hydra/Plugin/GiteaStatus.pm
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ sub buildQueued {
common(@_, [], 0);
}

sub buildStarted {
common(@_, [], 1);
}

sub buildFinished {
common(@_, 2);
}
Expand Down

0 comments on commit 8f56209

Please sign in to comment.