Skip to content

Commit d822e2e

Browse files
committed
Update proc to 9.0
1 parent 34d6e3d commit d822e2e

File tree

9 files changed

+22
-23
lines changed

9 files changed

+22
-23
lines changed

build/scripts/Targets.fs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ open ProcNet
1414

1515

1616
let exec binary args =
17-
let r = Proc.Exec (binary, args |> List.map (fun a -> sprintf "\"%s\"" a) |> List.toArray)
18-
match r.HasValue with | true -> r.Value | false -> failwithf "invocation of `%s` timed out" binary
19-
17+
Proc.Exec (binary, args |> List.map (fun a -> sprintf "\"%s\"" a) |> List.toArray)
18+
2019
let private restoreTools = lazy(exec "dotnet" ["tool"; "restore"])
2120
let private currentVersion =
2221
lazy(

build/scripts/scripts.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<ItemGroup>
99
<PackageReference Include="Argu" Version="6.0.0" />
1010
<PackageReference Include="Bullseye" Version="3.3.0" />
11-
<PackageReference Include="Proc" Version="0.6.2" />
11+
<PackageReference Include="Proc" Version="0.9.0" />
1212
<PackageReference Include="Fake.Tools.Git" Version="5.15.0" />
1313
</ItemGroup>
1414

examples/Elastic.Xunit.ExampleMinimal/ExampleTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public class MyTestCluster : XunitClusterBase
2121
/// We pass our configuration instance to the base class.
2222
/// We only configure it to run version 6.2.3 here but lots of additional options are available.
2323
/// </summary>
24-
public MyTestCluster() : base(new XunitClusterConfiguration("latest-8"))
24+
public MyTestCluster() : base(new XunitClusterConfiguration("8.16.0")
25+
{ PrintYamlFilesInConfigFolder = true, NoCleanupAfterNodeStopped = true })
2526
{
2627
}
2728
}

examples/ScratchPad/ScratchPad.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<IsPackable>False</IsPackable>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="Proc" Version="0.6.1" />
8+
<PackageReference Include="Proc" Version="0.9.0" />
99
<!--<ProjectReference Include="..\..\..\..\..\proc\src\Proc\Proc.csproj" />-->
1010
<PackageReference Include="NEST" Version="6.0.1" />
1111
</ItemGroup>

src/Elastic.Elasticsearch.Ephemeral/EphemeralFileSystem.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ public EphemeralFileSystem(ElasticVersion version, string clusterName) : base(ve
5656

5757
protected static string EphemeralHome(ElasticVersion version, string clusterName)
5858
{
59-
var temp = Path.Combine(Path.GetTempPath(), SubFolder,
60-
version.Artifact(Product.Elasticsearch).LocalFolderName, clusterName);
59+
var artifact = version.Artifact(Product.Elasticsearch);
60+
var localFolder = artifact.LocalFolderName;
61+
var temp = Path.Combine(Path.GetTempPath(), SubFolder, localFolder, clusterName);
6162
return Path.Combine(temp, "home");
6263
}
6364
}

src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,10 @@ protected static void WriteFileIfNotExist(string fileLocation, string contents)
148148

149149
protected static void ExecuteBinary(EphemeralClusterConfiguration config, IConsoleLineHandler writer,
150150
string binary, string description, params string[] arguments) =>
151-
ExecuteBinaryInternal(config, writer, binary, description, null, arguments);
152-
153-
protected static void ExecuteBinary(EphemeralClusterConfiguration config, IConsoleLineHandler writer,
154-
string binary, string description, StartedHandler startedHandler, params string[] arguments) =>
155-
ExecuteBinaryInternal(config, writer, binary, description, startedHandler, arguments);
151+
ExecuteBinaryInternal(config, writer, binary, description, arguments);
156152

157153
private static void ExecuteBinaryInternal(EphemeralClusterConfiguration config, IConsoleLineHandler writer,
158-
string binary, string description, StartedHandler startedHandler, params string[] arguments)
154+
string binary, string description, params string[] arguments)
159155
{
160156
var command = $"{{{binary}}} {{{string.Join(" ", arguments)}}}";
161157
writer?.WriteDiagnostic($"{{{nameof(ExecuteBinary)}}} starting process [{description}] {command}");
@@ -167,12 +163,12 @@ private static void ExecuteBinaryInternal(EphemeralClusterConfiguration config,
167163
{
168164
{config.FileSystem.ConfigEnvironmentVariableName, config.FileSystem.ConfigPath},
169165
{"ES_HOME", config.FileSystem.ElasticsearchHome}
170-
}
166+
},
167+
Timeout = timeout,
168+
ConsoleOutWriter = new ConsoleOutColorWriter(),
171169
};
172170

173-
var result = startedHandler != null
174-
? Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter(), startedHandler)
175-
: Proc.Start(processStartArguments, timeout, new ConsoleOutColorWriter());
171+
var result = Proc.Start(processStartArguments);
176172

177173
if (!result.Completed)
178174
throw new Exception($"Timeout while executing {description} exceeded {timeout}");

src/Elastic.Elasticsearch.Managed/Elastic.Elasticsearch.Managed.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageTags>elastic,elasticsearch,cluster,observable,rx</PackageTags>
1010
</PropertyGroup>
1111
<ItemGroup>
12-
<PackageReference Include="Proc" Version="0.6.1" />
12+
<PackageReference Include="Proc" Version="0.9.0" />
1313
</ItemGroup>
1414
<ItemGroup>
1515
<ProjectReference Include="..\Elastic.Stack.ArtifactsApi\Elastic.Stack.ArtifactsApi.csproj" />

src/Elastic.Elasticsearch.Managed/ElasticsearchNode.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ public IDisposable SubscribeLines(IConsoleLineHandler writer, Action<LineOut> on
119119

120120
var envVarName = NodeConfiguration.Version.InRange("<7.12.0") ? "JAVA_HOME" : "ES_JAVA_HOME";
121121
var javaHome = Environment.GetEnvironmentVariable(envVarName);
122-
writer?.WriteDiagnostic($"{envVarName}: {{{javaHome}}}", node);
123-
Process.StartInfo.Environment[envVarName] = javaHome;
124-
122+
if (!string.IsNullOrWhiteSpace(javaHome))
123+
{
124+
writer?.WriteDiagnostic($"{envVarName}: {{{javaHome}}}", node);
125+
Process.StartInfo.Environment[envVarName] = javaHome;
126+
}
125127
return SubscribeLines(
126128
l =>
127129
{

src/Elastic.Stack.ArtifactsApi/ElasticVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public int CompareTo(string other)
3434
public Artifact Artifact(Product product)
3535
{
3636
var cacheKey = product.ToString();
37-
if (_resolved.TryGetValue(cacheKey, out var artifact))
37+
if (_resolved.TryGetValue(cacheKey, out var artifact) && artifact != null)
3838
return artifact;
3939
switch (ArtifactBuildState)
4040
{

0 commit comments

Comments
 (0)