nixos/tests/forgejo: add forgejo-lts variant

This commit is contained in:
emilylange 2024-07-31 03:59:13 +02:00
parent e271e748c9
commit bde28ca593
No known key found for this signature in database
GPG Key ID: 0AD773CE46FD0F87
3 changed files with 6 additions and 3 deletions

View File

@ -342,7 +342,8 @@ in {
fluentd = handleTest ./fluentd.nix {};
fluidd = handleTest ./fluidd.nix {};
fontconfig-default-fonts = handleTest ./fontconfig-default-fonts.nix {};
forgejo = handleTest ./forgejo.nix { };
forgejo = handleTest ./forgejo.nix { forgejoPackage = pkgs.forgejo; };
forgejo-lts = handleTest ./forgejo.nix { forgejoPackage = pkgs.forgejo-lts; };
freenet = handleTest ./freenet.nix {};
freeswitch = handleTest ./freeswitch.nix {};
freetube = discoverTests (import ./freetube.nix);

View File

@ -1,6 +1,7 @@
{ system ? builtins.currentSystem
, config ? { }
, pkgs ? import ../.. { inherit system config; }
, forgejoPackage ? pkgs.forgejo
}:
with import ../lib/testing-python.nix { inherit system pkgs; };
@ -53,6 +54,7 @@ let
virtualisation.memorySize = 2047;
services.forgejo = {
enable = true;
package = forgejoPackage;
database = { inherit type; };
settings.service.DISABLE_REGISTRATION = true;
settings."repository.signing".SIGNING_KEY = signingPrivateKeyId;
@ -145,7 +147,7 @@ let
assert "BEGIN PGP PUBLIC KEY BLOCK" in server.succeed("curl http://localhost:3000/api/v1/signing-key.gpg")
api_version = json.loads(server.succeed("curl http://localhost:3000/api/forgejo/v1/version")).get("version")
assert "development" != api_version and "${pkgs.forgejo.version}+gitea-" in api_version, (
assert "development" != api_version and "${forgejoPackage.version}+gitea-" in api_version, (
"/api/forgejo/v1/version should not return 'development' "
+ f"but should contain a forgejo+gitea compatibility version string. Got '{api_version}' instead."
)

View File

@ -153,7 +153,7 @@ buildGoModule rec {
-exec brotli --best --keep --no-copy-stat {} ';'
'';
tests = nixosTests.forgejo;
tests = if lts then nixosTests.forgejo-lts else nixosTests.forgejo;
updateScript = nix-update-script { };
};