public TestResultData GetTestCache(string id, [FromUri] TestSourceData testSourceData) { TestResult testResult; var buildSource = new BuildSource(testSourceData.MachineName, testSourceData.EnlistmentRoot); var isJenkins = string.IsNullOrEmpty(testSourceData.Source) ? null : (bool?)(testSourceData.Source == "jenkins"); if (_storage.TryGetValue(id, out testResult)) { var isJenkinsValue = isJenkins ?? false; _statsUtil.AddHit(isJenkinsValue); _statsUtil.AddUnitTestQuery(testResult.UnitTestData, testResult.Elapsed, isJenkinsValue); var testResultData = new TestResultData() { ExitCode = testResult.ExitCode, OutputStandard = testResult.OutputStandard, OutputError = testResult.OutputError, ResultsFileName = testResult.ResultsFileName, ResultsFileContent = testResult.ResultsFileContent, ElapsedSeconds = (int)testResult.Elapsed.TotalSeconds }; return testResultData; } _statsUtil.AddMiss(isJenkins ?? false); throw new HttpResponseException(HttpStatusCode.NotFound); }
public TestRunEntity(DateTime runDate, BuildSource buildSource) { PartitionKey = GetPartitionKey(runDate); RowKey = GetRowKey(RunDate, buildSource); MachineName = buildSource.MachineName; EnlistmentRoot = buildSource.EnlistmentRoot; RunDate = runDate; }
public EntityKey CreateEntityKey(DateTime runDate, BuildSource buildSource) { return new EntityKey( GetPartitionKey(runDate), GetRowKey(runDate, buildSource)); }
public static string GetRowKey(DateTime runDate, BuildSource buildSource) { var machineName = AzureUtil.NormalizeKey(buildSource.MachineName, '-'); return $"{machineName}-{(long)runDate.Ticks}"; }
public EntityKey CreateEntityKey(DateTime runDate, BuildSource buildSource) { return(new EntityKey( GetPartitionKey(runDate), GetRowKey(runDate, buildSource))); }
public static string GetRowKey(DateTime runDate, BuildSource buildSource) { var machineName = AzureUtil.NormalizeKey(buildSource.MachineName, '-'); return($"{machineName}-{(long)runDate.Ticks}"); }