Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ in {
solanum = handleTest ./solanum.nix {};
sonarr = handleTest ./sonarr.nix {};
sonic-server = handleTest ./sonic-server.nix {};
sourcehut = handleTest ./sourcehut.nix {};
sourcehut = handleTest ./sourcehut {};
spacecookie = handleTest ./spacecookie.nix {};
spark = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./spark {};
sqlite3-to-mysql = handleTest ./sqlite3-to-mysql.nix {};
Expand Down
252 changes: 0 additions & 252 deletions nixos/tests/sourcehut.nix

This file was deleted.

54 changes: 54 additions & 0 deletions nixos/tests/sourcehut/builds.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import ../make-test-python.nix ({ pkgs, lib, ... }:
let
domain = "sourcehut.localdomain";
in
{
name = "sourcehut";

meta.maintainers = with pkgs.lib.maintainers; [ tomberek nessdoor ];

nodes.machine = { config, pkgs, nodes, ... }: {
imports = [
./nodes/common.nix
];

networking.domain = domain;
networking.extraHosts = ''
${config.networking.primaryIPAddress} builds.${domain}
${config.networking.primaryIPAddress} meta.${domain}
'';

services.sourcehut = {
builds = {
enable = true;
# FIXME: see why it does not seem to activate fully.
#enableWorker = true;
images = { };
};

settings."builds.sr.ht" = {
oauth-client-secret = pkgs.writeText "buildsrht-oauth-client-secret" "2260e9c4d9b8dcedcef642860e0504bc";
oauth-client-id = "299db9f9c2013170";
};
};
};

testScript = ''
start_all()
machine.wait_for_unit("multi-user.target")

with subtest("Check whether meta comes up"):
machine.wait_for_unit("metasrht-api.service")
machine.wait_for_unit("metasrht.service")
machine.wait_for_unit("metasrht-webhooks.service")
machine.wait_for_open_port(5000)
machine.succeed("curl -sL http://localhost:5000 | grep meta.${domain}")
machine.succeed("curl -sL http://meta.${domain} | grep meta.${domain}")

with subtest("Check whether builds comes up"):
machine.wait_for_unit("buildsrht.service")
machine.wait_for_open_port(5002)
machine.succeed("curl -sL http://localhost:5002 | grep builds.${domain}")
#machine.wait_for_unit("buildsrht-worker.service")
'';
})
6 changes: 6 additions & 0 deletions nixos/tests/sourcehut/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ system, pkgs, ... }:

{
git = import ./git.nix { inherit system pkgs; };
builds = import ./builds.nix { inherit system pkgs; };
}
Loading