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
3 changes: 3 additions & 0 deletions tests/Tests.Core/Client/Settings/TestConnectionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ private void ApplyTestSettings() =>
.ConnectionLimit(ConnectionLimitDefault)
.OnRequestCompleted(r =>
{
//r.HttpMethod;
Copy link
Contributor

Choose a reason for hiding this comment

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

In by accident?

Copy link
Member Author

Choose a reason for hiding this comment

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

in by accident will remove thanks for catching this!



if (!r.DeprecationWarnings.Any()) return;

var q = r.Uri.Query;
Expand Down
30 changes: 18 additions & 12 deletions tests/Tests.Core/Xunit/NestXunitRunOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Elastic.Elasticsearch.Xunit;
using Tests.Configuration;
Expand All @@ -28,19 +29,15 @@ public NestXunitRunOptions()
Generators.Initialize();
}

public override void OnBeforeTestsRun()
{
//TestConfiguration.Instance.DumpConfiguration();
}
public override void OnBeforeTestsRun() => TestConfiguration.Instance.DumpConfiguration();

public override void OnTestsFinished(Dictionary<string, Stopwatch> clusterTotals, ConcurrentBag<Tuple<string, string>> failedCollections)
{
// DumpClusterTotals(clusterTotals);
// DumpSeenDeprecations();
// DumpFailedCollections(failedCollections);
DumpClusterTotals(clusterTotals);
DumpSeenDeprecations();
DumpFailedCollections(failedCollections);
}

// ReSharper disable once UnusedMember.Local
private static void DumpClusterTotals(Dictionary<string, Stopwatch> clusterTotals)
{
Console.WriteLine("--------");
Expand All @@ -49,7 +46,6 @@ private static void DumpClusterTotals(Dictionary<string, Stopwatch> clusterTotal
Console.WriteLine("--------");
}

// ReSharper disable once UnusedMember.Local
private static void DumpSeenDeprecations()
{
if (XunitRunState.SeenDeprecations.Count == 0) return;
Expand All @@ -60,10 +56,20 @@ private static void DumpSeenDeprecations()
Console.WriteLine("--------");
}

// ReSharper disable once UnusedMember.Local
private static void DumpFailedCollections(ConcurrentBag<Tuple<string, string>> failedCollections)
{
if (failedCollections.Count <= 0) return;
if (failedCollections.Count <= 0)
{
var config = TestConfiguration.Instance;
var runningIntegrations = config.RunIntegrationTests;
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("---Reproduce: -----");
var reproduceLine = ReproduceCommandLine(failedCollections, config, runningIntegrations);
Console.WriteLine(reproduceLine);
Console.WriteLine("---------------");
Console.ResetColor();
return;
};

Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Failed collections:");
Expand Down Expand Up @@ -100,7 +106,7 @@ private static string ReproduceCommandLine(ConcurrentBag<Tuple<string, string>>
bool runningIntegrations
)
{
var sb = new StringBuilder(".\\build.bat ")
var sb = new StringBuilder(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".\\build.bat " : "./build.sh ")
.Append("seed:").Append(config.Seed).Append(" ");

AppendConfig(nameof(RandomConfiguration.SourceSerializer), config.Random.SourceSerializer, sb);
Expand Down