From 0d405840d3ccd2eb2d1d5adec46bb9b72f1674b4 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 23 May 2023 08:49:56 +0200 Subject: [PATCH] hercules-ci-agent: Improve passthru tests --- .../hercules-ci-agent/default.nix | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix b/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix index b4a783765df9..a1ed3d6ebe72 100644 --- a/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix +++ b/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix @@ -22,10 +22,31 @@ in pkg.overrideAttrs (o: { }; passthru = o.passthru // { # Does not test the package, but evaluation of the related NixOS module. - tests.nixos-minimal-config = nixos { + tests.nixos-simple-config = (nixos { boot.loader.grub.enable = false; fileSystems."/".device = "bogus"; services.hercules-ci-agent.enable = true; - }; + # Dummy value for testing only. + system.stateVersion = lib.trivial.release; # TEST ONLY + }).config.system.build.toplevel; + + tests.nixos-many-options-config = (nixos ({ pkgs, ... }: { + boot.loader.grub.enable = false; + fileSystems."/".device = "bogus"; + services.hercules-ci-agent = { + enable = true; + package = pkgs.hercules-ci-agent; + settings = { + workDirectory = "/var/tmp/hci"; + binaryCachesPath = "/var/keys/binary-caches.json"; + labels.foo.bar.baz = "qux"; + labels.qux = ["q" "u"]; + apiBaseUrl = "https://hci.dev.biz.example.com"; + concurrentTasks = 42; + }; + }; + # Dummy value for testing only. + system.stateVersion = lib.trivial.release; # TEST ONLY + })).config.system.build.toplevel; }; })