Skip to content

Hardcode fixes for uwp - #3280

Closed
Jakub Jareš (nohwnd) wants to merge 1 commit into
mainfrom
remote-uwp-execution
Closed

Jakub Jareš (nohwnd) wants to merge 1 commit into
mainfrom
remote-uwp-execution

Conversation

@nohwnd

Copy link
Copy Markdown
Member

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
Copy Markdown
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);

@nohwnd Jakub Jareš (nohwnd) Jan 26, 2022 •

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Pull request contains merge conflicts.

@nohwnd

Copy link
Copy Markdown
Member Author

Replaced by #3314

@Haplois
Medeni Baykal (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.

2 participants