From 680bc07727ccc10448e4f16c8b7e61cd41c475b0 Mon Sep 17 00:00:00 2001 From: emilylange Date: Tue, 2 Apr 2024 17:04:29 +0200 Subject: [PATCH] nixosTests.forgejo: test /api/forgejo/v1/version We forgot to set two version related ldflags in our packaging and this should prevent this from going unnoticed again. Further details are in dab7aa20ed898ed1264edbc7f1ae241427cc3ba6. --- nixos/tests/forgejo.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/tests/forgejo.nix b/nixos/tests/forgejo.nix index 6acd6acb50fa..b14df0a2c74f 100644 --- a/nixos/tests/forgejo.nix +++ b/nixos/tests/forgejo.nix @@ -108,6 +108,12 @@ 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 "-gitea-" in api_version, ( + "/api/forgejo/v1/version should not return 'development' " + + f"but should contain a gitea compatibility version string. Got '{api_version}' instead." + ) + server.succeed( "curl --fail http://localhost:3000/user/sign_up | grep 'Registration is disabled. " + "Please contact your site administrator.'"