Skip to content

Migrate to xunit.v3 #10890

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Migrate to xunit.v3 #10890

wants to merge 7 commits into from

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented May 28, 2025

TODO:

  • Add dotnet.config

@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage draft labels May 28, 2025
@Youssef1313
Copy link
Member Author

CI fails due to missing package in our feed. Started a mirror here

@Youssef1313
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Youssef1313
Copy link
Member Author

@Youssef1313
Copy link
Member Author

winforms moved now with dotnet/winforms#13540

@Youssef1313
Copy link
Member Author

=== COMMAND LINE === 
"D:\a\_work\1\s\artifacts\bin\System.Xaml.Tests\x64\Debug\net10.0\System.Xaml.Tests.exe"    --hangdump --hangdump-timeout 10min --crashdump --results-directory "D:\a\_work\1\s\artifacts\TestResults\Debug" --report-xunit --report-xunit-filename "System.Xaml.Tests_net10.0_x64.xml" --report-xunit-html --report-xunit-html-filename "System.Xaml.Tests_net10.0_x64.html" --report-trx --report-trx-filename "System.Xaml.Tests_net10.0_x64.trx" --auto-reporters off 
[createdump] Writing full dump for process 3616 to file D:\a\_work\1\s\artifacts\TestResults\Debug\System.Xaml.Tests_3616_crash.dmp
[createdump] Dump successfully written in 2905ms
[+0/x0/?0] System.Xaml.Tests.dll (net10.0|x64)(3s)

Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'typeName')
   at System.ArgumentNullException.Throw(String paramName)
   at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName)
   at System.ComponentModel.TypeConverterAttribute..ctor(String typeName)
   at System.Reflection.CustomAttribute.CreateCustomAttributeInstance(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
   at System.Attribute.GetCustomAttributes(MemberInfo element, Boolean inherit)
   at Xunit.Sdk.ReflectionExtensions.GetMatchingCustomAttributes(Type type, Type attributeType) in /_/src/xunit.v3.common/Extensions/ReflectionExtensions.cs:line 234
   at Xunit.v3.TestCollectionFactoryBase.Get(Type testClass) in /_/src/xunit.v3.core/Framework/TestCollectionFactoryBase.cs:line 37
   at Xunit.v3.XunitTestFrameworkDiscoverer.CreateTestClass(Type class) in /_/src/xunit.v3.core/Framework/XunitTestFrameworkDiscoverer.cs:line 58
   at Xunit.v3.TestFrameworkDiscoverer`1.<>c__DisplayClass10_0.<<Find>b__0>d.MoveNext() in /_/src/xunit.v3.core/Framework/TestFrameworkDiscoverer.cs:line 76
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__124_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
Test host process with PID '3616' crashed, a dump file was generated
Test application process didn't exit gracefully, exit code is '7'

cc @bradwilson

@bradwilson
Copy link

Hard to tell but this looks like a custom attribute might be throwing in a constructor somewhere...?

@bradwilson
Copy link

I'd be curious to know what happens if you try using 3.0.0-pre.25 because I just removed calls to GetCustomAttributes to help ignore attributes that are throwing in their constructors.

@Youssef1313
Copy link
Member Author

Youssef1313 commented Jun 18, 2025

Updating helped. There are other failures that I'm investigating now.

@bradwilson I'm curious whether you're planning to ship xunit.v3 3.x stable going to be released some time soon?

@bradwilson
Copy link

Right now, our release plan is to allow third parties chances to find issues with breaking changes, we will give them a month to review the changes.

The most recent build shipped 3 days ago. Assuming there are no further builds that need to be shipped to account for new breaking changes (and thus reset the clock), then a final release should be in the middle of July.

@Youssef1313
Copy link
Member Author

@bradwilson Thanks for clarifying!

@Youssef1313
Copy link
Member Author

Youssef1313 commented Jun 18, 2025

Note to self: This is currently blocked as current version of xunit.stafact isn't compatible with xunit.v3 3.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draft PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants