mirror of
https://github.com/NixOS/nix.git
synced 2025-12-18 15:01:08 +01:00
ci: integrate vm_tests into main tests job
This consolidates the separate vm_tests job into the main tests job, simplifying the CI workflow. VM tests now run as part of the regular test matrix.
This commit is contained in:
parent
fc8b784924
commit
a400ea4257
3 changed files with 38 additions and 82 deletions
|
|
@ -79,6 +79,14 @@ rec {
|
|||
}
|
||||
);
|
||||
|
||||
# Import NixOS tests using the instrumented components
|
||||
nixosTests = import ../../../tests/nixos {
|
||||
inherit lib pkgs;
|
||||
nixComponents = nixComponentsInstrumented;
|
||||
nixpkgs = nixFlake.inputs.nixpkgs;
|
||||
inherit (nixFlake.inputs) nixpkgs-23-11;
|
||||
};
|
||||
|
||||
/**
|
||||
Top-level tests for the flake outputs, as they would be built by hydra.
|
||||
These tests generally can't be overridden to run with sanitizers.
|
||||
|
|
@ -229,4 +237,24 @@ rec {
|
|||
{
|
||||
inherit coverageProfileDrvs mergedProfdata coverageReports;
|
||||
};
|
||||
|
||||
vmTests = {
|
||||
}
|
||||
# FIXME: when the curlS3 implementation is complete, it should also enable these tests.
|
||||
// lib.optionalAttrs (withAWS == true) {
|
||||
# S3 binary cache store test only runs when S3 support is enabled
|
||||
inherit (nixosTests) s3-binary-cache-store;
|
||||
}
|
||||
// lib.optionalAttrs (!withSanitizers && !withCoverage) {
|
||||
# evalNixpkgs uses non-instrumented components from hydraJobs, so only run it
|
||||
# when not testing with sanitizers to avoid rebuilding nix
|
||||
inherit (hydraJobs.tests) evalNixpkgs;
|
||||
# FIXME: CI times out when building vm tests instrumented
|
||||
inherit (nixosTests)
|
||||
functional_user
|
||||
githubFlakes
|
||||
nix-docker
|
||||
tarballFlakes
|
||||
;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
{
|
||||
nixFlake ? builtins.getFlake ("git+file://" + toString ../../..),
|
||||
system ? "x86_64-linux",
|
||||
withAWS ? null,
|
||||
withCurlS3 ? null,
|
||||
}:
|
||||
|
||||
let
|
||||
pkgs = nixFlake.inputs.nixpkgs.legacyPackages.${system};
|
||||
lib = pkgs.lib;
|
||||
|
||||
# Create base nixComponents using the flake's makeComponents
|
||||
baseNixComponents = nixFlake.lib.makeComponents {
|
||||
inherit pkgs;
|
||||
};
|
||||
|
||||
# Override nixComponents if AWS parameters are specified
|
||||
nixComponents =
|
||||
if (withAWS == null && withCurlS3 == null) then
|
||||
baseNixComponents
|
||||
else
|
||||
baseNixComponents.overrideScope (
|
||||
final: prev: {
|
||||
nix-store = prev.nix-store.override (
|
||||
lib.optionalAttrs (withAWS != null) { inherit withAWS; }
|
||||
// lib.optionalAttrs (withCurlS3 != null) { inherit withCurlS3; }
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
# Import NixOS tests with the overridden nixComponents
|
||||
tests = import ../../../tests/nixos {
|
||||
inherit lib pkgs nixComponents;
|
||||
nixpkgs = nixFlake.inputs.nixpkgs;
|
||||
inherit (nixFlake.inputs) nixpkgs-23-11;
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit (tests)
|
||||
functional_user
|
||||
githubFlakes
|
||||
nix-docker
|
||||
tarballFlakes
|
||||
;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue