nixpkgs/nixos/tests/gitea.nix

70 lines
1.6 KiB
Nix
Raw Normal View History

{ system ? builtins.currentSystem,
config ? {},
pkgs ? import ../.. { inherit system config; }
}:
2019-10-27 10:24:26 +00:00
with import ../lib/testing-python.nix { inherit system pkgs; };
with pkgs.lib;
{
mysql = makeTest {
name = "gitea-mysql";
2019-05-11 00:00:40 +00:00
meta.maintainers = with maintainers; [ aanderse kolaente ];
machine =
{ config, pkgs, ... }:
{ services.gitea.enable = true;
services.gitea.database.type = "mysql";
};
testScript = ''
2019-10-27 10:24:26 +00:00
start_all()
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/")
'';
};
postgres = makeTest {
name = "gitea-postgres";
meta.maintainers = [ maintainers.aanderse ];
machine =
{ config, pkgs, ... }:
{ services.gitea.enable = true;
services.gitea.database.type = "postgres";
};
testScript = ''
2019-10-27 10:24:26 +00:00
start_all()
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/")
'';
};
sqlite = makeTest {
name = "gitea-sqlite";
meta.maintainers = [ maintainers.aanderse ];
machine =
{ config, pkgs, ... }:
{ services.gitea.enable = true;
services.gitea.disableRegistration = true;
};
testScript = ''
2019-10-27 10:24:26 +00:00
start_all()
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.'"
)
'';
};
}