From 49d63b570e195b45aa714eb531dff87cdd1d71c1 Mon Sep 17 00:00:00 2001 From: Matej Urbas Date: Fri, 1 Jan 2021 12:34:24 +0000 Subject: [PATCH] python3Packages.py-air-control-exporter: add passthru.tests This change adds integration tests to the py-air-control-exporter package. These tests verify that the exporter exports metrics correctly in an actual NixOS virtual machine. --- .../python-modules/py-air-control-exporter/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/py-air-control-exporter/default.nix b/pkgs/development/python-modules/py-air-control-exporter/default.nix index 0ec483c16f30..b5ffc1fc0a5d 100644 --- a/pkgs/development/python-modules/py-air-control-exporter/default.nix +++ b/pkgs/development/python-modules/py-air-control-exporter/default.nix @@ -1,5 +1,6 @@ -{ buildPythonPackage, fetchPypi, flask, isPy27, lib, prometheus_client -, py-air-control, pytestCheckHook, pytestcov, pytestrunner, setuptools_scm }: +{ buildPythonPackage, fetchPypi, flask, isPy27, lib, nixosTests +, prometheus_client, py-air-control, pytestCheckHook, pytestcov, pytestrunner +, setuptools_scm }: buildPythonPackage rec { pname = "py-air-control-exporter"; @@ -15,6 +16,8 @@ buildPythonPackage rec { checkInputs = [ pytestCheckHook pytestcov pytestrunner ]; propagatedBuildInputs = [ flask prometheus_client py-air-control ]; + passthru.tests = { inherit (nixosTests.prometheus-exporters) py-air-control; }; + meta = with lib; { description = "Exports Air Quality Metrics to Prometheus."; homepage = "https://github.com/urbas/py-air-control-exporter";