use python testing from stable nixpkgs

This commit is contained in:
Erik Arvstedt 2020-05-04 11:53:19 +02:00 committed by Jonas Nick
parent 45de0d427d
commit 026a22fcee
No known key found for this signature in database
GPG Key ID: 4861DBF262123605
2 changed files with 3 additions and 44 deletions

View File

@ -1,25 +1,12 @@
testArgs:
let
stablePkgs = import <nixpkgs> { config = {}; overlays = []; };
unstable = (import ../pkgs/nixpkgs-pinned.nix).nixpkgs-unstable;
pkgs = import <nixpkgs> { config = {}; overlays = []; };
# Stable nixpkgs doesn't yet include the Python testing framework.
# Use unstable nixpkgs and patch it so that it uses stable nixpkgs for the VM
# machine configuration.
testingPkgs =
stablePkgs.runCommand "nixpkgs-testing" {} ''
cp -r ${unstable} $out
cd $out
chmod +w -R .
patch -p1 < ${./use-stable-pkgs.patch}
'';
test = (import "${testingPkgs}/nixos/tests/make-test-python.nix") testArgs;
test = (import "${pkgs.path}/nixos/tests/make-test-python.nix") testArgs;
fixedTest = { system ? builtins.currentSystem, ... }@args:
let
pkgs = (import testingPkgs { inherit system; config = {}; overlays = []; } );
pkgsFixed = pkgs // {
# Fix the black Python code formatter that's used in the test to allow the test
# script to have longer lines. The default width of 88 chars is too restrictive for
@ -35,7 +22,7 @@ let
# QEMU 4.20 from unstable fails on Travis build nodes with message
# "error: failed to set MSR 0x48b to 0x159ff00000000"
# Use version 4.0.1 instead.
inherit (stablePkgs) qemu_test;
inherit (pkgs) qemu_test;
};
in
test (args // { pkgs = pkgsFixed; });

View File

@ -1,28 +0,0 @@
--- a/nixos/lib/build-vms.nix
+++ b/nixos/lib/build-vms.nix
@@ -30,10 +30,10 @@ rec {
buildVM =
nodes: configurations:
- import ./eval-config.nix {
+ import <nixpkgs/nixos/lib/eval-config.nix> {
inherit system;
modules = configurations ++ extraConfigurations;
- baseModules = (import ../modules/module-list.nix) ++
+ baseModules = (import <nixpkgs/nixos/modules/module-list.nix>) ++
[ ../modules/virtualisation/qemu-vm.nix
../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs
{ key = "no-manual"; documentation.nixos.enable = false; }
services.connman doesn't exist in stable nixpkgs
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -620,7 +620,6 @@ in
# Wireless won't work in the VM.
networking.wireless.enable = mkVMOverride false;
- services.connman.enable = mkVMOverride false;
# Speed up booting by not waiting for ARP.
networking.dhcpcd.extraConfig = "noarp";