From 271fd55b7ecf4c5a7579a795d3d69519275a6c9f Mon Sep 17 00:00:00 2001 From: emilylange Date: Wed, 10 Apr 2024 16:06:56 +0200 Subject: [PATCH] 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. --- pkgs/servers/monitoring/loki/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/monitoring/loki/default.nix b/pkgs/servers/monitoring/loki/default.nix index 176ec316a6eb..0cf35895ca6c 100644 --- a/pkgs/servers/monitoring/loki/default.nix +++ b/pkgs/servers/monitoring/loki/default.nix @@ -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"