public void Exited(string id) { lock (WaitingForPlatforms) { if (WaitingForPlatforms.Contains(id)) { AddTest(TestMeta.FakeTest("Never Received Tests"), id); } } lock (ExpectedTests) { foreach (var expectedTest in ExpectedTests) { var result = expectedTest.Value.FirstOrDefault(it => it.Platform == id); if (result != null && result.Result == null) { AddResult(new Result() { Platform = id, Kind = ResultKind.Error, Output = "Runner unexpectedly quit", Test = result.MissingTest }); } } } ReceivedTests(id); }
public bool ShouldRun(TestMeta test) { Setup(); bool? run = null; if (_nameFilters.ContainsKey(test.UniqueName)) run = _nameFilters[test.UniqueName]; if (_nameFilters.ContainsKey(test.Fixture.UniqueName)) run = _nameFilters[test.Fixture.UniqueName]; if (_nameFilters.ContainsKey(test.Fixture.Assembly.UniqueName)) run = _nameFilters[test.Fixture.Assembly.UniqueName]; if (test.Category.Any(c => _nameFilters.ContainsKey(UniqueCategory(c)))) run = test.Category .Where(c => _nameFilters.ContainsKey(UniqueCategory(c))) .Select(c=>_nameFilters[UniqueCategory(c)]) .All(b=>b); if (!run.HasValue) { if (!_nameFilters.Any() || (!Includes.Any() && Excludes.Any())) return true; return false; } return run.Value; }
public void AddTest(TestMeta test, string id) { string key = string.Format("{0}|{1}|{2}", test.Fixture.Assembly.UniqueName, test.Fixture.UniqueName, test.UniqueName); lock (ExpectedTests) { if (!ExpectedTests.ContainsKey(key)) { ExpectedTests.Add(key, new List <PlatformResult>()); } ExpectedTests[key].Add(new PlatformResult(id) { MissingTest = test }); } }
/// <summary> /// /// </summary> /// <param name="test"></param> /// <returns></returns> public TestMeta Execute(ITest test) { var runningTest = new TestMeta { Id = Guid.NewGuid().ToString(), Status = TestStatus.Submitted, CancellationToken = new CancellationToken(), }; Task.Run(async() => { TaskHolder.TryAdd(runningTest.Id, runningTest); await _executor.ExecuteTestAsync(test, runningTest); TaskHolder.Remove(runningTest.Id, out var value); }); return(runningTest); }
public void AddTest(TestMeta test, string id) { string key = string.Format("{0}|{1}|{2}", test.Fixture.Assembly.UniqueName, test.Fixture.UniqueName, test.UniqueName); lock (ExpectedTests) { if (!ExpectedTests.ContainsKey(key)) { ExpectedTests.Add(key, new List<PlatformResult>()); } ExpectedTests[key].Add(new PlatformResult(id) { MissingTest = test }); } }
public async Task <bool> ExecuteTestAsync(ITest test, TestMeta testMeta) { testMeta.Status = TestStatus.Running; return(await Task.Run(() => ExecuteTest(test), testMeta.CancellationToken)); }