Closed sylvesp closed 2 years ago
Did some digging in the Test Runner code and I think that the problem is in ReflectionRunner.RunTestClassGroup()
internal async Task RunTestClassGroup( IGrouping<string, TestCaseDto> testClassGroup, bool isSingleTest, Action<TestCaseDto, bool> updateAction )
{
if( !testClassGroup.Any() ) return;
var instance = new TestInstance( testClassGroup.First().AssemblyPath, testClassGroup.Key );
try {
==> //Have to signal the Runner that the test is starting by calling:
==> updateAction( .... something.... something);
==> //Otherwise if the [OneTimeSetup] takes too long the runner won't wait
==> //for it to finish and think that the test is over
await instance.CreateTestInstance( mUiApplication );
}
catch( Exception e ) {
foreach( TestCaseDto test in testClassGroup ) {
test.Message = $"Exception in OneTimeSetup: {e.Message}";
updateAction( test, true );
}
Log.Error( $"> {testClassGroup.Key} - {e.Message}", e );
}
......
}
Thanks for the issue and the solution. This looks in general as a good idea to notify when the test group is starting. Commit 2697f5c80df577f5ebc7df65fb03c17e09ae83d7
Opening a Revit File during the [OneTimeSetUp] causes the test runner to NOT wait for the end of the test.
To reproduce: 1) Create a sample test that opens a Revit model:
Run "SampleTest" from the test runner => All Good
2) Move the revit model open into the OneTimeSetUp function:
Run "SampleTest" from the test runner => The test runner will display a dialog about the successful test completion WAY BEFORE the drawing finishes opening in Revit.
Please let me know if you have any questions.