Skip to content

Conversation

guimafelipe
Copy link
Contributor

@guimafelipe guimafelipe commented Sep 2, 2025

This PR enables App notification tests.

The changes on this PR include:

  • Removing the scope :Class from the RunAs property for the unpackaged tests. This scope prevents the inheritance of the property value by the methods, making the methods being executed in the same scope as the main test, which is System. App notifications needs to be run in a non elevated process, which requires integrity level of medium or lower. For that reason, the previous configuration was breaking the tests, so now the test methods are run in RestrictedUser scope alongside the class methods, making everything run in the same process.
  • Adding the .testdef file and copying it as other tests.
  • Adding code to skip the tests in older Win10 versions.
  • Rewriting the bootstrap initialization code.

A microsoft employee must use /azp run to validate using the pipelines below.

WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.

For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.

@lauren-ciha
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

"Description": "App Notification Tests Packaged",
"Filename": "AppNotificationTests.dll",
"Parameters": "/name:PackagedTests*",
"Architectures": ["x64", "x86"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these tests not configured to run for ARM64? Just checking if there's a gap in coverage or if it's intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the tests are currently not being built for arm64.


if (status == winrt::Windows::Foundation::AsyncStatus::Error)
{
VERIFY_THROWS_HR(removeNotificationAsync.GetResults(), E_INVALIDARG);
Copy link
Contributor

Choose a reason for hiding this comment

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

Has there been any investigation into why x86 is exhibiting different behavior or returning an error compared to x64? Catching the error and rethrowing only on INVALID_ARG might inadvertently mask other underlying issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know why, but this was happening in two x86 machines in a consistent manner. We can also disable this test if that is desired.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep the current workaround in place to ensure we have a basic test case running. However, we should also create a work item to track investigation for x86 support and add a TODO comment to remove this workaround once resolved. As part of this work item, let's also include looking into building tests for arm64 to ensure broader coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants