about summary refs log tree commit diff
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2023-07-02 09:11:58 -0400
committerGitHub <noreply@github.com>2023-07-02 09:11:58 -0400
commite135a81fb42fb4c1574a8d41e88840aa2b90669b (patch)
treebe225aa16aed7705fc155649d7c6290e28d324ee
parent79809c44a8f0961b7ec816a2ca0d7940ef197b02 (diff)
parentd3812c83070176a5503b8e75c7b0c3ade1a01038 (diff)
Merge pull request #240983 from figsoda/ghz
ghz: fix version
-rw-r--r--pkgs/tools/networking/ghz/default.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/pkgs/tools/networking/ghz/default.nix b/pkgs/tools/networking/ghz/default.nix
index 495d9dd3a1f3a..89253f3fe4891 100644
--- a/pkgs/tools/networking/ghz/default.nix
+++ b/pkgs/tools/networking/ghz/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub, testers, ghz }:
 
 buildGoModule rec {
   pname = "ghz";
@@ -15,7 +15,21 @@ buildGoModule rec {
 
   subPackages = [ "cmd/ghz" "cmd/ghz-web" ];
 
-  ldflags = [ "-s" "-w" ];
+  ldflags = [
+    "-s"
+    "-w"
+    "-X=main.version=${version}"
+  ];
+
+  passthru.tests = {
+    version = testers.testVersion {
+      package = ghz;
+    };
+    web-version = testers.testVersion {
+      package = ghz;
+      command = "ghz-web -v";
+    };
+  };
 
   meta = with lib; {
     description = "Simple gRPC benchmarking and load testing tool";