fixed reading test adapter paths from runsettings#455
fixed reading test adapter paths from runsettings#455codito merged 6 commits intomicrosoft:masterfrom
Conversation
|
Hi @rahulpaw, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
| { | ||
| var runConfiguration = XmlRunSettingsUtilities.GetRunConfigurationNode(runSettings); | ||
|
|
||
| IEnumerable<string> testAdaptersPaths = null; |
There was a problem hiding this comment.
Please return Enumerable.Empty instead. The consumer can directly do a foreach.
| IEnumerable<string> testAdaptersPaths = null; | ||
| if (runConfiguration != null) | ||
| { | ||
| if (!runConfiguration.TestAdaptersPathsSet) |
| foreach (string customTestAdaptersPath in customTestAdaptersPaths) | ||
| { | ||
| string adapterPath = string.Empty; | ||
| adapterPath = Path.GetFullPath(Environment.ExpandEnvironmentVariables(customTestAdaptersPath)); |
There was a problem hiding this comment.
Merge this and above line to var adapterPath
| string[] expectedResult = new string[] { @"C:\testadapterpath", @"D:\secondtestadapterpath" }; | ||
|
|
||
| string[] result = (string[])RunSettingsUtilities.GetTestAdaptersPaths(settingXml); | ||
| if (expectedResult.Length == result.Length) |
There was a problem hiding this comment.
Please use CollectionAssert methods to compare results.
| EqtTrace.Warning(string.Format("AdapterPath Not Found:", adapterPath)); | ||
| continue; | ||
| } | ||
| List<string> adapterFiles = new List<string>( |
There was a problem hiding this comment.
This logic is duplicated across many files. Should we consolidate?
|
@rahulpaw with this change, will the final testadapterpaths continue to be a union of
|
| } | ||
|
|
||
| UpdateTestAdapterPaths(testRunCriteria.TestRunSettings); | ||
|
|
There was a problem hiding this comment.
This caused issue in Tpv1, when in VS IDE scenario data collectors were enabled, & runsettings were used to provide adapter path, it resulted in DataCollection(fakes, CodeCoverage) not working.
The workaround we used was to not update them here, but instead like we process TestAdapterPath in CLI, similarly process it, & apply it on ITestPlatform when provided via runsettings
There was a problem hiding this comment.
I would like to take a deeper look at the datacollector scenarios. but right now TPv2 does not support DataCollectors.
Fix for Issue #236.
Reads the test adapter path from runsettings.
Testing:
Added UT, Enabled Acceptance test.
validated console and IDE scenario.
Ran Test.cmd