77using System . Collections . Generic ;
88using System . Diagnostics ;
99using System . Linq ;
10+ using System . Runtime . InteropServices ;
1011using System . Text ;
1112using Elastic . Elasticsearch . Xunit ;
1213using Tests . Configuration ;
@@ -28,19 +29,15 @@ public NestXunitRunOptions()
2829 Generators . Initialize ( ) ;
2930 }
3031
31- public override void OnBeforeTestsRun ( )
32- {
33- //TestConfiguration.Instance.DumpConfiguration();
34- }
32+ public override void OnBeforeTestsRun ( ) => TestConfiguration . Instance . DumpConfiguration ( ) ;
3533
3634 public override void OnTestsFinished ( Dictionary < string , Stopwatch > clusterTotals , ConcurrentBag < Tuple < string , string > > failedCollections )
3735 {
38- // DumpClusterTotals(clusterTotals);
39- // DumpSeenDeprecations();
40- // DumpFailedCollections(failedCollections);
36+ DumpClusterTotals ( clusterTotals ) ;
37+ DumpSeenDeprecations ( ) ;
38+ DumpFailedCollections ( failedCollections ) ;
4139 }
4240
43- // ReSharper disable once UnusedMember.Local
4441 private static void DumpClusterTotals ( Dictionary < string , Stopwatch > clusterTotals )
4542 {
4643 Console . WriteLine ( "--------" ) ;
@@ -49,7 +46,6 @@ private static void DumpClusterTotals(Dictionary<string, Stopwatch> clusterTotal
4946 Console . WriteLine ( "--------" ) ;
5047 }
5148
52- // ReSharper disable once UnusedMember.Local
5349 private static void DumpSeenDeprecations ( )
5450 {
5551 if ( XunitRunState . SeenDeprecations . Count == 0 ) return ;
@@ -60,10 +56,20 @@ private static void DumpSeenDeprecations()
6056 Console . WriteLine ( "--------" ) ;
6157 }
6258
63- // ReSharper disable once UnusedMember.Local
6459 private static void DumpFailedCollections ( ConcurrentBag < Tuple < string , string > > failedCollections )
6560 {
66- if ( failedCollections . Count <= 0 ) return ;
61+ if ( failedCollections . Count <= 0 )
62+ {
63+ var config = TestConfiguration . Instance ;
64+ var runningIntegrations = config . RunIntegrationTests ;
65+ Console . ForegroundColor = ConsoleColor . Yellow ;
66+ Console . WriteLine ( "---Reproduce: -----" ) ;
67+ var reproduceLine = ReproduceCommandLine ( failedCollections , config , runningIntegrations ) ;
68+ Console . WriteLine ( reproduceLine ) ;
69+ Console . WriteLine ( "---------------" ) ;
70+ Console . ResetColor ( ) ;
71+ return ;
72+ } ;
6773
6874 Console . ForegroundColor = ConsoleColor . Red ;
6975 Console . WriteLine ( "Failed collections:" ) ;
@@ -100,7 +106,7 @@ private static string ReproduceCommandLine(ConcurrentBag<Tuple<string, string>>
100106 bool runningIntegrations
101107 )
102108 {
103- var sb = new StringBuilder ( ".\\ build.bat " )
109+ var sb = new StringBuilder ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ? ".\\ build.bat " : "./build.sh ")
104110 . Append ( "seed:" ) . Append ( config . Seed ) . Append ( " " ) ;
105111
106112 AppendConfig ( nameof ( RandomConfiguration . SourceSerializer ) , config . Random . SourceSerializer , sb ) ;
0 commit comments