-
Notifications
You must be signed in to change notification settings - Fork 319
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
Hardcode fixes for uwp #3280
Hardcode fixes for uwp #3280
Conversation
|
||
// If the actual testSources, & input test sources do differ it means that the User(IDE) actually sent a package. | ||
// We are limiting that only one package can be sent per session, so picking the first entry in sources | ||
if (discoveryCriteria.Sources.Except(actualTestSources).Any()) | ||
{ | ||
discoveryCriteria.Package = discoveryCriteria.Sources.FirstOrDefault(); | ||
discoveryCriteria.Package = @"C:\ProgramData\DeveloperTools\WinUI-Samples-UITestsVS.Debug_x64.jajares\UITests.build.appxrecipe"; // discoveryCriteria.Sources.FirstOrDefault(); |
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.
Here the provider provides the local path: "C:\\p\\WinUI-Samples\\x64\\Debug\\UITests\\UITests.build.appxrecipe";
and we send it to the other side in DiscoveryRequest. The recipe path is used to lookup UITests.exe and it cannot find it. So no tests are discovered. If we pass this path (the appxrecipe actuall does not exist on the remote) it allows UITest.exe path to be determined correctly. All tests are discovered but TestWindow can't understand them because they come from an unknown source.
@@ -13,13 +13,13 @@ internal static class DiscoveryCriteriaExtensions | |||
{ | |||
public static void UpdateDiscoveryCriteria(this DiscoveryCriteria discoveryCriteria, ITestRuntimeProvider testRuntimeProvider) | |||
{ | |||
var actualTestSources = testRuntimeProvider.GetTestSources(discoveryCriteria.Sources); | |||
var actualTestSources = new[] { @"UITests.exe" }; // testRuntimeProvider.GetTestSources(discoveryCriteria.Sources); |
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.
We get UITests.exe here from the real provider as well.
@@ -37,5 +37,22 @@ private static void UpdateTestSources(IEnumerable<string> sources, Dictionary<st | |||
adapterSourceMap.Clear(); | |||
adapterSourceMap.Add(Constants.UnspecifiedAdapterPath, sources); | |||
} | |||
|
|||
private interface IRemoteSourceProvider |
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.
Ignore all this.
this.testHostManager = this.proxyOperationManager.TestHostManager; | ||
this.requestData = this.proxyOperationManager.RequestData; | ||
} | ||
|
||
this.baseTestDiscoveryEventsHandler = eventHandler; | ||
if (this.testHostManager.GetType().Name.Contains("Uwp")) |
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.
Ignore all this, it just allows me to special case this for uwp, and change the responses.
} | ||
|
||
public void HandleDiscoveredTests(IEnumerable<TestCase> discoveredTestCases) | ||
{ |
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.
Here we get Source that is the actual remote path, and we need to translate it back to the appxrecipe we got originally. So TestWindow can match it back to the correct source.
} | ||
} | ||
|
||
private class ReflectionBasedRemoteTestHostManagerAdapter : ITestRuntimeProvider |
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.
Ignore this class.
/azp run |
Pull request contains merge conflicts. |
Replaced by #3314 |
Description
Please add a meaningful description for this change.
Ensure the PR has required unit tests.
Related issue
Kindly link any related issues. E.g. Fixes #xyz.