|
5 | 5 | using System; |
6 | 6 | using Newtonsoft.Json; |
7 | 7 | using Newtonsoft.Json.Serialization; |
| 8 | +using Microsoft.TeamFoundation.TestClient.PublishTestResults; |
| 9 | +using System.Linq; |
8 | 10 |
|
9 | 11 | namespace Microsoft.VisualStudio.Services.Agent.Worker.TestResults.Utils |
10 | 12 | { |
@@ -32,6 +34,61 @@ public static void StoreTestRunSummaryInEnvVar(IExecutionContext executionContex |
32 | 34 | } |
33 | 35 | } |
34 | 36 |
|
| 37 | + public static TestCaseResultData CloneTestCaseResultData(TestCaseResultData original) |
| 38 | + { |
| 39 | + return new TestCaseResultData |
| 40 | + { |
| 41 | + Id = original.Id, |
| 42 | + Comment = original.Comment, |
| 43 | + Configuration = original.Configuration, |
| 44 | + Project = original.Project, |
| 45 | + StartedDate = original.StartedDate, |
| 46 | + CompletedDate = original.CompletedDate, |
| 47 | + DurationInMs = original.DurationInMs, |
| 48 | + Outcome = original.Outcome, |
| 49 | + Revision = original.Revision, |
| 50 | + State = original.State, |
| 51 | + TestCase = original.TestCase, |
| 52 | + TestPoint = original.TestPoint, |
| 53 | + TestRun = original.TestRun, |
| 54 | + ResolutionStateId = original.ResolutionStateId, |
| 55 | + ResolutionState = original.ResolutionState, |
| 56 | + LastUpdatedDate = original.LastUpdatedDate, |
| 57 | + Priority = original.Priority, |
| 58 | + ComputerName = original.ComputerName, |
| 59 | + ResetCount = original.ResetCount, |
| 60 | + Build = original.Build, |
| 61 | + Release = original.Release, |
| 62 | + ErrorMessage = original.ErrorMessage, |
| 63 | + CreatedDate = original.CreatedDate, |
| 64 | + IterationDetails = original.IterationDetails?.ToList(), |
| 65 | + AssociatedBugs = original.AssociatedBugs?.ToList(), |
| 66 | + Url = original.Url, |
| 67 | + FailureType = original.FailureType, |
| 68 | + AutomatedTestName = original.AutomatedTestName, |
| 69 | + AutomatedTestStorage = original.AutomatedTestStorage, |
| 70 | + AutomatedTestType = original.AutomatedTestType, |
| 71 | + AutomatedTestTypeId = original.AutomatedTestTypeId, |
| 72 | + AutomatedTestId = original.AutomatedTestId, |
| 73 | + Area = original.Area, |
| 74 | + TestCaseTitle = original.TestCaseTitle, |
| 75 | + StackTrace = original.StackTrace, |
| 76 | + CustomFields = original.CustomFields?.ToList(), |
| 77 | + BuildReference = original.BuildReference, |
| 78 | + ReleaseReference = original.ReleaseReference, |
| 79 | + TestPlan = original.TestPlan, |
| 80 | + TestSuite = original.TestSuite, |
| 81 | + TestCaseReferenceId = original.TestCaseReferenceId, |
| 82 | + Owner = original.Owner, |
| 83 | + RunBy = original.RunBy, |
| 84 | + LastUpdatedBy = original.LastUpdatedBy, |
| 85 | + ResultGroupType = original.ResultGroupType, |
| 86 | + TestCaseRevision = original.TestCaseRevision, |
| 87 | + TestCaseSubResultData = original.TestCaseSubResultData?.ToList(), |
| 88 | + AttachmentData = original.AttachmentData |
| 89 | + }; |
| 90 | + } |
| 91 | + |
35 | 92 | private static string GetEvidenceStoreMetadata(IExecutionContext executionContext, TestRunSummary testRunSummary, string testRunner, string name, string description) |
36 | 93 | { |
37 | 94 | string evidenceStoreMetadataString = string.Empty; |
|
0 commit comments