mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +00:00
35406647fd
> There is an issue in the test added by #123111. > [it] introduces a dependency on the contents of nixpkgs, > making every change evaluate with a different hash.
47 lines
1.4 KiB
Nix
47 lines
1.4 KiB
Nix
{ lib, nixosTest, pkgs, writeText, hello, figlet, stdenvNoCC }:
|
|
|
|
# -------------------------------------------------------------------------- #
|
|
#
|
|
# trivial-builders test
|
|
#
|
|
# -------------------------------------------------------------------------- #
|
|
#
|
|
# This file can be run independently (quick):
|
|
#
|
|
# $ pkgs/build-support/trivial-builders/test.sh
|
|
#
|
|
# or in the build sandbox with a ~20s VM overhead
|
|
#
|
|
# $ nix-build -A tests.trivial-builders
|
|
#
|
|
# -------------------------------------------------------------------------- #
|
|
|
|
let
|
|
invokeSamples = file:
|
|
lib.concatStringsSep " " (
|
|
lib.attrValues (import file { inherit pkgs; })
|
|
);
|
|
in
|
|
nixosTest {
|
|
name = "nixpkgs-trivial-builders";
|
|
nodes.machine = { ... }: {
|
|
virtualisation.writableStore = true;
|
|
|
|
# Test runs without network, so we don't substitute and prepare our deps
|
|
nix.binaryCaches = lib.mkForce [];
|
|
environment.etc."pre-built-paths".source = writeText "pre-built-paths" (
|
|
builtins.toJSON [hello figlet stdenvNoCC]
|
|
);
|
|
environment.variables = {
|
|
SAMPLE = invokeSamples ./test/sample.nix;
|
|
REFERENCES = invokeSamples ./test/invoke-writeReferencesToFile.nix;
|
|
DIRECT_REFS = invokeSamples ./test/invoke-writeDirectReferencesToFile.nix;
|
|
};
|
|
};
|
|
testScript = ''
|
|
machine.succeed("""
|
|
${./test.sh} 2>/dev/console
|
|
""")
|
|
'';
|
|
}
|