grafana-loki: add simple version test

v3.0.0 changed the ldflag prefix, which we rely on to pass and embed
version information.

This is likely to happen again, and such version test is incredibly
inexpensive.
This commit is contained in:
emilylange 2024-04-10 16:06:56 +02:00
parent 8f95320f39
commit 271fd55b7e
No known key found for this signature in database
GPG Key ID: 0AD773CE46FD0F87

View File

@ -5,6 +5,8 @@
, makeWrapper
, nixosTests
, systemd
, testers
, grafana-loki
}:
buildGoModule rec {
@ -38,7 +40,13 @@ buildGoModule rec {
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
'';
passthru.tests = { inherit (nixosTests) loki; };
passthru.tests = {
inherit (nixosTests) loki;
version = testers.testVersion {
command = "loki --version";
package = grafana-loki;
};
};
ldflags = let t = "github.com/grafana/loki/v3/pkg/util/build"; in [
"-s"