Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions build/scripts/Paths.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module Paths =

let InplaceBuildOutput project tfm =
sprintf "src/%s/bin/Release/%s" project tfm
let InplaceBuildTestOutput project tfm =
sprintf "tests/%s/bin/Release/%s" project tfm
let MagicDocumentationFile =
"src/Elasticsearch.Net/obj/Release/netstandard2.1/Elasticsearch.Net.csprojAssemblyReference.cache"

Expand Down
2 changes: 1 addition & 1 deletion build/scripts/ReposTooling.fs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module ReposTooling =
let clusterName = Option.defaultValue "" <| match args.CommandArguments with | Cluster c -> Some c.Name | _ -> None
let clusterVersion = Option.defaultValue "" <|match args.CommandArguments with | Cluster c -> c.Version | _ -> None

let testsProjectDirectory = Path.Combine(Path.GetFullPath(Paths.Output("Tests.ClusterLauncher")), "net5.0")
let testsProjectDirectory = Path.GetFullPath(Paths.InplaceBuildTestOutput "Tests.ClusterLauncher" "net5.0")
let tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

printfn "%s" testsProjectDirectory
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/scripts.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<PackageReference Include="FSharp.Core" Version="5.0.0" />

<PackageReference Include="Bullseye" Version="3.3.0" />
<PackageReference Include="Elastic.Elasticsearch.Managed" Version="0.1.0-canary.0.244" />
<PackageReference Include="Elastic.Elasticsearch.Managed" Version="0.2.5" />

<PackageReference Include="Fake.Core.Environment" Version="5.15.0" />
<PackageReference Include="Fake.Core.SemVer" Version="5.15.0" />
Expand Down
1 change: 0 additions & 1 deletion nuget.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Elastic Abstractions CI" value="https://ci.appveyor.com/nuget/elasticsearch-net-abstractions" />
<add key="Versioned Clients" value="https://ci.appveyor.com/nuget/elasticsearch-net" />
</packageSources>
</configuration>
19 changes: 13 additions & 6 deletions tests/Tests.ClusterLauncher/ClusterLaunchProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public static int Main(string[] arguments)
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NEST_YAML_FILE")))
{
// build always sets previous argument, assume we are running from the IDE or dotnet run
var yamlFile = TestConfiguration.LocateTestYamlFile();
Environment.SetEnvironmentVariable("NEST_YAML_FILE", yamlFile, EnvironmentVariableTarget.Process);
var yamlFile = TestConfiguration.LocateTestYamlFile();
Environment.SetEnvironmentVariable("NEST_YAML_FILE", yamlFile, EnvironmentVariableTarget.Process);
}

// if version is passed this will take precedence over the version in the yaml file
Expand All @@ -61,12 +61,19 @@ public static int Main(string[] arguments)
AppDomain.CurrentDomain.ProcessExit += (s, ev) => Instance?.Dispose();
Console.CancelKeyPress += (s, ev) => Instance?.Dispose();

if (!TryStartClientTestClusterBaseImplementation(cluster) && !TryStartXPackClusterImplementation(cluster))
try
{
if (TryStartClientTestClusterBaseImplementation(cluster) || TryStartXPackClusterImplementation(cluster)) return 0;

Console.Error.WriteLine($"Could not create an instance of '{cluster.FullName}");
return 1;
}
return 0;
catch (Exception e)
{
Console.WriteLine(e);
Instance?.Dispose();
throw;
}
}

private static bool TryStartXPackClusterImplementation(Type cluster)
Expand All @@ -91,7 +98,7 @@ private static bool TryStartClientTestClusterBaseImplementation(Type cluster)
private static bool Run(ICluster<EphemeralClusterConfiguration> instance)
{
TestConfiguration.Instance.DumpConfiguration();
instance.Start();
using var start = instance.Start();
if (!instance.Started)
{
Console.Error.WriteLine($"Failed to start cluster: '{instance.GetType().FullName}");
Expand All @@ -118,7 +125,7 @@ private static Type[] GetClusters()

return types
.Where(t => t.Implements(typeof(IEphemeralCluster)))
.Where(t=> !t.IsAbstract)
.Where(t => !t.IsAbstract)
.ToArray();
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Tests.Configuration/Tests.Configuration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elastic.Elasticsearch.Managed" Version="0.1.0-canary.0.244" />
<PackageReference Include="Elastic.Elasticsearch.Managed" Version="0.2.5" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion tests/Tests.Core/Tests.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Elastic.Elasticsearch.Xunit" Version="0.1.0-canary.0.244" />
<PackageReference Include="Elastic.Elasticsearch.Xunit" Version="0.2.5" />

<PackageReference Include="Nullean.VsTest.Pretty.TestLogger" Version="0.3.0" />
<PackageReference Include="coverlet.collector" Version="1.1.0" />
Expand Down
2 changes: 1 addition & 1 deletion tests/Tests.Domain/Tests.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Bogus" Version="22.1.2" />
<PackageReference Include="Elastic.Elasticsearch.Managed" Version="0.1.0-canary.0.244" />
<PackageReference Include="Elastic.Elasticsearch.Managed" Version="0.2.5" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<ProjectReference Include="$(SolutionRoot)\tests\Tests.Configuration\Tests.Configuration.csproj" />
</ItemGroup>
Expand Down