2018-11-11 08:41:11 +00:00
|
|
|
{ system ? builtins.currentSystem,
|
|
|
|
config ? {},
|
|
|
|
pkgs ? import ../.. { inherit system config; }
|
|
|
|
}:
|
2018-11-06 02:06:30 +00:00
|
|
|
|
2019-10-27 10:24:26 +00:00
|
|
|
with import ../lib/testing-python.nix { inherit system pkgs; };
|
2018-11-06 02:06:30 +00:00
|
|
|
with pkgs.lib;
|
|
|
|
|
2019-12-06 17:59:37 +00:00
|
|
|
let
|
|
|
|
supportedDbTypes = [ "mysql" "postgres" "sqlite3" ];
|
|
|
|
makeGiteaTest = type: nameValuePair type (makeTest {
|
|
|
|
name = "gitea-${type}";
|
|
|
|
meta.maintainers = with maintainers; [ aanderse kolaente ma27 ];
|
|
|
|
machine = { config, pkgs, ... }: {
|
|
|
|
services.gitea = {
|
|
|
|
enable = true;
|
|
|
|
database = { inherit type; };
|
|
|
|
disableRegistration = true;
|
2018-11-06 02:06:30 +00:00
|
|
|
};
|
2019-12-06 17:59:37 +00:00
|
|
|
};
|
2018-11-06 02:06:30 +00:00
|
|
|
|
|
|
|
testScript = ''
|
2019-10-27 10:24:26 +00:00
|
|
|
start_all()
|
2018-11-06 02:06:30 +00:00
|
|
|
|
2019-10-27 10:24:26 +00:00
|
|
|
machine.wait_for_unit("gitea.service")
|
|
|
|
machine.wait_for_open_port(3000)
|
|
|
|
machine.succeed("curl --fail http://localhost:3000/")
|
|
|
|
machine.succeed(
|
|
|
|
"curl --fail http://localhost:3000/user/sign_up | grep 'Registration is disabled. Please contact your site administrator.'"
|
|
|
|
)
|
2018-11-06 02:06:30 +00:00
|
|
|
'';
|
2019-12-06 17:59:37 +00:00
|
|
|
});
|
|
|
|
in
|
|
|
|
|
|
|
|
listToAttrs (map makeGiteaTest supportedDbTypes)
|