2018-11-11 09:41:11 +01:00
|
|
|
{ system ? builtins.currentSystem,
|
|
|
|
config ? {},
|
|
|
|
pkgs ? import ../.. { inherit system config; }
|
|
|
|
}:
|
2018-11-06 03:06:30 +01:00
|
|
|
|
2019-10-27 11:24:26 +01:00
|
|
|
with import ../lib/testing-python.nix { inherit system pkgs; };
|
2018-11-06 03:06:30 +01:00
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
mysql = makeTest {
|
|
|
|
name = "gitea-mysql";
|
2019-05-11 02:00:40 +02:00
|
|
|
meta.maintainers = with maintainers; [ aanderse kolaente ];
|
2018-11-06 03:06:30 +01:00
|
|
|
|
|
|
|
machine =
|
|
|
|
{ config, pkgs, ... }:
|
2019-05-23 03:00:24 +02:00
|
|
|
{ services.gitea.enable = true;
|
2018-11-06 03:06:30 +01:00
|
|
|
services.gitea.database.type = "mysql";
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-10-27 11:24:26 +01:00
|
|
|
start_all()
|
2018-11-06 03:06:30 +01:00
|
|
|
|
2019-10-27 11:24:26 +01:00
|
|
|
machine.wait_for_unit("gitea.service")
|
|
|
|
machine.wait_for_open_port(3000)
|
|
|
|
machine.succeed("curl --fail http://localhost:3000/")
|
2018-11-06 03:06:30 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
postgres = makeTest {
|
|
|
|
name = "gitea-postgres";
|
|
|
|
meta.maintainers = [ maintainers.aanderse ];
|
|
|
|
|
|
|
|
machine =
|
|
|
|
{ config, pkgs, ... }:
|
2019-05-23 03:00:24 +02:00
|
|
|
{ services.gitea.enable = true;
|
2018-11-06 03:06:30 +01:00
|
|
|
services.gitea.database.type = "postgres";
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-10-27 11:24:26 +01:00
|
|
|
start_all()
|
2018-11-06 03:06:30 +01:00
|
|
|
|
2019-10-27 11:24:26 +01:00
|
|
|
machine.wait_for_unit("gitea.service")
|
|
|
|
machine.wait_for_open_port(3000)
|
|
|
|
machine.succeed("curl --fail http://localhost:3000/")
|
2018-11-06 03:06:30 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
sqlite = makeTest {
|
|
|
|
name = "gitea-sqlite";
|
|
|
|
meta.maintainers = [ maintainers.aanderse ];
|
|
|
|
|
|
|
|
machine =
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
{ services.gitea.enable = true;
|
2019-01-14 15:56:20 +01:00
|
|
|
services.gitea.disableRegistration = true;
|
2018-11-06 03:06:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-10-27 11:24:26 +01:00
|
|
|
start_all()
|
2018-11-06 03:06:30 +01:00
|
|
|
|
2019-10-27 11:24:26 +01: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 03:06:30 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|