Merge #142: fix qemu error on travis
4d8590f8ed
fix qemu error on travis (Erik Arvstedt) Pull request description: ACKs for top commit: jonasnick: ACK4d8590f8ed
Tree-SHA512: 0576e4dc0a77261760614d95dbfb4b706543f2a7d56d41f218d7b811944651f3450a7ba57fbbb373d735e48b6ae03b10a3fb30d71d0533bc76361b5ec6a6e081
This commit is contained in:
commit
aca23197d3
@ -1,14 +1,14 @@
|
|||||||
testArgs:
|
testArgs:
|
||||||
|
|
||||||
let
|
let
|
||||||
pkgs = import <nixpkgs> { config = {}; overlays = []; };
|
stablePkgs = import <nixpkgs> { config = {}; overlays = []; };
|
||||||
unstable = (import ../pkgs/nixpkgs-pinned.nix).nixpkgs-unstable;
|
unstable = (import ../pkgs/nixpkgs-pinned.nix).nixpkgs-unstable;
|
||||||
|
|
||||||
# Stable nixpkgs doesn't yet include the Python testing framework.
|
# 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
|
# Use unstable nixpkgs and patch it so that it uses stable nixpkgs for the VM
|
||||||
# machine configuration.
|
# machine configuration.
|
||||||
testingPkgs =
|
testingPkgs =
|
||||||
pkgs.runCommand "nixpkgs-testing" {} ''
|
stablePkgs.runCommand "nixpkgs-testing" {} ''
|
||||||
cp -r ${unstable} $out
|
cp -r ${unstable} $out
|
||||||
cd $out
|
cd $out
|
||||||
chmod +w -R .
|
chmod +w -R .
|
||||||
@ -17,13 +17,13 @@ let
|
|||||||
|
|
||||||
test = (import "${testingPkgs}/nixos/tests/make-test-python.nix") testArgs;
|
test = (import "${testingPkgs}/nixos/tests/make-test-python.nix") testArgs;
|
||||||
|
|
||||||
# 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
|
|
||||||
# our script.
|
|
||||||
fixedTest = { system ? builtins.currentSystem, ... }@args:
|
fixedTest = { system ? builtins.currentSystem, ... }@args:
|
||||||
let
|
let
|
||||||
pkgs = (import testingPkgs { inherit system; config = {}; overlays = []; } );
|
pkgs = (import testingPkgs { inherit system; config = {}; overlays = []; } );
|
||||||
pkgsFixed = pkgs // {
|
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
|
||||||
|
# our script.
|
||||||
python3Packages = pkgs.python3Packages // {
|
python3Packages = pkgs.python3Packages // {
|
||||||
black = pkgs.writeScriptBin "black" ''
|
black = pkgs.writeScriptBin "black" ''
|
||||||
fileToCheck=''${@:$#}
|
fileToCheck=''${@:$#}
|
||||||
@ -31,6 +31,11 @@ let
|
|||||||
exec ${pkgs.python3Packages.black}/bin/black $extraArgs "$@"
|
exec ${pkgs.python3Packages.black}/bin/black $extraArgs "$@"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# 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;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
test (args // { pkgs = pkgsFixed; });
|
test (args // { pkgs = pkgsFixed; });
|
||||||
|
Loading…
Reference in New Issue
Block a user