-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NixOS Integration Tests on macOS: Remove some obstacles (ulimit, requiredSystemFeatures) #261694
Changes from all commits
83665f1
0020e46
6c4c32c
65b5201
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ let | |
./legacy.nix | ||
./meta.nix | ||
./name.nix | ||
./macos-host.nix | ||
./network.nix | ||
./nodes.nix | ||
./pkgs.nix | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ config, lib, hostPkgs, ... }: | ||
|
||
{ | ||
config = lib.mkIf hostPkgs.stdenv.hostPlatform.isDarwin { | ||
defaults = { | ||
virtualisation.host.pkgs = hostPkgs; | ||
|
||
# On non-darwin, mounting the whole nix store from the host is the default because | ||
# this generally makes rebuilds of the VMs faster and the VMs smaller, while reducing | ||
# disk I/O. | ||
# However, on macOS it currently leads to many crashing guest processes. | ||
virtualisation.useNixStoreImage = true; | ||
# Without this, the store image uses "raw" instead of "qcow2" and | ||
# that throws some errors on macOS on startup of the VM | ||
# TODO: remove when `raw` errors are fixed. | ||
virtualisation.writableStore = true; | ||
tfc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,17 +97,23 @@ | |
# See doc/builders/testers.chapter.md or | ||
# https://nixos.org/manual/nixpkgs/unstable/#tester-runNixOSTest | ||
runNixOSTest = | ||
let nixos = import ../../../nixos/lib { | ||
inherit lib; | ||
}; | ||
let | ||
toGuest = builtins.replaceStrings [ "darwin" ] [ "linux" ]; | ||
guestPkgs = | ||
if (!pkgs.stdenv.hostPlatform.isDarwin) | ||
then pkgs | ||
else import pkgs.path { system = toGuest pkgs.system; }; | ||
Comment on lines
+102
to
+105
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nice to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True. Although this would blow up this PR... can we discuss this offline after this PR how to improve it? |
||
nixos = import ../../../nixos/lib { | ||
inherit lib; | ||
}; | ||
in testModule: | ||
nixos.runTest { | ||
_file = "pkgs.runNixOSTest implementation"; | ||
imports = [ | ||
(lib.setDefaultModuleLocation "the argument that was passed to pkgs.runNixOSTest" testModule) | ||
]; | ||
hostPkgs = pkgs; | ||
node.pkgs = pkgs; | ||
node.pkgs = guestPkgs; | ||
roberth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; | ||
|
||
# See doc/builders/testers.chapter.md or | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line doesn't seem darwin-specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so what do you think is the best way to do it? use
!...isLinux
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be set in this module, here
nixpkgs/nixos/lib/testing/nodes.nix
Line 29 in 589c74a
I can't think of a situation where
host.pkgs
andhostPkgs
should not have the same value.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how you mean that... use
hostPkgs
instead of...config.qemu.package
? I guess you mean that the default value for that should be hostpkgs but then in the file where this is defined?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant it like
virtualisation.qemu.package = testModuleArgs.config.qemu.package; +virtualisation.host.pkgs = hostPkgs;
ie move the line away from here
and into
lib/testing/nodes.nix
.The
virtualisation.qemu.package
line is unchanged and unrelated.