grafana-agent: add version test

This commit is contained in:
IndeedNotJames 2023-05-01 20:10:49 +02:00
parent ec38c9c76b
commit cbcafdc13b
No known key found for this signature in database
GPG Key ID: 0AD773CE46FD0F87

View File

@ -1,4 +1,12 @@
{ lib, stdenv, buildGoModule, fetchFromGitHub, systemd, nixosTests }:
{ lib
, buildGoModule
, fetchFromGitHub
, grafana-agent
, nixosTests
, stdenv
, systemd
, testers
}:
buildGoModule rec {
pname = "grafana-agent";
@ -50,7 +58,14 @@ buildGoModule rec {
$out/bin/grafana-agent
'';
passthru.tests.grafana-agent = nixosTests.grafana-agent;
passthru.tests = {
inherit (nixosTests) grafana-agent;
version = testers.testVersion {
inherit version;
command = "${lib.getExe grafana-agent} --version";
package = grafana-agent;
};
};
meta = with lib; {
description = "A lightweight subset of Prometheus and more, optimized for Grafana Cloud";