private async Task TestExecutionStartingAsync(IOperation operation)
        {
            cancelling        = false;
            runningInParallel = false;
            StopCoverage();

            var settings = appOptionsProvider.Get();

            if (!settings.Enabled)
            {
                CombinedLog("Coverage not collected as FCC disabled.");
                reportGeneratorUtil.EndOfCoverageRun();
                return;
            }

            msCodeCoverageCollectionStatus = await msCodeCoverageRunSettingsService.IsCollectingAsync(testOperationFactory.Create(operation));

            if (msCodeCoverageCollectionStatus == MsCodeCoverageCollectionStatus.NotCollecting)
            {
                if (settings.RunInParallel)
                {
                    runningInParallel = true;
                    fccEngine.ReloadCoverage(() =>
                    {
                        return(testOperationFactory.Create(operation).GetCoverageProjectsAsync());
                    });
                }
                else
                {
                    CombinedLog("Coverage collected when tests finish. RunInParallel option true for immediate");
                }
            }
        }
Example #2
0
 private void ReportEndOfCoverageRunIfError()
 {
     if (collectionStatus == MsCodeCoverageCollectionStatus.Error)
     {
         reportGeneratorUtil.EndOfCoverageRun();
     }
 }