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 dab7aa20ed.
This commit is contained in:
emilylange 2024-04-02 17:04:29 +02:00
parent dab7aa20ed
commit 680bc07727
No known key found for this signature in database
GPG Key ID: 0AD773CE46FD0F87

View File

@ -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.'"