Merge pull request #11800 from obsidiansystems/test-against-using-meson

Test against tests using Meson-built Nix
This commit is contained in:
Robert Hensing 2024-11-04 19:52:53 +01:00 committed by GitHub
commit baea2b9eec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 18 deletions

View file

@ -16,25 +16,16 @@ let
inherit tarballs; inherit tarballs;
}; };
testNixVersions = pkgs: client: daemon: testNixVersions = pkgs: daemon:
pkgs.nixComponents.callPackage ../package.nix { pkgs.nixComponents.nix-functional-tests.override {
pname = pname =
"nix-tests" "nix-tests"
+ lib.optionalString + lib.optionalString
(lib.versionAtLeast daemon.version "2.4pre20211005" && (lib.versionAtLeast daemon.version "2.4pre20211005" &&
lib.versionAtLeast client.version "2.4pre20211005") lib.versionAtLeast pkgs.nix.version "2.4pre20211005")
"-${client.version}-against-${daemon.version}"; "-${pkgs.nix.version}-against-${daemon.version}";
test-client = client;
test-daemon = daemon; test-daemon = daemon;
doBuild = false;
# This could be more accurate, but a shorter version will match the
# fine version with rev. This functionality is already covered in
# the normal test, so it's fine.
version = pkgs.nixComponents.version;
versionSuffix = pkgs.nixComponents.versionSuffix;
}; };
# Technically we could just return `pkgs.nixComponents`, but for Hydra it's # Technically we could just return `pkgs.nixComponents`, but for Hydra it's
@ -196,15 +187,15 @@ in
let pkgs = nixpkgsFor.${system}.native; in let pkgs = nixpkgsFor.${system}.native; in
pkgs.runCommand "install-tests" pkgs.runCommand "install-tests"
{ {
againstSelf = testNixVersions pkgs pkgs.nix pkgs.pkgs.nix; againstSelf = testNixVersions pkgs pkgs.nix;
againstCurrentLatest = againstCurrentLatest =
# FIXME: temporarily disable this on macOS because of #3605. # FIXME: temporarily disable this on macOS because of #3605.
if system == "x86_64-linux" if system == "x86_64-linux"
then testNixVersions pkgs pkgs.nix pkgs.nixVersions.latest then testNixVersions pkgs pkgs.nixVersions.latest
else null; else null;
# Disabled because the latest stable version doesn't handle # Disabled because the latest stable version doesn't handle
# `NIX_DAEMON_SOCKET_PATH` which is required for the tests to work # `NIX_DAEMON_SOCKET_PATH` which is required for the tests to work
# againstLatestStable = testNixVersions pkgs pkgs.nix pkgs.nixStable; # againstLatestStable = testNixVersions pkgs pkgs.nixStable;
} "touch $out"); } "touch $out");
installerTests = import ../tests/installer { installerTests = import ../tests/installer {

View file

@ -24,6 +24,7 @@
# Configuration Options # Configuration Options
, pname ? "nix-functional-tests"
, version , version
# For running the functional tests against a different pre-built Nix. # For running the functional tests against a different pre-built Nix.
@ -35,8 +36,7 @@ let
in in
mkMesonDerivation (finalAttrs: { mkMesonDerivation (finalAttrs: {
pname = "nix-functional-tests"; inherit pname version;
inherit version;
workDir = ./.; workDir = ./.;
fileset = fileset.unions [ fileset = fileset.unions [