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 , makeWrapper
, nixosTests , nixosTests
, systemd , systemd
, testers
, grafana-loki
}: }:
buildGoModule rec { buildGoModule rec {
@ -38,7 +40,13 @@ buildGoModule rec {
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib" --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 [ ldflags = let t = "github.com/grafana/loki/v3/pkg/util/build"; in [
"-s" "-s"