In my Azure pipeline:
- checkout: self
workspaceRepo: true
- task: MSBuild@1
...
-
- task: VSTest@3
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: '**\*Test*.dll'
searchFolder: '$(System.DefaultWorkingDirectory)'
vsTestVersion: '17.0'
I don't specify runSettingsFile property, which VSTest@3 sets to empty string by default. That property is resolved by VsTestV3/inputparser.ts using filePathSupplied from this library:
function filePathSupplied(name) {
// normalize paths
var pathValue = this.resolve(this.getPathInput(name) || '');
var repoRoot = this.resolve(exports.getVariable('build.sourcesDirectory') || exports.getVariable('system.defaultWorkingDirectory') || '');
var supplied = pathValue !== repoRoot;
exports.debug(name + 'path supplied :' + supplied);
return supplied;
}
Here are relevant environment variables:
build.sourcesDirectory=E:\Bld\A1\882\s
System.DefaultWorkingDirectory=E:\Bld\A1\882\s\my-repository
The code is checked out into $(System.DefaultWorkingDirectory). As the result, filePathSupplied returns true, which makes VSTest@3 step fail with Input validation failed with exception: Provided settings file E:\Bld\A1\882\s\my-repository, does not exist` error.
A workaround is to supply an obscure value in runSettingsFile:
- task: VSTest@3
inputs:
runSettingsFile: '$(Build.SourcesDirectory)'
In my Azure pipeline:
I don't specify
runSettingsFileproperty, whichVSTest@3sets to empty string by default. That property is resolved by VsTestV3/inputparser.ts usingfilePathSuppliedfrom this library:Here are relevant environment variables:
The code is checked out into
$(System.DefaultWorkingDirectory). As the result,filePathSuppliedreturnstrue, which makesVSTest@3step fail withInput validation failed with exception: Provided settings file E:\Bld\A1\882\s\my-repository, does not exist` error.A workaround is to supply an obscure value in
runSettingsFile: