Beispiel #1
0
        public void PutTestCache(string id, [FromBody] TestCacheData testCacheData)
        {
            var testResultData = testCacheData.TestResultData;
            var seconds        = testResultData.ElapsedSeconds;
            var testResult     = new TestResult(
                testResultData.ExitCode,
                testResultData.OutputStandard,
                testResultData.OutputError,
                testResultData.ResultsFileName,
                testResultData.ResultsFileContent,
                new UnitTestData(
                    passed: testResultData.TestPassed,
                    failed: testResultData.TestFailed,
                    skipped: testResultData.TestSkipped),
                TimeSpan.FromSeconds(seconds));
            var buildSource = testCacheData.TestSourceData != null
                ? new BuildSource(testCacheData.TestSourceData.MachineName, testCacheData.TestSourceData.EnlistmentRoot)
                : (BuildSource?)null;
            var isJenkins = testCacheData.TestSourceData?.IsJenkins ?? false;

            _storage.Add(id, testResult);
            _statsUtil.AddStore(isJenkins);
        }