mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
tests: Add hydraJobs.tests.functional_*
This commit is contained in:
parent
dc720f89f2
commit
439022c5ac
13 changed files with 273 additions and 28 deletions
76
tests/nixos/functional/common.nix
Normal file
76
tests/nixos/functional/common.nix
Normal file
|
@ -0,0 +1,76 @@
|
|||
{ lib, ... }:
|
||||
|
||||
let
|
||||
# FIXME (roberth) reference issue
|
||||
inputDerivation = pkg: (pkg.overrideAttrs (o: {
|
||||
disallowedReferences = [ ];
|
||||
})).inputDerivation;
|
||||
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Add the quickBuild attribute to the check package
|
||||
./quick-build.nix
|
||||
];
|
||||
|
||||
# We rarely change the script in a way that benefits from type checking, so
|
||||
# we skip it to save time.
|
||||
skipTypeCheck = true;
|
||||
|
||||
nodes.machine = { config, pkgs, ... }: {
|
||||
|
||||
virtualisation.writableStore = true;
|
||||
system.extraDependencies = [
|
||||
(inputDerivation config.nix.package)
|
||||
];
|
||||
|
||||
nix.settings.substituters = lib.mkForce [];
|
||||
|
||||
environment.systemPackages = let
|
||||
run-test-suite = pkgs.writeShellApplication {
|
||||
name = "run-test-suite";
|
||||
runtimeInputs = [ pkgs.gnumake pkgs.jq pkgs.git ];
|
||||
text = ''
|
||||
set -x
|
||||
cat /proc/sys/fs/file-max
|
||||
ulimit -Hn
|
||||
ulimit -Sn
|
||||
cd ~
|
||||
cp -r ${pkgs.nix.overrideAttrs (o: {
|
||||
name = "nix-configured-source";
|
||||
outputs = [ "out" ];
|
||||
separateDebugInfo = false;
|
||||
disallowedReferences = [ ];
|
||||
buildPhase = ":";
|
||||
checkPhase = ":";
|
||||
installPhase = ''
|
||||
cp -r . $out
|
||||
'';
|
||||
installCheckPhase = ":";
|
||||
fixupPhase = ":";
|
||||
doInstallCheck = true;
|
||||
})} nix
|
||||
chmod -R +w nix
|
||||
cd nix
|
||||
|
||||
# Tests we don't need
|
||||
echo >tests/functional/plugins/local.mk
|
||||
sed -i tests/functional/local.mk \
|
||||
-e 's!nix_tests += plugins\.sh!!' \
|
||||
-e 's!nix_tests += test-libstoreconsumer\.sh!!' \
|
||||
;
|
||||
|
||||
export isTestOnNixOS=1
|
||||
export version=${config.nix.package.version}
|
||||
export NIX_REMOTE_=daemon
|
||||
export NIX_REMOTE=daemon
|
||||
export NIX_STORE=${builtins.storeDir}
|
||||
make -j1 installcheck --keep-going
|
||||
'';
|
||||
};
|
||||
in [
|
||||
run-test-suite
|
||||
pkgs.git
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue