Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending PR branch name from build variables in VsTestTask #9659

Merged
merged 3 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Tasks/VsTestV2/inputdatacontract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface TestReportingSettings {
TestRunTitle : string;
TestResultsDirectory : string;
TestRunSystem : string;
TestSourceSettings : TestSourceSettings;
}

export interface TestSelectionSettings {
Expand Down Expand Up @@ -102,6 +103,10 @@ export interface ExecutionSettings {
DiagnosticsSettings : DiagnosticsSettings;
}

export interface TestSourceSettings {
PullRequestTargetBranchName : string;
}

export interface DiagnosticsSettings {
Enabled : boolean;
DumpCollectionType : string;
Expand Down
4 changes: 4 additions & 0 deletions Tasks/VsTestV2/inputparser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ function getTfsSpecificSettings(inputDataContract : idc.InputDataContract) : idc
inputDataContract.TfsSpecificSettings.ReleaseUri = tl.getVariable('Release.ReleaseUri');
inputDataContract.TfsSpecificSettings.ReleaseEnvironmentUri = tl.getVariable('Release.EnvironmentUri');
inputDataContract.TfsSpecificSettings.WorkFolder = tl.getVariable('System.DefaultWorkingDirectory');

return inputDataContract;
}

Expand All @@ -159,6 +160,9 @@ function getTestReportingSettings(inputDataContract : idc.InputDataContract) : i
inputDataContract.TestReportingSettings.TestRunTitle = tl.getInput('testRunTitle');
inputDataContract.TestReportingSettings.TestRunSystem = 'VSTS - vstest';

inputDataContract.TestReportingSettings.TestSourceSettings = <idc.TestSourceSettings>{};
inputDataContract.TestReportingSettings.TestSourceSettings.PullRequestTargetBranchName = tl.getVariable('System.PullRequest.TargetBranch');

if (utils.Helper.isNullEmptyOrUndefined(inputDataContract.TestReportingSettings.TestRunTitle)) {

let definitionName = tl.getVariable('BUILD_DEFINITIONNAME');
Expand Down