static void AppVeyorAddTest(string testName, string testFramework, string fileName, string outcome, long?durationMilliseconds, string errorMessage, string errorStackTrace, string stdOut, string stdErr) { if (!AppVeyorClient.IsRunningInAppVeyor) { return; } var body = new AddUpdateTestRequest { TestName = testName, TestFramework = testFramework, FileName = fileName, Outcome = outcome, DurationMilliseconds = durationMilliseconds, ErrorMessage = errorMessage, ErrorStackTrace = errorStackTrace, StdOut = TrimStdOut(stdOut), StdErr = TrimStdOut(stdErr) }; try { AppVeyorClient.SendRequest("api/tests", "POST", body); } catch (Exception ex) { Console.Error.WriteLine("Error communicating AppVeyor Build Worker API: " + ex.Message); } }
void AppVeyorAddTest(string testName, string testFramework, string fileName, string outcome, long?durationMilliseconds, string errorMessage, string errorStackTrace, string stdOut, string stdErr) { var body = new AddUpdateTestRequest { TestName = testName, TestFramework = testFramework, FileName = fileName, Outcome = outcome, DurationMilliseconds = durationMilliseconds, ErrorMessage = errorMessage, ErrorStackTrace = errorStackTrace, StdOut = TrimStdOut(stdOut), StdErr = TrimStdOut(stdErr) }; try { AppVeyorClient.SendRequest(Logger, $"{baseUri}/api/tests", "POST", body); } catch (Exception ex) { Logger.LogError("Error communicating AppVeyor Build Worker API: " + ex.Message); } }
void HandleTestAssemblyFinished(MessageHandlerArgs <ITestAssemblyFinished> args) { lock (clientLock) { assembliesInFlight--; if (assembliesInFlight == 0) { // Drain the queue client.WaitOne(CancellationToken.None); client = null; } } }
void HandleTestAssemblyStarting(MessageHandlerArgs <ITestAssemblyStarting> args) { lock (clientLock) { assembliesInFlight++; var assemblyFileName = Path.GetFileName(args.Message.TestAssembly.Assembly.AssemblyPath); assemblyNames[args.Message.TestAssembly.Assembly.Name] = Tuple.Create(assemblyFileName, new Dictionary <string, int>(StringComparer.OrdinalIgnoreCase)); if (client == null) { client = new AppVeyorClient(Logger, baseUri); } } }
void AppVeyorAddTest(string testName, string testFramework, string fileName, string outcome, long?durationMilliseconds, string errorMessage, string errorStackTrace, string stdOut) { var body = new AddUpdateTestRequest { TestName = testName, TestFramework = testFramework, FileName = fileName, Outcome = outcome, DurationMilliseconds = durationMilliseconds, ErrorMessage = errorMessage, ErrorStackTrace = errorStackTrace, StdOut = TrimStdOut(stdOut), }; AppVeyorClient.SendRequest(Logger, $"{baseUri}/api/tests", HttpMethod.Post, body); }
void HandleTestAssemblyStarting(MessageHandlerArgs <ITestAssemblyStarting> args) { lock (clientLock) { assembliesInFlight++; // Look for the TFM attrib to disambiguate var attrib = args.Message.TestAssembly.Assembly.GetCustomAttributes("System.Runtime.Versioning.TargetFrameworkAttribute").FirstOrDefault(); var arg = attrib?.GetConstructorArguments().FirstOrDefault() as string; var assemblyFileName = Path.GetFileName(args.Message.TestAssembly.Assembly.AssemblyPath); if (arg != null) { assemblyFileName = $"{assemblyFileName} ({arg})"; } assemblyNames[args.Message.TestAssembly.Assembly.Name] = Tuple.Create(assemblyFileName, new Dictionary <string, int>(StringComparer.OrdinalIgnoreCase)); if (client == null) { client = new AppVeyorClient(Logger, baseUri); } } }
void HandleTestAssemblyStarting(MessageHandlerArgs<ITestAssemblyStarting> args) { assemblyFileName = Path.GetFileName(args.Message.TestAssembly.Assembly.AssemblyPath); client = new AppVeyorClient(Logger, baseUri); }
void HandleTestAssemblyStarting(MessageHandlerArgs <ITestAssemblyStarting> args) { assemblyFileName = Path.GetFileName(args.Message.TestAssembly.Assembly.AssemblyPath); client = new AppVeyorClient(Logger, baseUri); }