Skip to content

Commit

Permalink
Merge pull request #3525 from Microsoft/users/ranjanar/vstest++_dta
Browse files Browse the repository at this point in the history
VSTestPlusPlus with UI
  • Loading branch information
kaadhina authored Feb 7, 2017
2 parents ea1559f + 7787cf9 commit 544bc5e
Show file tree
Hide file tree
Showing 12 changed files with 497 additions and 1,392 deletions.
599 changes: 0 additions & 599 deletions Tasks/VsTest/Helpers.ps1

This file was deleted.

10 changes: 7 additions & 3 deletions Tasks/VsTest/Strings/resources.resjson/en-US/resources.resjson
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
"loc.messages.NoMatchingTestAssemblies": "No test assemblies found matching the pattern: %s.",
"loc.messages.VstestNotFound": "Vstest of version %d is not found. Try again with a visual studio version that exists on your build agent machine.",
"loc.messages.VstestFailed": "Vstest failed with error. Check logs for failures. There might be failed tests.",
"loc.messages.VstestTIANotSupported": "Install Visual Studio version 15.0.25807 or higher to run Test Impact Analysis.",
"loc.messages.VstestTIANotSupported": "Install Visual Studio 2015 update 3 or Visual Studio 2017 RC or above to run Test Impact Analysis.",
"loc.messages.NoResultsToPublish": "No results found to publish.",
"loc.messages.ErrorWhileReadingRunSettings": "Error occured while reading run settings file. Error : %s.",
"loc.messages.ErrorWhileReadingTestSettings": "Error occured while reading test settings file. Error : %s.",
"loc.messages.RunInParallelNotSupported": "Run in Parallel is not supported with testsettings file.",
"loc.messages.FailedToSetRunInParallel": "Failed to set run in parallel. Invalid run settings file.",
"loc.messages.FailedToSetRunConfiguration": "The specified settings file is invalid. Ignoring it.",
"loc.messages.UpdateOneOrHigherRequired": "Install Visual Studio 2015 Update 1 or higher on your build agent machine to run the tests in parallel.",
"loc.messages.ErrorOccuredWhileSettingRegistry": "Error occured while setting registry key, Error: %s.",
"loc.messages.ErrorWhileSettingTestImpactCollectorTestSettings": "Error occurred while setting Test Impact Collector in test settings file.",
Expand All @@ -76,5 +76,9 @@
"loc.messages.UnexpectedVersionString": "Unexpected version string detected for vstest.console.exe: %s.",
"loc.messages.UnexpectedVersionNumber": "Unexpected version number detected for vstest.console.exe: %s.",
"loc.messages.VstestDiagNotSupported": "vstest.console.exe version does not support the /diag flag. Enable diagnositics via the exe.config files",
"loc.messages.NoIncludePatternFound": "No include pattern found. Specify atleast one include pattern to search test assemblies."
"loc.messages.NoIncludePatternFound": "No include pattern found. Specify atleast one include pattern to search test assemblies.",
"loc.messages.ErrorWhileUpdatingSettings": "Error occurred while updating the settings file. Using the specified settings file.",
"loc.messages.VideoCollectorNotSupportedWithRunSettings": "Video collector is not supported with run settings.",
"loc.messages.runTestInIsolationNotSupported": "Running tests in isolation is not supported for multi-agent scenario.",
"loc.messages.tiaNotSupportedInDta": "Running only impacted tests is not supported for multi-agent scenario."
}
292 changes: 0 additions & 292 deletions Tasks/VsTest/VSTest.ps1

This file was deleted.

25 changes: 23 additions & 2 deletions Tasks/VsTest/distributedTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as ps from 'child_process';
import * as tl from 'vsts-task-lib/task';
import * as tr from 'vsts-task-lib/toolrunner';
import * as models from './models';
import * as settingsHelper from './settingsHelper';
import * as utils from './helpers';
import * as ta from './testAgent';

Expand Down Expand Up @@ -76,8 +77,17 @@ export class DistributedTest {
utils.Helper.addToProcessEnvVars(envVars, 'sourcefilter', '!**\obj\**');
}

//Modify settings file to enable configurations and data collectors.
var settingsFile = this.dtaTestConfig.settingsFile;
try {
settingsFile = await settingsHelper.updateSettingsFileAsRequired(this.dtaTestConfig.settingsFile, this.dtaTestConfig.runInParallel, this.dtaTestConfig.tiaConfig, null, false);
} catch (error) {
tl.warning(tl.loc('ErrorWhileUpdatingSettings'));
tl.debug(error);
}

utils.Helper.addToProcessEnvVars(envVars, 'testcasefilter', this.dtaTestConfig.testcaseFilter);
utils.Helper.addToProcessEnvVars(envVars, 'runsettings', this.dtaTestConfig.runSettingsFile);
utils.Helper.addToProcessEnvVars(envVars, 'runsettings', settingsFile);
utils.Helper.addToProcessEnvVars(envVars, 'testdroplocation', this.dtaTestConfig.testDropLocation);
utils.Helper.addToProcessEnvVars(envVars, 'testrunparams', this.dtaTestConfig.overrideTestrunParameters);
utils.Helper.setEnvironmentVariableToString(envVars, 'codecoverageenabled', this.dtaTestConfig.codeCoverageEnabled);
Expand All @@ -96,9 +106,20 @@ export class DistributedTest {
utils.Helper.setEnvironmentVariableToString(envVars, 'customslicingenabled', 'true');

await runDistributesTestTool.exec(<tr.IExecOptions>{ cwd: path.join(__dirname, 'modules'), env: envVars });
tl.debug('Run Distributed Test finished');
await this.cleanUp(settingsFile);
tl.debug('Run Distributed Test finished');
}

private async cleanUp(temporarySettingsFile: string) {
//cleanup the runsettings file
if (temporarySettingsFile && this.dtaTestConfig.settingsFile != temporarySettingsFile) {
try {
tl.rmRF(temporarySettingsFile, true);
} catch (error) {
//Ignore.
}
}
}
private dtaTestConfig: models.DtaTestConfigurations;
private dtaPid: number;
}
2 changes: 1 addition & 1 deletion Tasks/VsTest/make.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"externals": {
"archivePackages": [
{
"url": "https://testselector.blob.core.windows.net/testselector/3570841/TestSelector.zip",
"url": "https://testselector.blob.core.windows.net/testselector/3614206/TestSelector.zip",
"dest": "./"
},
{
Expand Down
Loading

0 comments on commit 544bc5e

Please sign in to comment.