Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib.tests.release: build nix without flaky aws-sdk-cpp #266443

Merged
merged 1 commit into from Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/path/tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@
overlays = [];
inherit system;
},
nixVersions ? import ../../tests/nix-for-tests.nix { inherit pkgs; },
libpath ? ../..,
# Random seed
seed ? null,
}:

pkgs.runCommand "lib-path-tests" {
nativeBuildInputs = with pkgs; [
nix
nativeBuildInputs = [
nixVersions.stable
] ++ (with pkgs; [
jq
bc
];
]);
} ''
# Needed to make Nix evaluation work
export TEST_ROOT=$(pwd)/test-tmp
Expand Down
17 changes: 17 additions & 0 deletions lib/tests/nix-for-tests.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ pkgs
}:

# The aws-sdk-cpp tests are flaky. Since pull requests to staging
# cause nix to be rebuilt, this means that staging PRs end up
# getting false CI failures due to whatever is flaky in the AWS
# SDK tests. Since none of our CI needs to (or should be able to)
# contact AWS S3, let's just omit it all from the Nix that runs
# CI. Bonus: the tests build way faster.
#
# See also: https://github.com/NixOS/nix/issues/7582

builtins.mapAttrs (_: pkg:
if builtins.isAttrs pkg
then pkg.override { withAWS = false; }
else pkg)
pkgs.nixVersions
5 changes: 3 additions & 2 deletions lib/tests/release.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{ # The pkgs used for dependencies for the testing itself
# Don't test properties of pkgs.lib, but rather the lib in the parent directory
pkgs ? import ../.. {} // { lib = throw "pkgs.lib accessed, but the lib tests should use nixpkgs' lib path directly!"; },
nix ? pkgs.nix,
nixVersions ? [ pkgs.nixVersions.minimum nix pkgs.nixVersions.unstable ],
nix ? pkgs-nixVersions.stable,
nixVersions ? [ pkgs-nixVersions.minimum nix pkgs-nixVersions.unstable ],
pkgs-nixVersions ? import ./nix-for-tests.nix { inherit pkgs; },
}:

let
Expand Down