-
Notifications
You must be signed in to change notification settings - Fork 849
Orphan test recovery #19275
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
T-Gro
wants to merge
24
commits into
main
Choose a base branch
from
orphan-test-recovery
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Orphan test recovery #19275
+472
−1,513
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The repo 'demystifyfp/FsToolkit.ErrorHandling' contains a period which is not allowed in Azure DevOps job identifiers (alphanumeric + underscore only). This caused YAML validation failure preventing the entire pipeline from starting. Add an additional replace() call for '.' -> '_'.
Three fixes: 1. Checkout step: split buildScript to check only the file name (first token), not the entire string including arguments 2. Build step: use 'cmd /c' on Windows for file-based scripts to handle arguments naturally; on Linux, chmod only the script file 3. OpenTK: use single project in dotnet build (MSB1008 error with multiple projects)
…mands 1. Add .NET 9.0.x SDK installation - IcedTasks' FAKE build project targets net9.0 and fails without the runtime 2. Switch IcedTasks and FsToolkit from FAKE build.cmd to direct dotnet build/test - FAKE's build.exe locks itself causing MSB3027 file lock errors and cascading FS0229 metadata read failures 3. Keep .NET 9.0 SDK for repos that may need it
IcedTasks' Directory.Build.targets runs 'dotnet tool restore' during build. When MSBuild builds projects in parallel, concurrent tool restores fight over NuGet package files causing file lock errors. Pre-restoring tools eliminates the race condition.
…plicate type name conflict Instance extension members compile with the extended type as the first IL parameter, so they can never produce duplicate IL method signatures even when the simple type name matches. Only static extension members lack this distinguishing parameter. This fixes a regression where libraries like IcedTasks that define instance (inline) extension members on builder types from different namespaces (e.g. Microsoft.FSharp.Control.TaskBuilderBase and IcedTasks.TaskBase.TaskBuilderBase) were incorrectly rejected. Regression introduced by PR #18821 (commit e948a68).
The regression test template now supports multiple commands in a single matrix entry using ';;' as a separator. Commands run sequentially and the job fails on the first non-zero exit code. Example: buildScript: dotnet build A.fsproj ;; dotnet build B.fsproj Reverts OpenTK back to a single matrix entry with both test projects.
…Nullness disabled When langFeatureNullness is false, p_ty2 conditionally skipped writing nullness B-bytes for type tags 1-4, but u_ty unconditionally reads them. This caused B-stream misalignment when constraint data (e.g. NotSupportsNull from BCL types) was also written to B-stream, leading to FS0229 errors when consuming metadata. Fix: Always write a B-byte (0 = AmbivalentToNull) for each type tag, regardless of langFeatureNullness. This keeps streams aligned. Also adds ImportTests.fs to the test project (was missing since migration) and adds two regression tests for the B-stream misalignment scenario.
…stance members The duplicate extension member check (FS3356) only applies to static extension members because they lack the extended type as a first IL parameter, causing signature collisions. Instance extension members are safe because the extended type differentiates the IL signatures. Updated the existing tests to use static members (the actual IL collision case) and added companion tests showing instance members on same-named types are allowed.
Contributor
✅ No release notes required |
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.
Recover orphaned test files
A repo-wide scan found test files (containing
[<Fact>],[<Theory>], etc.) that exist on disk but are not included in any.fsproj, meaning they are never compiled or run.This PR adds them to the build, fixes issues that prevented inclusion, and cleans up dead duplicates.
Summary
.fsprojFSharp.Compiler.ComponentTests, 1 inFSharp.Core.UnitTestsFactForWINDOWSAttribute,ProcessResult/runFsiProcess/runFscProcess,TypeForwardingHelpersInfrastructure created
FactForWINDOWSAttributeintests/FSharp.Test.Utilities/Utilities.fs— conditional attribute for Windows-only CLI testsProcessResult+runFsiProcess+runFscProcessintests/FSharp.Test.Utilities/Compiler.fs— minimal subprocess helpers for tests that genuinely need CLI behavior (help flags, missing source file errors, unrecognized options that cause exit before session creation)TypeForwardingHelpersmodule intests/FSharp.Compiler.ComponentTests/Conformance/TypeForwarding/TypeForwardingHelpers.fs— compiles C# original → F# exe → C# target → C# forwarder → swaps DLLs → runs via reflectionFiles added to
.fsprojWave 1: CompilerOptions (19 files)
CompilerOptions\Fsc\FscCliTests.fs— 5 CLI subprocess tests (FS0225 missing source file)CompilerOptions\Fsc\Removed.fsCompilerOptions\Fsc\responsefile\responsefile.fsCompilerOptions\Fsc\standalone\standalone.fsCompilerOptions\Fsc\dumpAllCommandLineOptions\dumpAllCommandLineOptions.fsCompilerOptions\Fsc\gccerrors\gccerrors.fsCompilerOptions\Fsc\nologo\nologo.fsCompilerOptions\Fsc\staticlink\staticlink.fsCompilerOptions\Fsc\subsystemversion\Subsystemversion.fsCompilerOptions\Fsc\target\target.fsCompilerOptions\Fsc\tokenize\tokenize.fsCompilerOptions\Fsc\lib\lib.fsCompilerOptions\Fsc\Optimize.fsCompilerOptions\Fsc\out\out.fsCompilerOptions\Fsc\pdb\Pdb.fsCompilerOptions\Fsc\tailcalls\tailcalls.fsCompilerOptions\fsi\FsiCliTests.fs— 7 CLI subprocess tests (FS0243 unrecognized option, help flags)CompilerOptions\fsi\Nologo.fsCompilerOptions\fsi\Langversion.fsWave 2: Conformance Expressions & Lexical (23 files)
Conformance\Expressions\ApplicationExpressions\Assertion\Assertion.fsConformance\Expressions\ApplicationExpressions\ObjectConstruction\ObjectConstruction.fsConformance\Expressions\ConstantExpressions\ConstantExpressions.fsConformance\Expressions\ControlFlowExpressions\SimpleFor\SimpleFor.fsConformance\Expressions\ControlFlowExpressions\TryFinally\TryFinally.fsConformance\Expressions\ControlFlowExpressions\TryWith\TryWith.fsConformance\Expressions\DataExpressions\AddressOf\AddressOf.fsConformance\Expressions\DataExpressions\ComputationExpressions\ComputationExpressions.fsConformance\Expressions\DataExpressions\ObjectExpressions\ObjectExpressions.fsConformance\Expressions\DataExpressions\QueryExpressions.fsConformance\Expressions\DataExpressions\RangeExpressions\RangeExpressions.fsConformance\Expressions\DataExpressions\SequenceExpressions\SequenceExpressions.fsConformance\Expressions\DataExpressions\Simple\Simple.fsConformance\Expressions\DataExpressions\TupleExpressions\TupleExpressions.fsConformance\Expressions\EvaluationOfElaboratedForms\EvaluationOfElaboratedForms.fsConformance\Expressions\ExpressionQuotations\Baselines.fsConformance\Expressions\ExpressionQuotations\Regressions.fsConformance\Expressions\SyntacticSugar\SyntacticSugar.fsConformance\Expressions\SyntacticSugarAndAmbiguities\SyntacticSugarAndAmbiguities.fsConformance\LexicalAnalysis\Directives.fsConformance\LexicalAnalysis\StringsAndCharacters.fsConformance\LexicalFiltering\Basic\Basic.fsConformance\LexicalFiltering\LexicalAnalysisOfTypeApplications\LexicalAnalysisOfTypeApplications.fsWave 3: Conformance InferenceProcedures (12 files)
Conformance\InferenceProcedures\ConstraintSolving\ConstraintSolving.fsConformance\InferenceProcedures\DispatchSlotChecking\DispatchSlotChecking.fsConformance\InferenceProcedures\DispatchSlotInference\DispatchSlotInference.fsConformance\InferenceProcedures\FunctionApplicationResolution\FunctionApplicationResolution.fsConformance\InferenceProcedures\Generalization\Generalization.fsConformance\InferenceProcedures\MethodApplicationResolution\MethodApplicationResolution.fsConformance\InferenceProcedures\NameResolution\AutoOpen\AutoOpen.fsConformance\InferenceProcedures\NameResolution\Misc\NameResolutionMisc.fsConformance\InferenceProcedures\NameResolution\RequireQualifiedAccess\RequireQualifiedAccess.fsConformance\InferenceProcedures\ResolvingApplicationExpressions\ResolvingApplicationExpressions.fsConformance\InferenceProcedures\TypeInference\TypeInference.fsConformance\InferenceProcedures\WellFormednessChecking\WellFormednessChecking.fsWave 4: Conformance OO Types (17 files)
Conformance\ObjectOrientedTypeDefinitions\AbstractMembers\AbstractMembers.fsConformance\ObjectOrientedTypeDefinitions\ClassTypes\AsDeclarations\AsDeclarations.fsConformance\ObjectOrientedTypeDefinitions\ClassTypes\AutoProperties\AutoProperties.fsConformance\ObjectOrientedTypeDefinitions\ClassTypes\ImplicitObjectConstructors\ImplicitObjectConstructors.fsConformance\ObjectOrientedTypeDefinitions\ClassTypes\InheritsDeclarations\InheritsDeclarations.fsConformance\ObjectOrientedTypeDefinitions\ClassTypes\MemberDeclarations\MemberDeclarations.fsConformance\ObjectOrientedTypeDefinitions\ClassTypes\Misc\Misc.fsConformance\ObjectOrientedTypeDefinitions\ClassTypes\StaticLetDoDeclarations\StaticLetDoDeclarations.fsConformance\ObjectOrientedTypeDefinitions\ClassTypes\ValueRestriction\ValueRestriction.fsConformance\ObjectOrientedTypeDefinitions\DelegateTypes\DelegateTypes.fsConformance\ObjectOrientedTypeDefinitions\EnumTypes\EnumTypes.fsConformance\ObjectOrientedTypeDefinitions\InterfaceTypes\InterfaceTypes.fsConformance\ObjectOrientedTypeDefinitions\StructTypes\StructTypes.fsConformance\ObjectOrientedTypeDefinitions\TypeExtensions\basic\Basic.fsConformance\ObjectOrientedTypeDefinitions\TypeExtensions\intrinsic\Intrinsic.fsConformance\ObjectOrientedTypeDefinitions\TypeExtensions\optional\Optional.fsConformance\ObjectOrientedTypeDefinitions\TypeKindInference\TypeKindInference.fsWave 5: Conformance Remaining + TypeForwarding (20 files)
Conformance\DeclarationElements\PInvokeDeclarations.fsConformance\GeneratedEqualityHashingComparison\Attributes\New\Attributes_New.fsConformance\ImplementationFilesAndSignatureFiles\CheckingOfImplementationFiles.fsConformance\ImplementationFilesAndSignatureFiles\NamespacesFragmentsAndImplementationFiles.fsConformance\ImplementationFilesAndSignatureFiles\SignatureFiles.fsConformance\Signatures\Signatures.fsConformance\SpecialAttributesAndTypes\CallerInfo.fsConformance\SpecialAttributesAndTypes\ThreadStatic.fsConformance\Stress\StressTests.fsConformance\TypeForwarding\TypeForwardingTests.fsConformance\TypesAndTypeConstraints\TypesAndTypeConstraints.fsConformance\TypeForwarding\TypeForwardingHelpers.fs(new infrastructure)Conformance\TypeForwarding\TypeForwardingHelpersTests.fsConformance\TypeForwarding\NegativeCases.fsConformance\TypeForwarding\StructTests.fsConformance\TypeForwarding\ClassTests.fsConformance\TypeForwarding\DelegateTests.fsConformance\TypeForwarding\InterfaceTests.fsConformance\TypeForwarding\CycleTests.fsConformance\TypeForwarding\NestedTests.fsWave 6: Remaining orphans (20 files)
Found during exhaustive re-sweep (grep for
[<Fact>]/[<Theory>]in all.fsnot in any.fsproj).InteractiveSession\Misc.fs— 116+ testsCompilerOptions\Fsc\Platform.fsEmittedIL\RealInternalSignature\ClassTypeVisibility.fsEmittedIL\RealInternalSignature\RealInternalSignature.fsConformance\LexicalAnalysis\Whitespace.fs— 1 testConformance\LexicalAnalysis\ShiftGenerics.fs— 1 testConformance\LexicalAnalysis\LineDirectives.fs— 2 testsConformance\LexicalAnalysis\IdentifiersAndKeywords.fs— 15 testsConformance\LexicalAnalysis\IdentifierReplacements.fs— 3 testsConformance\LexicalAnalysis\ConditionalCompilation.fs— 13 testsConformance\DeclarationElements\ObjectConstructors.fs— 16 testsConformance\MultiTargeting.fs— 3 tests (FactForDESKTOP)Diagnostics\ParsingAtEOF.fs— 11 testsDiagnostics\NONTERM.fs— 36 testsMisc.fs(root) — 2 unique inline IL tests (Array.Empty, DU cctor renaming)EmittedIL\StringEncoding\StringEncoding.fs— 4 testsCompilerOptions\CliProcessTests.fs— 7 tests (FSC/FSI help, version, invalid options)Miscellaneous\MigratedMisc.fs— 13 testsLibraries\NativeInterop.fs— 1 testFSharp.Core\Microsoft.FSharp.Linq\NullableOperators.fs(in FSharp.Core.UnitTests.fsproj)Fixes applied to enable inclusion
CompilerOptions\Fsc\Platform.fsmodule Platformconflicted with existingPlatform.fsin same namespacePlatformErrorsEmittedIL\RealInternalSignature\ClassTypeVisibility.fsmodule ClassTypeVisibilityModuleRootconflicted with existing fileClassTypeVisibilityEmittedIL\RealInternalSignature\RealInternalSignature.fsnamespace EmittedIL+module RealInternalSignatureconflicted; also had broken|> asLibrary |> compile |> compileExeAndRunpipeline (compileExeAndRuntakesCompilationUnit, notCompilationResult)EmittedIL.RealInternalSignature, renamed module toRealInternalSignatureTests, removed redundant|> asLibrary |> compilebeforecompileExeAndRun(2 instances)InteractiveSession\Misc.fswithFsiArgswhich doesn't exist in the test frameworkCompilerAssert.RunScriptWithOptionsAndReturnResultat lines 2052-2111 were already presentConformance\MultiTargeting.fswithRawOptionswhich doesn't exist in the test frameworkwithOptionsFSharp.Core\Microsoft.FSharp.Linq\NullableOperators.fs[<TestFixture>],Assert.AreEqual) in an xUnit project[<TestFixture>],Assert.AreEqual→Assert.Equal, addedopen SystemDuplicate cleanup (9 files deleted)
During the sweep, 9
.fsfiles were found that contained[<Fact>]/[<Theory>]attributes but were not in any.fsprojand could not be meaningfully revived. Each was independently assessed by 3 models (Claude Opus 4.6, Gemini 3 Pro, GPT-5.2 Codex) — unanimous verdict: delete.All 9 files were never compiled, never executed by any test runner, and had been dead since the Goodbye Perl migration.
Exact duplicates (4 files)
Root-level copies whose tests are already present in the canonical EmittedIL subdirectory files:
.fsproj)TupleElimination.fs(root, 5 tests)EmittedIL\TupleElimination.fs(5 tests)Literals.fs(root, 1 test)EmittedIL\Literals.fs(13 tests)TailCalls.fs(root, 5 tests)EmittedIL\TailCalls.fs(8 tests)StringFormatAndInterpolation.fs(root, 1 test)EmittedIL\StringFormatAndInterpolation.fs(4 tests)Broken duplicates (5 files)
Files that reference non-existent directories or test data, AND whose tests are already covered by working canonical versions:
Operators.fs(root)Directory(__SOURCE_DIRECTORY__ + "/../resources/tests/CodeGen/operators")— that directory does not existEmittedIL\operators\Operators.fsFileInlineData("decimal_comparison.fs")which existsAttributeUsage.fs(root, 23 tests)Directory(__SOURCE_DIRECTORY__, ...)at root, but the referenced source files (e.g.AssemblyVersion01.fs,E_WithBitwiseAnd01.fsx) are not at rootConformance\BasicGrammarElements\CustomAttributes\AttributeUsage\AttributeUsage.fs(86 tests)E_WithBitwiseAnd01.fsx) references a file that does not exist anywhere in the repo — it was DOAOnOverridesAndIFaceImpl.fs(root, 6 tests)Directory(__SOURCE_DIRECTORY__, ...)at root, butE_InterfaceImpl01.fsetc. are atConformance/BasicGrammarElements/AccessibilityAnnotations/OnOverridesAndIFaceImpl/Conformance\BasicGrammarElements\AccessibilityAnnotations\OnOverridesAndIFaceImpl\OnOverridesAndIFaceImpl.fs(6 tests).fsvs_fssuffix)EmittedIL\Structure\StructFieldEquality.fsFileInlineData("decimal_comparison.fs")but that file is inEmittedIL/operators/, notEmittedIL/Structure/EmittedIL\operators\Operators.fsTypeChecks\TypeExtensions\PropertyShadowingTests.fs__SOURCE_DIRECTORY__ + "/Shadowing"butTypeChecks/TypeExtensions/Shadowing/does not existTypeChecks\PropertyShadowingTests.fsTypeChecks/Shadowing/which existsZero test coverage was lost. Every test in the deleted files is either an exact duplicate of a test in an already-included file, or references test data that never existed.