nixos/lib/testing: avoid generating darwin VM tests (#393977)

This commit is contained in:
Vladimír Čunát 2025-04-27 09:28:14 +02:00
commit 1a41b5c78e
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA
2 changed files with 12 additions and 8 deletions

View file

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

View file

@ -36,7 +36,9 @@ in
};
platforms = lib.mkOption {
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 = ''
Sets the [`meta.platforms`](https://nixos.org/manual/nixpkgs/stable/#var-meta-platforms) attribute on the [{option}`test`](#test-opt-test) derivation.
'';