mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 14:43:37 +00:00
1a657f18f7
The command ``` nix-build -A tests.trivial-builders.references --show-trace ``` fails eval with ``` in job ‘nixpkgs.tests.trivial-builders.references’: error: The option `meta.description' does not exist. Definition values: - In `makeTest parameters': "Run the Nixpkgs trivial builders tests" ``` because `meta.description` and `meta.license` are not valid for `nixosTest`s (they are valid for `mkDerivation` of course). This has been causing Hydra eval failures: https://hydra.nixos.org/jobset/nixos/pr-209870-gcc-external-bootstrap#tabs-errors Let's fix eval by removing these attributes.
53 lines
1.5 KiB
Nix
53 lines
1.5 KiB
Nix
{ lib, testers, pkgs, writeText, hello, figlet, stdenvNoCC }:
|
|
|
|
# -------------------------------------------------------------------------- #
|
|
#
|
|
# trivial-builders test
|
|
#
|
|
# -------------------------------------------------------------------------- #
|
|
#
|
|
# This file can be run independently (quick):
|
|
#
|
|
# $ pkgs/build-support/trivial-builders/references-test.sh
|
|
#
|
|
# or in the build sandbox with a ~20s VM overhead
|
|
#
|
|
# $ nix-build -A tests.trivial-builders.references
|
|
#
|
|
# -------------------------------------------------------------------------- #
|
|
|
|
let
|
|
invokeSamples = file:
|
|
lib.concatStringsSep " " (
|
|
lib.attrValues (import file { inherit pkgs; })
|
|
);
|
|
in
|
|
testers.nixosTest {
|
|
name = "nixpkgs-trivial-builders";
|
|
nodes.machine = { ... }: {
|
|
virtualisation.writableStore = true;
|
|
|
|
# Test runs without network, so we don't substitute and prepare our deps
|
|
nix.settings.substituters = lib.mkForce [];
|
|
environment.etc."pre-built-paths".source = writeText "pre-built-paths" (
|
|
builtins.toJSON [hello figlet stdenvNoCC]
|
|
);
|
|
environment.variables = {
|
|
SAMPLE = invokeSamples ./sample.nix;
|
|
REFERENCES = invokeSamples ./invoke-writeReferencesToFile.nix;
|
|
DIRECT_REFS = invokeSamples ./invoke-writeDirectReferencesToFile.nix;
|
|
};
|
|
};
|
|
testScript =
|
|
''
|
|
machine.succeed("""
|
|
${./references-test.sh} 2>/dev/console
|
|
""")
|
|
'';
|
|
meta = {
|
|
maintainers = with lib.maintainers; [
|
|
roberth
|
|
];
|
|
};
|
|
}
|