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

Adding TIA preview fields #2488

Merged
merged 2 commits into from
Sep 12, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"loc.description": "Run tests with Visual Studio test runner",
"loc.instanceNameFormat": "Test Assemblies $(testAssembly)",
"loc.group.displayName.executionOptions": "Execution Options",
"loc.group.displayName.tiaOptions": "Test Impact Analysis",
"loc.group.displayName.advancedExecutionOptions": "Advanced Execution Options",
"loc.group.displayName.reportingOptions": "Reporting Options",
"loc.input.label.testAssembly": "Test Assembly",
Expand All @@ -18,6 +19,10 @@
"loc.input.help.codeCoverageEnabled": "Collect code coverage information from the Test run.",
"loc.input.label.runInParallel": "Run In Parallel",
"loc.input.help.runInParallel": "Enable parallel execution of your tests.",
"loc.input.label.runOnlyImpactedTests": "Run Only Impacted Tests",
"loc.input.help.runOnlyImpactedTests": "Automatically select, and run only the tests needed to validate the code change.",
"loc.input.label.runAllTestsAfterXBuilds": "Number Of Builds After Which To Run All Tests:",
"loc.input.help.runAllTestsAfterXBuilds": "Number of builds after which to automatically run all tests. Test Impact Analysis stores the mapping between test cases and source code. It is recommended to regenerate the mapping by running all tests, on a regular basis.",
"loc.input.label.vstestLocationMethod": "VSTest",
"loc.input.label.vsTestVersion": "VSTest version",
"loc.input.help.vsTestVersion": "The version of VSTest to use.",
Expand Down
4 changes: 3 additions & 1 deletion Tasks/VsTest/VSTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ param(
[string]$publishRunAttachments,
[string]$runInParallel,
[string]$vstestLocationMethod,
[string]$vstestLocation
[string]$vstestLocation,
[string]$runOnlyImpactedTests,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets write warning

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

[string]$runAllTestsAfterXBuilds
)

Write-Verbose "Entering script VSTest.ps1"
Expand Down
26 changes: 25 additions & 1 deletion Tasks/VsTest/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 59
"Patch": 60
},
"demands": [
"vstest"
Expand All @@ -25,6 +25,12 @@
"displayName": "Execution Options",
"isExpanded": true
},
{
"name": "tiaOptions",
"displayName": "Test Impact Analysis",
"isExpanded": true,
"tags" : [ "Preview" ]
},
{
"name": "advancedExecutionOptions",
"displayName": "Advanced Execution Options",
Expand Down Expand Up @@ -91,6 +97,24 @@
"helpMarkDown": "Enable parallel execution of your tests.",
"groupName": "executionOptions"
},
{
"name": "runOnlyImpactedTests",
"type": "boolean",
"label": "Run Only Impacted Tests",
"defaultValue": "False",
"required": false,
"helpMarkDown": "Automatically select, and run only the tests needed to validate the code change.",
"groupName": "tiaOptions"
},
{
"name": "runAllTestsAfterXBuilds",
"type": "string",
"label": "Number Of Builds After Which To Run All Tests:",
"defaultValue": "",
"required": false,
"helpMarkDown": "Number of builds after which to automatically run all tests. Test Impact Analysis stores the mapping between test cases and source code. It is recommended to regenerate the mapping by running all tests, on a regular basis.",
"groupName": "tiaOptions"
},
{
"name": "vstestLocationMethod",
"type": "radio",
Expand Down
28 changes: 27 additions & 1 deletion Tasks/VsTest/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 59
"Patch": 60
},
"demands": [
"vstest"
Expand All @@ -25,6 +25,14 @@
"displayName": "ms-resource:loc.group.displayName.executionOptions",
"isExpanded": true
},
{
"name": "tiaOptions",
"displayName": "ms-resource:loc.group.displayName.tiaOptions",
"isExpanded": true,
"tags": [
"Preview"
]
},
{
"name": "advancedExecutionOptions",
"displayName": "ms-resource:loc.group.displayName.advancedExecutionOptions",
Expand Down Expand Up @@ -91,6 +99,24 @@
"helpMarkDown": "ms-resource:loc.input.help.runInParallel",
"groupName": "executionOptions"
},
{
"name": "runOnlyImpactedTests",
"type": "boolean",
"label": "ms-resource:loc.input.label.runOnlyImpactedTests",
"defaultValue": "False",
"required": false,
"helpMarkDown": "ms-resource:loc.input.help.runOnlyImpactedTests",
"groupName": "tiaOptions"
},
{
"name": "runAllTestsAfterXBuilds",
"type": "string",
"label": "ms-resource:loc.input.label.runAllTestsAfterXBuilds",
"defaultValue": "",
"required": false,
"helpMarkDown": "ms-resource:loc.input.help.runAllTestsAfterXBuilds",
"groupName": "tiaOptions"
},
{
"name": "vstestLocationMethod",
"type": "radio",
Expand Down
6 changes: 3 additions & 3 deletions Tasks/VsTest/vstest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ try {
var configuration: string = tl.getInput('configuration');
var publishRunAttachments: string = tl.getInput('publishRunAttachments');
var runInParallel: boolean = tl.getBoolInput('runInParallel');
var tiaEnabled = tl.getVariable('tia.enabled');
var tiaEnabled: boolean = tl.getBoolInput('runOnlyImpactedTests');
var fileLevel = tl.getVariable('tia.filelevel');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hope file level is default option

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

var tiaRebaseLimit = tl.getVariable('tia.rebaselimit');
var tiaRebaseLimit: string = tl.getInput('runAllTestsAfterXBuilds');
var sourcesDir = tl.getVariable('build.sourcesdirectory');


Expand Down Expand Up @@ -1088,7 +1088,7 @@ function isEmptyResponseFile(responseFile: string): boolean {
}

function isTiaAllowed(): boolean {
if (tiaEnabled && tiaEnabled.toUpperCase() == "TRUE" && getTestSelectorLocation()) {
if (tiaEnabled && getTestSelectorLocation()) {
return true;
}
return false;
Expand Down