From 695457fa9daf57101354e624f42038fca49a35b8 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 16 Jan 2024 12:59:45 +1300 Subject: [PATCH] Fix integration tests Signed-off-by: Thomas Farr --- .../Tasks/InstallationTasks/InstallPlugins.cs | 2 +- .../Configuration/NodeSettings.cs | 9 +++------ build/scripts/ReposTooling.fs | 13 ++++++------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs index c64501038e..c9509b7d03 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Ephemeral/Tasks/InstallationTasks/InstallPlugins.cs @@ -99,7 +99,7 @@ public override void Run(IEphemeralCluster cluste cluster.Writer, fs.PluginBinary, $"install opensearch plugin: {plugin.SubProductName}", - "install --batch", GetPluginLocation(plugin, v)); + "install", "--batch", GetPluginLocation(plugin, v)); CopyConfigDirectoryToHomeCacheConfigDirectory(cluster, plugin); } diff --git a/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs b/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs index 0ce531141c..ea34663ca7 100644 --- a/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs +++ b/abstractions/src/OpenSearch.OpenSearch.Managed/Configuration/NodeSettings.cs @@ -56,18 +56,15 @@ public void Add(string setting) public void Add(string key, string value, string versionRange) => Add(new NodeSetting(key, value, versionRange)); - public string[] ToCommandLineArguments(OpenSearchVersion version) - { - var settingArgument = "-E "; - return this + public string[] ToCommandLineArguments(OpenSearchVersion version) => + this //if a node setting is only applicable for a certain version make sure its filtered out .Where(s => string.IsNullOrEmpty(s.VersionRange) || version.InRange(s.VersionRange)) //allow additional settings to take precedence over already DefaultNodeSettings //without relying on opensearch to dedup .GroupBy(setting => setting.Key) .Select(g => g.Last()) - .Select(s => s.Key.StartsWith(settingArgument) ? s.ToString() : $"{settingArgument}{s}") + .SelectMany(s => new[] { "-E", s.ToString() }) .ToArray(); - } } } diff --git a/build/scripts/ReposTooling.fs b/build/scripts/ReposTooling.fs index cdd01f8cfe..2005a5a0ad 100644 --- a/build/scripts/ReposTooling.fs +++ b/build/scripts/ReposTooling.fs @@ -64,17 +64,16 @@ module ReposTooling = let folder = Path.getDirectory (Paths.TestProjFile "Tests.YamlRunner") let timeout = TimeSpan.FromMinutes(120.) Tooling.DotNet.ExecInWithTimeout folder (["run"; "--" ] @ args) timeout |> ignore - - + + let restoreOnce = lazy(Tooling.DotNet.Exec ["tool"; "restore"]) - + let private differ = "assembly-differ" let Differ args = restoreOnce.Force() - - let args = args |> String.concat " " - let command = sprintf @"%s %s -o ../../%s" differ args Paths.BuildOutput - Tooling.DotNet.ExecIn Paths.TargetsFolder [command] |> ignore + + let args = [differ] @ args @ ["-o"; $"../../{Paths.BuildOutput}"] + Tooling.DotNet.ExecIn Paths.TargetsFolder args let private assemblyRewriter = "assembly-rewriter" let Rewriter args =