Skip to content

Upgrade to TUnit 1.21.6 with async data sources and .NET 10#6

Open
thomhurst wants to merge 2 commits intoAutoFixture:masterfrom
thomhurst:feature/tunit-1.21-async-enumerable
Open

Upgrade to TUnit 1.21.6 with async data sources and .NET 10#6
thomhurst wants to merge 2 commits intoAutoFixture:masterfrom
thomhurst:feature/tunit-1.21-async-enumerable

Conversation

@thomhurst
Copy link
Copy Markdown
Contributor

Summary

  • Upgrade TUnit.Core from 0.16.56 to 1.21.6, adapting to breaking API changes
  • Async data source pipeline: IDataSource.GetData now returns IAsyncEnumerable<Func<Task<object?[]?>>> matching TUnit's new async contract — async all the way down, no sync-over-async bridges
  • New base class design: BaseDataSourceAttribute now extends Attribute directly and implements IDataSourceAttribute + IDataSource, replacing the removed NonTypedDataSourceGeneratorAttribute
  • Add .NET 10 target framework for both library and test projects
  • Add PolySharp for ModuleInitializerAttribute polyfill on netstandard2.0
  • Add ToAsyncDataSource() extension to consolidate the repeated sync→async wrapping pattern
  • Configure Microsoft.Testing.Platform runner in global.json for .NET 10 SDK compatibility
  • Update test project for TUnit 1.21.6 API changes (renamed types, moved namespaces, new assertion patterns)

Test plan

  • All 364 tests pass on net8.0
  • All 364 tests pass on net10.0
  • Library builds clean (0 errors, 0 warnings) on netstandard2.0, net8.0, and net10.0

- Upgrade TUnit.Core from 0.16.56 to 1.21.6
- Change IDataSource.GetData to return IAsyncEnumerable<Func<Task<object?[]?>>>
  matching TUnit's new async data source contract
- Implement IDataSourceAttribute directly on BaseDataSourceAttribute instead of
  extending the now-removed NonTypedDataSourceGeneratorAttribute
- Add net10.0 target framework for both library and tests
- Add PolySharp for netstandard2.0 polyfill support (ModuleInitializerAttribute)
- Add ToAsyncDataSource() extension to consolidate sync-to-async wrapping
- Configure global.json for .NET 10 SDK and Microsoft.Testing.Platform runner
- Update test project for TUnit 1.21.6 API changes (renamed types, namespaces)
- Update Microsoft.SourceLink.GitHub to 10.0.201 in Common.props
- Update Microsoft.Testing.Extensions.CodeCoverage to 18.5.2,
  Microsoft.Testing.Extensions.TrxReport to 2.1.0, and
  coverlet.collector to 8.0.1 in Common.Test.props
- Remove Microsoft.NET.Test.Sdk from Common.Test.props (incompatible
  with TUnit's Microsoft.Testing.Platform)
- Remove all PackageReference Update/Remove overrides from individual
  csproj files
@thomhurst
Copy link
Copy Markdown
Contributor Author

@aivascu When you get a chance please

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.

1 participant