nixos/lib/testing: avoid generating darwin VM tests

We're getting 2x5 darwin VM jobs that aren't schedulable
on our current Hydra.nixos.org, which makes them hang around
and delay advancing of all `nixpkgs-*` channels.
To me that's quite an annoying effect, as it can be like an extra day
of additional delay without any benefit that I can really perceive.
(unless someone like me keeps manually cancelling the jobs all the time)
This commit is contained in:
Vladimír Čunát
2025-02-23 11:44:44 +01:00
parent 21577e033d
commit 72155225aa
2 changed files with 12 additions and 8 deletions

View File

@@ -9,13 +9,15 @@ let
}; };
runTest = runTest =
module: module:
(evalTest ( # Infra issue: virtualization on darwin doesn't seem to work yet.
{ config, ... }: lib.addMetaAttrs { hydraPlatforms = lib.platforms.linux; }
{ (evalTest (
imports = [ module ]; { config, ... }:
result = config.test; {
} imports = [ module ];
)).config.result; result = config.test;
}
)).config.result;
testModules = [ testModules = [
./call-test.nix ./call-test.nix

View File

@@ -36,7 +36,9 @@ in
}; };
platforms = lib.mkOption { platforms = lib.mkOption {
type = types.listOf types.raw; type = types.listOf types.raw;
default = lib.platforms.linux ++ lib.platforms.darwin; # darwin could be added, but it would add VM tests that don't work on Hydra.nixos.org (so far)
# see https://github.com/NixOS/nixpkgs/pull/303597#issuecomment-2128782362
default = lib.platforms.linux;
description = '' description = ''
Sets the [`meta.platforms`](https://nixos.org/manual/nixpkgs/stable/#var-meta-platforms) attribute on the [{option}`test`](#test-opt-test) derivation. Sets the [`meta.platforms`](https://nixos.org/manual/nixpkgs/stable/#var-meta-platforms) attribute on the [{option}`test`](#test-opt-test) derivation.
''; '';