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

Test against tests using Meson-built Nix #11800

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
23 changes: 7 additions & 16 deletions packaging/hydra.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,16 @@ let
inherit tarballs;
};

testNixVersions = pkgs: client: daemon:
Copy link
Member

@roberth roberth Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was odd. Good riddance. Wrote alternative proposal

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(to be clear, we agree the way described in the issue is better. This is a step in that direction.)

pkgs.nixComponents.callPackage ../package.nix {
testNixVersions = pkgs: daemon:
pkgs.nixComponents.nix-functional-tests.override {
pname =
"nix-tests"
+ lib.optionalString
(lib.versionAtLeast daemon.version "2.4pre20211005" &&
lib.versionAtLeast client.version "2.4pre20211005")
"-${client.version}-against-${daemon.version}";
lib.versionAtLeast pkgs.nix.version "2.4pre20211005")
"-${pkgs.nix.version}-against-${daemon.version}";

test-client = client;
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
Expand Down Expand Up @@ -196,15 +187,15 @@ in
let pkgs = nixpkgsFor.${system}.native; in
pkgs.runCommand "install-tests"
{
againstSelf = testNixVersions pkgs pkgs.nix pkgs.pkgs.nix;
againstSelf = testNixVersions pkgs pkgs.pkgs.nix;
Ericson2314 marked this conversation as resolved.
Show resolved Hide resolved
againstCurrentLatest =
# FIXME: temporarily disable this on macOS because of #3605.
if system == "x86_64-linux"
then testNixVersions pkgs pkgs.nix pkgs.nixVersions.latest
then testNixVersions pkgs pkgs.nixVersions.latest
else null;
# Disabled because the latest stable version doesn't handle
# `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");

installerTests = import ../tests/installer {
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

# Configuration Options

, pname ? "nix-functional-tests"
, version

# For running the functional tests against a different pre-built Nix.
Expand All @@ -35,8 +36,7 @@ let
in

mkMesonDerivation (finalAttrs: {
pname = "nix-functional-tests";
inherit version;
inherit pname version;

workDir = ./.;
fileset = fileset.unions [
Expand Down
Loading