about summary refs log tree commit diff
diff options
context:
space:
mode:
authoremilylange <git@emilylange.de>2024-04-09 21:56:14 +0200
committeremilylange <git@emilylange.de>2024-04-09 21:56:14 +0200
commit98c7ee52fe2609729400996da005064d2f42da9c (patch)
treecd85656f90a6169d7803216d64f7eb76f7c209aa
parent8f95320f39d7e4e4a29ee70b8718974295a619f4 (diff)
grafana-loki: add simple version test pull/302709/head
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.
-rw-r--r--pkgs/servers/monitoring/loki/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/servers/monitoring/loki/default.nix b/pkgs/servers/monitoring/loki/default.nix
index 176ec316a6ebb..9e1c411f92d32 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 = "${grafana-loki}/bin/loki --version";
+      package = grafana-loki;
+    };
+  };
 
   ldflags = let t = "github.com/grafana/loki/v3/pkg/util/build"; in [
     "-s"