Skip to content

Conversation

@nohwnd
Copy link
Member

@nohwnd nohwnd commented Jan 26, 2022

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.

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();
Copy link
Member Author

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.

public static void UpdateDiscoveryCriteria(this DiscoveryCriteria discoveryCriteria, ITestRuntimeProvider testRuntimeProvider)
{
var actualTestSources = testRuntimeProvider.GetTestSources(discoveryCriteria.Sources);
var actualTestSources = new[] { @"UITests.exe" }; // testRuntimeProvider.GetTestSources(discoveryCriteria.Sources);
Copy link
Member Author

@nohwnd nohwnd Jan 26, 2022

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.

adapterSourceMap.Add(Constants.UnspecifiedAdapterPath, sources);
}

private interface IRemoteSourceProvider
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore all this.

}

this.baseTestDiscoveryEventsHandler = eventHandler;
if (this.testHostManager.GetType().Name.Contains("Uwp"))
Copy link
Member Author

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)
{
Copy link
Member Author

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this class.

@MarcoRossignoli
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Pull request contains merge conflicts.

@nohwnd nohwnd closed this Feb 14, 2022
@nohwnd
Copy link
Member Author

nohwnd commented Feb 14, 2022

Replaced by #3314

@Haplois Haplois deleted the remote-uwp-execution branch September 7, 2022 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants