Skip to content

Commit d922bdf

Browse files
committed
Merge remote-tracking branch 'origin/master' into Localization
2 parents d6bf496 + d5cf2a9 commit d922bdf

File tree

4 files changed

+75
-10
lines changed

4 files changed

+75
-10
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Global rule:
2-
* @microsoft/akvelon-build-task-team @microsoft/azure-pipelines-platform
2+
* @microsoft/azure-pipelines-tasks-and-agent @microsoft/azure-pipelines-platform

src/Agent.Worker/TestResults/TestDataPublisher.cs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,24 +153,31 @@ public void InitializePublisher(IExecutionContext context, string projectName, V
153153

154154
for (testRunDataIterator = 0; testRunDataIterator < testRunData.Count; testRunDataIterator++)
155155
{
156+
var testResultsUpdated = new List<TestCaseResultData>();
156157
for (testResultDataIterator = 0; testResultDataIterator < testRunData[testRunDataIterator].TestResults.Count; testResultDataIterator++)
157158
{
158159
var testResultFQN = testRunData[testRunDataIterator].TestResults[testResultDataIterator].AutomatedTestStorage +
159160
"." + testRunData[testRunDataIterator].TestResults[testResultDataIterator].AutomatedTestName;
160161

161162
if (testResultByFQN.TryGetValue(testResultFQN, out List<TestCaseResult> inputs))
162163
{
163-
testRunData[testRunDataIterator].TestResults[testResultDataIterator].TestPoint = inputs[0].TestPoint;
164-
testRunData[testRunDataIterator].TestResults[testResultDataIterator].TestCaseTitle = inputs[0].TestCaseTitle;
165-
testRunData[testRunDataIterator].TestResults[testResultDataIterator].Configuration = inputs[0].Configuration;
166-
testRunData[testRunDataIterator].TestResults[testResultDataIterator].TestCase = inputs[0].TestCase;
167-
testRunData[testRunDataIterator].TestResults[testResultDataIterator].Owner = inputs[0].Owner;
168-
testRunData[testRunDataIterator].TestResults[testResultDataIterator].State = "5";
169-
testRunData[testRunDataIterator].TestResults[testResultDataIterator].TestCaseRevision = inputs[0].TestCaseRevision;
170-
171-
testResultByFQN[testResultFQN].RemoveAt(0);
164+
foreach (var input in inputs)
165+
{
166+
var testCaseResultDataUpdated = TestResultUtils.CloneTestCaseResultData(testRunData[testRunDataIterator].TestResults[testResultDataIterator]);
167+
168+
testCaseResultDataUpdated.TestPoint = input.TestPoint;
169+
testCaseResultDataUpdated.TestCaseTitle = input.TestCaseTitle;
170+
testCaseResultDataUpdated.Configuration = input.Configuration;
171+
testCaseResultDataUpdated.TestCase = input.TestCase;
172+
testCaseResultDataUpdated.Owner = input.Owner;
173+
testCaseResultDataUpdated.State = "5";
174+
testCaseResultDataUpdated.TestCaseRevision = input.TestCaseRevision;
175+
176+
testResultsUpdated.Add(testCaseResultDataUpdated);
177+
}
172178
}
173179
}
180+
testRunData[testRunDataIterator].TestResults = testResultsUpdated;
174181
}
175182
}
176183

src/Agent.Worker/TestResults/Utils/TestResultUtils.cs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using System;
66
using Newtonsoft.Json;
77
using Newtonsoft.Json.Serialization;
8+
using Microsoft.TeamFoundation.TestClient.PublishTestResults;
9+
using System.Linq;
810

911
namespace Microsoft.VisualStudio.Services.Agent.Worker.TestResults.Utils
1012
{
@@ -32,6 +34,61 @@ public static void StoreTestRunSummaryInEnvVar(IExecutionContext executionContex
3234
}
3335
}
3436

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+
3592
private static string GetEvidenceStoreMetadata(IExecutionContext executionContext, TestRunSummary testRunSummary, string testRunner, string name, string description)
3693
{
3794
string evidenceStoreMetadataString = string.Empty;

src/Misc/layoutbin/en-US/strings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
" negotiate (Kerberos or NTLM)",
108108
" alt (Basic authentication)",
109109
" integrated (Windows default credentials)",
110+
" sp (Service Principal)",
110111
" --token <token> Used with --auth pat. Personal access token.",
111112
" --userName <userName> Used with --auth negotiate or --auth alt. Specify the Windows user",
112113
" name in the format: domain\\userName or [email protected]",

0 commit comments

Comments
 (0)