From f9677f30766825d2c168bf35e414afb711717145 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 29 Jun 2023 18:59:55 +0200 Subject: [PATCH 1/3] Don't error when warnings are written over stderr --- .../Tasks/IClusterComposeTask.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs b/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs index d13e990..d5ed155 100644 --- a/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs +++ b/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs @@ -184,9 +184,13 @@ private static void ExecuteBinaryInternal(EphemeralClusterConfiguration config, if (errorOut.Any() && config.Version < "5.2.0") errorOut = errorOut.Where(e => !e.Line.Contains("No log4j2 configuration file found")).ToList(); - if (errorOut.Any(e => - !string.IsNullOrWhiteSpace(e.Line) && !e.Line.Contains("usage of JAVA_HOME is deprecated")) && - !binary.Contains("plugin") && !binary.Contains("cert")) + errorOut = errorOut + .Where(e=> !string.IsNullOrWhiteSpace(e.Line)) + .Where(e => !e.Line.Contains("usage of JAVA_HOME is deprecated")) + .Where(e => !e.Line.StartsWith("warning:")) + .ToList(); + + if (errorOut.Any() && !binary.Contains("plugin") && !binary.Contains("cert")) throw new Exception( $"Received error out with exitCode ({result.ExitCode}) while executing {description}: {command}"); From 1695e70c6504613a12c847a7e28abef0631a4302 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 29 Jun 2023 19:02:26 +0200 Subject: [PATCH 2/3] add trim for good measure --- .../Tasks/IClusterComposeTask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs b/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs index d5ed155..13a96ca 100644 --- a/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs +++ b/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs @@ -187,7 +187,7 @@ private static void ExecuteBinaryInternal(EphemeralClusterConfiguration config, errorOut = errorOut .Where(e=> !string.IsNullOrWhiteSpace(e.Line)) .Where(e => !e.Line.Contains("usage of JAVA_HOME is deprecated")) - .Where(e => !e.Line.StartsWith("warning:")) + .Where(e => !e.Line.Trim().StartsWith("warning:")) .ToList(); if (errorOut.Any() && !binary.Contains("plugin") && !binary.Contains("cert")) From c9df60c2800d5ba65bcefbd2aa7133de78f9dfba Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Fri, 30 Jun 2023 11:38:12 +0200 Subject: [PATCH 3/3] add formatting issue from review --- .../Tasks/IClusterComposeTask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs b/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs index 13a96ca..52c39c0 100644 --- a/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs +++ b/src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs @@ -185,7 +185,7 @@ private static void ExecuteBinaryInternal(EphemeralClusterConfiguration config, errorOut = errorOut.Where(e => !e.Line.Contains("No log4j2 configuration file found")).ToList(); errorOut = errorOut - .Where(e=> !string.IsNullOrWhiteSpace(e.Line)) + .Where(e => !string.IsNullOrWhiteSpace(e.Line)) .Where(e => !e.Line.Contains("usage of JAVA_HOME is deprecated")) .Where(e => !e.Line.Trim().StartsWith("warning:")) .ToList();