protected override async void RunTestCases(IEnumerable <IXunitTestCase> testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions)
 {
     try
     {
         using (var assemblyRunner = new TestAssemblyRunner(TestAssembly, testCases, DiagnosticMessageSink, executionMessageSink, executionOptions))
             await assemblyRunner.RunAsync();
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
Esempio n. 2
0
        private static void DumpReproduceFilters(TestAssemblyRunner runner)
        {
            var config = TestClient.Configuration;
            var runningIntegrations = config.RunIntegrationTests;

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("--------");
            var sb = new StringBuilder("build ")
                     .Append($"seed:{config.Seed} ");

            AppendExplictConfig(nameof(RandomConfiguration.SourceSerializer), sb);
            AppendExplictConfig(nameof(RandomConfiguration.TypedKeys), sb);
#if FEATURE_HTTPWEBREQUEST
            AppendExplictConfig(nameof(RandomConfiguration.OldConnection), sb);
#endif

            if (runningIntegrations)
            {
                sb.Append("integrate ")
                .Append(TestClient.Configuration.ElasticsearchVersion);
            }

            else
            {
                sb.Append("test");
            }

            if (runningIntegrations && runner.FailedCollections.Count > 0)
            {
                var clusters = string.Join(",", runner.FailedCollections
                                           .Select(c => c.Item1.ToLowerInvariant()).Distinct());
                sb.Append(" \"");
                sb.Append(clusters);
                sb.Append("\"");
            }
            if ((!runningIntegrations || (runner.FailedCollections.Count < 30)) && runner.FailedCollections.Count > 0)
            {
                sb.Append(" \"");
                var tests = string.Join(",", runner.FailedCollections
                                        .OrderBy(t => t.Item2)
                                        .Select(c => c.Item2.ToLowerInvariant().Split('.').Last()
                                                .Replace("apitests", "")
                                                .Replace("usagetests", "")
                                                .Replace("tests", "")
                                                ));
                sb.Append(tests);
                sb.Append("\"");
            }
            Console.WriteLine(sb.ToString());
            Console.WriteLine("--------");
        }
Esempio n. 3
0
        protected override async void RunTestCases(
            IEnumerable <IXunitTestCase> testCases, IMessageSink sink, ITestFrameworkExecutionOptions options
            )
        {
            try
            {
                using (var runner = new TestAssemblyRunner(TestAssembly, testCases, DiagnosticMessageSink, sink, options))
                {
                    await runner.RunAsync();

                    Console.Out.Flush();
                    if (runner.ClusterTotals.Count > 0)
                    {
                        Console.WriteLine("--------");
                        Console.WriteLine("Individual cluster running times:");
                        foreach (var kv in runner.ClusterTotals)
                        {
                            Console.WriteLine($"- {kv.Key}: {kv.Value.Elapsed}");
                        }
                        Console.WriteLine("--------");
                    }

                    DumpSeenDeprecations();

                    if (runner.FailedCollections.Count > 0)
                    {
                        Console.WriteLine("--------");
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("Failed collections:");
                        foreach (var t in runner.FailedCollections.OrderBy(p => p.Item1).ThenBy(t => t.Item2))
                        {
                            var cluster = t.Item1;
                            Console.WriteLine($" - {cluster}: {t.Item2}");
                        }
                        Console.WriteLine("--------");
                    }
                    DumpReproduceFilters(runner);
                    Console.ResetColor();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Esempio n. 4
0
        private static void DumpReproduceFilters(TestAssemblyRunner runner)
        {
            var runningIntegrations = TestClient.Configuration.RunIntegrationTests;

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("--------");
            var sb = new StringBuilder("build ");

            if (runningIntegrations)
            {
                sb.Append("integrate ")
                .Append(TestClient.Configuration.ElasticsearchVersion)
                .Append(" \"");
            }
            else
            {
                sb.Append("test");
            }

            if (runningIntegrations)
            {
                var clusters = string.Join(",", runner.FailedCollections
                                           .Select(c => c.Item1.ToLowerInvariant()).Distinct());
                sb.Append(clusters);
                sb.Append("\"");
            }
            if (!runningIntegrations || (runner.FailedCollections.Count < 30))
            {
                sb.Append(" \"");
                var tests = string.Join(",", runner.FailedCollections
                                        .OrderBy(t => t.Item2)
                                        .Select(c => c.Item2.ToLowerInvariant().Split('.').Last()
                                                .Replace("apitests", "")
                                                .Replace("usagetests", "")
                                                .Replace("tests", "")
                                                ));
                sb.Append(tests);
                sb.Append("\"");
            }
            Console.WriteLine(sb.ToString());
            Console.WriteLine("--------");
        }
		protected override async void RunTestCases(IEnumerable<IXunitTestCase> testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions)
		{
			using (var assemblyRunner = new TestAssemblyRunner(TestAssembly, testCases, DiagnosticMessageSink, executionMessageSink, executionOptions))
				await assemblyRunner.RunAsync();
		}
 protected override async void RunTestCases(IEnumerable <IXunitTestCase> testCases, IMessageSink executionMessageSink, ITestFrameworkExecutionOptions executionOptions)
 {
     using (var assemblyRunner = new TestAssemblyRunner(TestAssembly, testCases, DiagnosticMessageSink, executionMessageSink, executionOptions))
         await assemblyRunner.RunAsync();
 }