Repository navigation
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Running all tests from an IDE (Rider on macOS, sv-SE locale) failed 26 tests that pass in CI. Investigating
them turned up several environment dependencies in the tests, two product bugs, and gaps in what CI runs.
Tests that depended on how or where they were launched
AppDomain.CurrentDomain.GetAssemblies(), i.e.whatever the process had loaded so far. IDE /
dotnet testserver-mode hosts load more than a plain run, soHttpStatusCoderesolved in one mode and not the other, and the committed .NET snapshots captured theunresolved output. A shared
TestHostReferenceshelper now usesTRUSTED_PLATFORM_ASSEMBLIESon .NET(unchanged on .NET Framework), and the snapshots are corrected. The paths are sorted, since the TPA order differs
between Linux and macOS and generators emit referenced assemblies in reference order (this reordered
DuplicateTypeNameAcrossAssembliesTests' snapshot on macOS)./_/source paths. A local checkout path longer than80 characters is wrapped by the API generator into
"..." +continuation lines, leaving a fragment behind(
OpenTelemetry_Library_Has_No_API_Changesfailed on macOS). Whole path literals, including continuations,are now scrubbed.
TUnit.Engine.TestslaunchedTUnit.TestProject, its F#/VB siblings andHtmlReportDefaultsfrom hard-codedbin/Releasefolders, so a Debug run from an IDE failed or ran stale binaries. They are now build-only projectreferences located by the test assembly's own configuration (CI unchanged).
dotnet build/dotnet runused whateverdotnetis first onPATH(exit 155,SdkResolveFailure, when that installation lacks theglobal.jsonSDK). A sharedDotNetClihelper prefersDOTNET_HOST_PATH, then the running installation; RpcTests now report the build output on failure.de-DE, tr-TR, ar-SA).
Product bugs found along the way
[AssertionFrom]assertions with a custom message reportedExpected be null or empty(double space, no"to"); the generator now emits
to {not }.... Snapshots updated, regression test added.ITestStartEventReceiver.OnTestStart),which cannot be made private; such methods are now skipped.
TUnit.Aspireprinted exit codes such as-532462766with U+2212 under some cultures; exit codes are nowformatted invariantly.
Test project and CI consistency
TUnit.SourceGenerator.IncrementalTestswas an xUnit v2/VSTest project thatdotnet testrefused under theMTP-only
global.json(aborting solution-wide runs) and that CI never ran; it is migrated to TUnit and gets apipeline module.
TUnit.Assertions.SourceGenerator.Testshad no pipeline module; added. Test modules now run every frameworka project targets (most ran net10.0 only; analyzer modules a single fixed TFM).
ArgumentFormatter's only tests lived in a directory without a project file and never compiled; ported toTUnit.UnitTests. Dead/stray test files removed; tests disabled for APIs that now exist are revived.TUnit.OpenTelemetry.TestsandTUnit.Aspire.Testsnow use the sharedeng/TestProject.props/.targets(they lacked the assertion analyzers). Unused xUnit references removed. The fast test projects are added to
TUnit.Dev.slnx.Related Issue
N/A
Type of Change
Checklist
Required
TUnit-Specific Requirements
TUnit.Core.SourceGenerator.Testsand/orTUnit.PublicAPItests.received.txtfiles and accepted them as.verified.txt.verified.txtfilesTesting
dotnet test)Additional Notes
dotnet test(server mode) and as plain executables, plus the changed pipeline modules' exact Release commands.
with
-p:PathMapto the macOS checkout path) before fixing. The PublicAPI tests pass with local, CI(
/_/), long macOS and long Windows-style source paths.TUnit.Dev.slnxin Rider (Debug): 6004 tests with nofailures except the 7
TUnit.RpcTestsnet8.0 variants, which exit with 150 (FrameworkMissingFailure)because that machine's dotnet has no .NET 8 runtime; their net10.0 variants pass.
Net4_7snapshots received the same mechanical one-linesubstitution as the regenerated .NET ones, and the new assertions-generator module includes net472 on
Windows, so Windows CI is their first real check.
culture). Found while making the culture-sensitive tests above culture-independent.
Summary by CodeRabbit
Bug Fixes
Documentation
Tests