about summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2023-07-04 11:24:24 +0200
committerGitHub <noreply@github.com>2023-07-04 11:24:24 +0200
commit3ede00e4fa3337d590cd3fee6c313f2304f88e05 (patch)
tree7dbbc240a158d36d7e3b924a194b1544e2b21945 /pkgs/servers
parentd9c0d0ddfb3dac5bd5e1e564f48c87c86d1def97 (diff)
parentf856229c9af1b59f4573c629578ba52694d02858 (diff)
Merge pull request #240571 from gaelreyrol/scaphandre-module-assertions
nixos/prometheus/exporters: adjust scaphandre assertions
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/scaphandre/default.nix33
1 files changed, 22 insertions, 11 deletions
diff --git a/pkgs/servers/scaphandre/default.nix b/pkgs/servers/scaphandre/default.nix
index 7abfea74578ad..04a3c7fee1695 100644
--- a/pkgs/servers/scaphandre/default.nix
+++ b/pkgs/servers/scaphandre/default.nix
@@ -5,9 +5,12 @@
 , pkg-config
 , openssl
 , powercap
+, nix-update-script
 , runCommand
 , dieHook
 , nixosTests
+, testers
+, scaphandre
 }:
 
 rustPlatform.buildRustPackage rec {
@@ -38,17 +41,25 @@ rustPlatform.buildRustPackage rec {
     runHook postCheck
   '';
 
-  passthru.tests = {
-    stdout = self: runCommand "${pname}-test" {
-      buildInputs = [
-        self
-        dieHook
-      ];
-    } ''
-      ${self}/bin/scaphandre stdout -t 4 > $out  || die "Scaphandre failed to measure consumption"
-      [ -s $out ]
-    '';
-    vm = nixosTests.scaphandre;
+  passthru = {
+    updateScript = nix-update-script { };
+    tests = {
+      stdout = self: runCommand "${pname}-test" {
+        buildInputs = [
+          self
+          dieHook
+        ];
+      } ''
+        ${self}/bin/scaphandre stdout -t 4 > $out  || die "Scaphandre failed to measure consumption"
+        [ -s $out ]
+      '';
+      vm = nixosTests.scaphandre;
+      version = testers.testVersion {
+        inherit version;
+        package = scaphandre;
+        command = "scaphandre --version";
+      };
+    };
   };
 
   meta = with lib; {