Skip to content
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

test: Update to MSTest dogfooding version #19271

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Youssef1313
Copy link
Member

GitHub Issue (If applicable): closes #

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@github-actions github-actions bot added area/code-generation Categorizes an issue or PR as relevant to code generation area/automation Categorizes an issue or PR as relevant to project automation labels Jan 18, 2025
Comment on lines 352 to 357
// TODO: !!IMPORTANT!! If this assert failed it will be currently **swallowed**.
// It's not going to fail the test nor crash the process.
// This is NOT a false positive of the analyzer.
#pragma warning disable MSTEST0040 // Do not assert inside 'async void' contexts
Assert.IsFalse(triggered);
#pragma warning restore MSTEST0040 // Do not assert inside 'async void' contexts
Copy link
Member Author

@Youssef1313 Youssef1313 Jan 18, 2025

Choose a reason for hiding this comment

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

FYI @jeromelaban

It's quite interesting for Uno's case because generally if this was a "typical" test app, it would have crashed the whole process. I assume it doesn't crash the process because of NativeDispatcher swallowing the exception (it's likely used via NativeDispatcherSynchronizationContext)? So currently such failure will only be logged.

cc @Evangelink Maybe we should reword the doc (and analyzer description) to mention that it may either be swallowed in certain cases, or crashes the whole process. Customers reading the doc may say "okay I'll suppress, it's fine if it crashed the process and then I'll know that it failed", but that's not always true.

@@ -120,7 +120,7 @@ async Task WaitAndSnapshotValue(int millisecondsDelay)
[TestMethod]
public async Task When_RepeatForever_ShouldLoop()
{
async void Do()
async Task Do()
Copy link
Member Author

Choose a reason for hiding this comment

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

Same here. This was a real problem as failures won't be captured.

Comment on lines +157 to +158
# MSTEST0006: Avoid '[ExpectedException]'
dotnet_diagnostic.MSTEST0006.severity = warning
Copy link
Member Author

@Youssef1313 Youssef1313 Jan 18, 2025

Choose a reason for hiding this comment

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

FYI microsoft/testfx#135 so you have context why we implemented the analyzer and why to enable it.

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19271/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19271/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19271/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19271/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19271/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19271/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19271/index.html

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19271/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 152560 has failed on Uno.UI - CI.

@Youssef1313 Youssef1313 marked this pull request as ready for review January 18, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/automation Categorizes an issue or PR as relevant to project automation area/code-generation Categorizes an issue or PR as relevant to code generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants