-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 results directory UI option in vstest task #11789
Adding results directory UI option in vstest task #11789
Conversation
vagisha-nidhi
commented
Nov 18, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the suggested changes.
Tasks/VsTestV2/Strings/resources.resjson/en-US/resources.resjson
Outdated
Show resolved
Hide resolved
@@ -22,6 +22,8 @@ | |||
"loc.input.help.tcmTestRun": "Test run based selection is used when triggering automated test runs from the test hub. This option cannot be used for running tests in the CI/CD pipeline.", | |||
"loc.input.label.searchFolder": "Search folder", | |||
"loc.input.help.searchFolder": "Folder to search for the test assemblies.", | |||
"loc.input.label.resultsDirectory": "Test results directory", | |||
"loc.input.help.resultsDirectory": "Folder to store test results. The vstest task cleans up results directory before test run. $(Agent.TempDirectory) is cleaned after each pipeline run. In case the default value is overriden, the directory will not be automatically cleaned. When results directory is provided in both task and runsettings, the runsettings will be given priority.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When both are provided, task should win. Other inputs in the task typically override runsettings inputs, so this should be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this change in the dtaexecutionhost
Tasks/VsTestV2/Strings/resources.resjson/en-US/resources.resjson
Outdated
Show resolved
Hide resolved
Tasks/VsTestV2/Strings/resources.resjson/en-US/resources.resjson
Outdated
Show resolved
Hide resolved
Tasks/VsTestV2/inputparser.ts
Outdated
@@ -166,6 +166,14 @@ function getTestReportingSettings(inputDataContract : idc.InputDataContract) : i | |||
inputDataContract.TestReportingSettings.TestRunTitle = tl.getInput('testRunTitle'); | |||
inputDataContract.TestReportingSettings.TestRunSystem = 'VSTS - vstest'; | |||
|
|||
const resultsDir = path.resolve(tl.getVariable('System.DefaultWorkingDirectory'), tl.getInput('resultsFolder').trim()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
common.testresults
Tasks/VsTestV2/inputparser.ts
Outdated
{ | ||
inputDataContract.TestReportingSettings.TestResultsDirectory = resultsDir; | ||
tl.debug("TestResultsFolder: " + resultsDir); | ||
ci.publishEvent({ 'TestResultsFolderUi': resultsDir } ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temp or more than temp path
common.test or
defaultdir
push this property of the path as you can't directly push path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added. Is there a better way to add this?
…ha-nidhi/azure-pipelines-tasks into users/vanidhi/resultdDirUI
|
||
if (resultsDir.startsWith(tl.getVariable('Agent.TempDirectory') + 'TestResults')) | ||
{ | ||
ci.publishEvent({ 'TestResultsFolderUi': '$(Agent.TempDirectory)/TestResults' } ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, can you add a customer feature name for this?
Other this event will have the same feature name as all the others and filtering on kusto won't be easy.
inputDataContract.TestReportingSettings.TestResultsDirectory = resultsDir; | ||
tl.debug("TestResultsFolder: " + resultsDir); | ||
|
||
if (resultsDir.startsWith(tl.getVariable('Agent.TempDirectory') + 'TestResults')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you verify if this has a slash at the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to do path.join
} | ||
else if (resultsDir.startsWith(tl.getVariable('Agent.TempDirectory'))) | ||
{ | ||
ci.publishEvent({ 'TestResultsFolderUi': '$(Agent.TempDirectory)' } ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please keep an eye out for formatting, use tslint
if (resultsDir.startsWith(tl.getVariable('Agent.TempDirectory') + 'TestResults')) | ||
{ | ||
ci.publishEvent({ 'TestResultsFolderUi': '$(Agent.TempDirectory)/TestResults' } ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can move this to a private function
* Adding results directory UI option in vstest task * Addressing comments * Addressing PR comments * Updating test agent * Updating test agent version * Updating relative directory and adding telemetry * Update task.json * Update task.json * Updated help tect * Updating res.json