public TestSessionServant(ServerConnection connection) : base(connection) { Configuration = new TestConfiguration(connection.Framework.ConfigurationProvider, connection.App.Settings); RootContext = new TestContext( connection.App.Settings, connection.EventSink.LoggerClient, Configuration, connection.Framework.Name); LocalSession = TestSession.CreateLocal(connection.App, connection.Framework, RootContext); }
async Task <bool> RunLocal(CancellationToken cancellationToken) { var framework = TestFramework.GetLocalFramework(Assembly, dependencyAssemblies); cancellationToken.ThrowIfCancellationRequested(); session = TestSession.CreateLocal(this, framework); OnSessionCreated(session); var test = session.RootTestCase; Debug("Got test: {0}", test); startTime = DateTime.Now; result = await session.Run(test, cancellationToken); endTime = DateTime.Now; Debug("Got result: {0}", result); SaveResult(); return(IsSuccessResult); }
async Task <int> RunLocal(CancellationToken cancellationToken) { var framework = TestFramework.GetLocalFramework(PackageName, Assembly, Options.Dependencies); cancellationToken.ThrowIfCancellationRequested(); session = TestSession.CreateLocal(this, framework); Options.UpdateConfiguration(session); var test = session.RootTestCase; Debug("Got test: {0}", test.Path.FullName); startTime = DateTime.Now; result = await session.Run(test, cancellationToken); endTime = DateTime.Now; Debug("Got result: {0} {1}", result.Status, test.Path.FullName); SaveResult(); return(ExitCodeForResult); }
async Task RunLocal() { session = TestSession.CreateLocal(this, framework); var test = await session.GetRootTestCase(CancellationToken.None); Debug("Got test: {0}", test); var result = await session.Run(test, CancellationToken.None); Debug("Got result: {0}", result); Debug("{0} tests, {1} passed, {2} errors, {3} ignored.", countTests, countSuccess, countErrors, countIgnored); if (!NoXml) { var serialized = TestSerializer.WriteTestResult(result); var settings = new XmlWriterSettings(); settings.Indent = true; using (var writer = XmlTextWriter.Create(XmlOutputFileName, settings)) serialized.WriteTo(writer); Debug("Result writting to {0}.", XmlOutputFileName); } }
protected override Task <TestSession> GetTestSession(CancellationToken cancellationToken) { return(Task.FromResult(TestSession.CreateLocal(App, framework))); }