tests: Set allowAliases = false

We don't want to accidentally end up with aliases in the code base
that then breaks nixpkgs when it's eventually incorporated.
This commit is contained in:
adisbladis 2022-05-05 01:40:44 +12:00
parent 6ed6894f58
commit 226ad319e6
2 changed files with 8 additions and 5 deletions

View file

@ -2,6 +2,9 @@ let
sources = import ../nix/sources.nix; sources = import ../nix/sources.nix;
in in
{ pkgs ? import sources.nixpkgs { { pkgs ? import sources.nixpkgs {
config = {
allowAliases = false;
};
overlays = [ overlays = [
(import ../overlay.nix) (import ../overlay.nix)
]; ];
@ -11,9 +14,9 @@ let
poetry = pkgs.callPackage ../pkgs/poetry { python = pkgs.python3; inherit poetry2nix; }; poetry = pkgs.callPackage ../pkgs/poetry { python = pkgs.python3; inherit poetry2nix; };
poetry2nix = import ./.. { inherit pkgs; inherit poetry; }; poetry2nix = import ./.. { inherit pkgs; inherit poetry; };
poetryLib = import ../lib.nix { inherit pkgs; lib = pkgs.lib; stdenv = pkgs.stdenv; }; poetryLib = import ../lib.nix { inherit pkgs; lib = pkgs.lib; stdenv = pkgs.stdenv; };
pep425 = pkgs.callPackage ../pep425.nix { inherit poetryLib; }; pep425 = pkgs.callPackage ../pep425.nix { inherit poetryLib; python = pkgs.python3; };
pep425Python37 = pkgs.callPackage ../pep425.nix { inherit poetryLib; python = pkgs.python37; }; pep425Python37 = pkgs.callPackage ../pep425.nix { inherit poetryLib; python = pkgs.python37; };
pep425OSX = pkgs.callPackage ../pep425.nix { inherit poetryLib; isLinux = false; }; pep425OSX = pkgs.callPackage ../pep425.nix { inherit poetryLib; isLinux = false; python = pkgs.python3; };
skipTests = builtins.filter (t: builtins.typeOf t != "list") (builtins.split "," (builtins.getEnv "SKIP_TESTS")); skipTests = builtins.filter (t: builtins.typeOf t != "list") (builtins.split "," (builtins.getEnv "SKIP_TESTS"));
callTest = test: attrs: pkgs.callPackage test ({ inherit poetry2nix; } // attrs); callTest = test: attrs: pkgs.callPackage test ({ inherit poetry2nix; } // attrs);
@ -84,7 +87,7 @@ builtins.removeAttrs
trivial-cross = skipOSX (callTest ./trivial-cross { }); trivial-cross = skipOSX (callTest ./trivial-cross { });
# Inherit test cases from nixpkgs # Inherit test cases from nixpkgs
inherit (pkgs) nixops nixopsUnstable; inherit (pkgs) nixops nixops_unstable;
# Rmfuse fails on darwin because osxfuse only implements fuse api v2 # Rmfuse fails on darwin because osxfuse only implements fuse api v2
rmfuse = skipOSX pkgs.rmfuse; rmfuse = skipOSX pkgs.rmfuse;

View file

@ -1,4 +1,4 @@
{ lib, poetry2nix, python37, runCommandNoCC }: { lib, poetry2nix, python37, runCommand }:
let let
drv = poetry2nix.mkPoetryApplication { drv = poetry2nix.mkPoetryApplication {
python = python37; python = python37;
@ -6,4 +6,4 @@ let
}; };
in in
assert lib.strings.hasSuffix ".egg" (lib.elemAt drv.passthru.python.pkgs.pyasn1.src.urls 0); assert lib.strings.hasSuffix ".egg" (lib.elemAt drv.passthru.python.pkgs.pyasn1.src.urls 0);
runCommandNoCC "egg-test" { } "touch $out" runCommand "egg-test" { } "touch $out"