Skip to content

Conversation

@T-Gro
Copy link
Member

@T-Gro T-Gro commented Feb 11, 2026

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

Count Detail
Files added to .fsproj 111 110 in FSharp.Compiler.ComponentTests, 1 in FSharp.Core.UnitTests
Duplicate / dead files deleted 9 See Duplicate cleanup below
Files requiring fixes 6 Module renames, NUnit→xUnit, broken API calls, dead code removal
New infrastructure 3 FactForWINDOWSAttribute, ProcessResult/runFsiProcess/runFscProcess, TypeForwardingHelpers
Build 0 errors, 0 warnings

Infrastructure created

  • FactForWINDOWSAttribute in tests/FSharp.Test.Utilities/Utilities.fs — conditional attribute for Windows-only CLI tests
  • ProcessResult + runFsiProcess + runFscProcess in tests/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)
  • TypeForwardingHelpers module in tests/FSharp.Compiler.ComponentTests/Conformance/TypeForwarding/TypeForwardingHelpers.fs — compiles C# original → F# exe → C# target → C# forwarder → swaps DLLs → runs via reflection

Files added to .fsproj

Wave 1: CompilerOptions (19 files)

  • CompilerOptions\Fsc\FscCliTests.fs — 5 CLI subprocess tests (FS0225 missing source file)
  • CompilerOptions\Fsc\Removed.fs
  • CompilerOptions\Fsc\responsefile\responsefile.fs
  • CompilerOptions\Fsc\standalone\standalone.fs
  • CompilerOptions\Fsc\dumpAllCommandLineOptions\dumpAllCommandLineOptions.fs
  • CompilerOptions\Fsc\gccerrors\gccerrors.fs
  • CompilerOptions\Fsc\nologo\nologo.fs
  • CompilerOptions\Fsc\staticlink\staticlink.fs
  • CompilerOptions\Fsc\subsystemversion\Subsystemversion.fs
  • CompilerOptions\Fsc\target\target.fs
  • CompilerOptions\Fsc\tokenize\tokenize.fs
  • CompilerOptions\Fsc\lib\lib.fs
  • CompilerOptions\Fsc\Optimize.fs
  • CompilerOptions\Fsc\out\out.fs
  • CompilerOptions\Fsc\pdb\Pdb.fs
  • CompilerOptions\Fsc\tailcalls\tailcalls.fs
  • CompilerOptions\fsi\FsiCliTests.fs — 7 CLI subprocess tests (FS0243 unrecognized option, help flags)
  • CompilerOptions\fsi\Nologo.fs
  • CompilerOptions\fsi\Langversion.fs

Wave 2: Conformance Expressions & Lexical (23 files)

  • Conformance\Expressions\ApplicationExpressions\Assertion\Assertion.fs
  • Conformance\Expressions\ApplicationExpressions\ObjectConstruction\ObjectConstruction.fs
  • Conformance\Expressions\ConstantExpressions\ConstantExpressions.fs
  • Conformance\Expressions\ControlFlowExpressions\SimpleFor\SimpleFor.fs
  • Conformance\Expressions\ControlFlowExpressions\TryFinally\TryFinally.fs
  • Conformance\Expressions\ControlFlowExpressions\TryWith\TryWith.fs
  • Conformance\Expressions\DataExpressions\AddressOf\AddressOf.fs
  • Conformance\Expressions\DataExpressions\ComputationExpressions\ComputationExpressions.fs
  • Conformance\Expressions\DataExpressions\ObjectExpressions\ObjectExpressions.fs
  • Conformance\Expressions\DataExpressions\QueryExpressions.fs
  • Conformance\Expressions\DataExpressions\RangeExpressions\RangeExpressions.fs
  • Conformance\Expressions\DataExpressions\SequenceExpressions\SequenceExpressions.fs
  • Conformance\Expressions\DataExpressions\Simple\Simple.fs
  • Conformance\Expressions\DataExpressions\TupleExpressions\TupleExpressions.fs
  • Conformance\Expressions\EvaluationOfElaboratedForms\EvaluationOfElaboratedForms.fs
  • Conformance\Expressions\ExpressionQuotations\Baselines.fs
  • Conformance\Expressions\ExpressionQuotations\Regressions.fs
  • Conformance\Expressions\SyntacticSugar\SyntacticSugar.fs
  • Conformance\Expressions\SyntacticSugarAndAmbiguities\SyntacticSugarAndAmbiguities.fs
  • Conformance\LexicalAnalysis\Directives.fs
  • Conformance\LexicalAnalysis\StringsAndCharacters.fs
  • Conformance\LexicalFiltering\Basic\Basic.fs
  • Conformance\LexicalFiltering\LexicalAnalysisOfTypeApplications\LexicalAnalysisOfTypeApplications.fs

Wave 3: Conformance InferenceProcedures (12 files)

  • Conformance\InferenceProcedures\ConstraintSolving\ConstraintSolving.fs
  • Conformance\InferenceProcedures\DispatchSlotChecking\DispatchSlotChecking.fs
  • Conformance\InferenceProcedures\DispatchSlotInference\DispatchSlotInference.fs
  • Conformance\InferenceProcedures\FunctionApplicationResolution\FunctionApplicationResolution.fs
  • Conformance\InferenceProcedures\Generalization\Generalization.fs
  • Conformance\InferenceProcedures\MethodApplicationResolution\MethodApplicationResolution.fs
  • Conformance\InferenceProcedures\NameResolution\AutoOpen\AutoOpen.fs
  • Conformance\InferenceProcedures\NameResolution\Misc\NameResolutionMisc.fs
  • Conformance\InferenceProcedures\NameResolution\RequireQualifiedAccess\RequireQualifiedAccess.fs
  • Conformance\InferenceProcedures\ResolvingApplicationExpressions\ResolvingApplicationExpressions.fs
  • Conformance\InferenceProcedures\TypeInference\TypeInference.fs
  • Conformance\InferenceProcedures\WellFormednessChecking\WellFormednessChecking.fs

Wave 4: Conformance OO Types (17 files)

  • Conformance\ObjectOrientedTypeDefinitions\AbstractMembers\AbstractMembers.fs
  • Conformance\ObjectOrientedTypeDefinitions\ClassTypes\AsDeclarations\AsDeclarations.fs
  • Conformance\ObjectOrientedTypeDefinitions\ClassTypes\AutoProperties\AutoProperties.fs
  • Conformance\ObjectOrientedTypeDefinitions\ClassTypes\ImplicitObjectConstructors\ImplicitObjectConstructors.fs
  • Conformance\ObjectOrientedTypeDefinitions\ClassTypes\InheritsDeclarations\InheritsDeclarations.fs
  • Conformance\ObjectOrientedTypeDefinitions\ClassTypes\MemberDeclarations\MemberDeclarations.fs
  • Conformance\ObjectOrientedTypeDefinitions\ClassTypes\Misc\Misc.fs
  • Conformance\ObjectOrientedTypeDefinitions\ClassTypes\StaticLetDoDeclarations\StaticLetDoDeclarations.fs
  • Conformance\ObjectOrientedTypeDefinitions\ClassTypes\ValueRestriction\ValueRestriction.fs
  • Conformance\ObjectOrientedTypeDefinitions\DelegateTypes\DelegateTypes.fs
  • Conformance\ObjectOrientedTypeDefinitions\EnumTypes\EnumTypes.fs
  • Conformance\ObjectOrientedTypeDefinitions\InterfaceTypes\InterfaceTypes.fs
  • Conformance\ObjectOrientedTypeDefinitions\StructTypes\StructTypes.fs
  • Conformance\ObjectOrientedTypeDefinitions\TypeExtensions\basic\Basic.fs
  • Conformance\ObjectOrientedTypeDefinitions\TypeExtensions\intrinsic\Intrinsic.fs
  • Conformance\ObjectOrientedTypeDefinitions\TypeExtensions\optional\Optional.fs
  • Conformance\ObjectOrientedTypeDefinitions\TypeKindInference\TypeKindInference.fs

Wave 5: Conformance Remaining + TypeForwarding (20 files)

  • Conformance\DeclarationElements\PInvokeDeclarations.fs
  • Conformance\GeneratedEqualityHashingComparison\Attributes\New\Attributes_New.fs
  • Conformance\ImplementationFilesAndSignatureFiles\CheckingOfImplementationFiles.fs
  • Conformance\ImplementationFilesAndSignatureFiles\NamespacesFragmentsAndImplementationFiles.fs
  • Conformance\ImplementationFilesAndSignatureFiles\SignatureFiles.fs
  • Conformance\Signatures\Signatures.fs
  • Conformance\SpecialAttributesAndTypes\CallerInfo.fs
  • Conformance\SpecialAttributesAndTypes\ThreadStatic.fs
  • Conformance\Stress\StressTests.fs
  • Conformance\TypeForwarding\TypeForwardingTests.fs
  • Conformance\TypesAndTypeConstraints\TypesAndTypeConstraints.fs
  • Conformance\TypeForwarding\TypeForwardingHelpers.fs (new infrastructure)
  • Conformance\TypeForwarding\TypeForwardingHelpersTests.fs
  • Conformance\TypeForwarding\NegativeCases.fs
  • Conformance\TypeForwarding\StructTests.fs
  • Conformance\TypeForwarding\ClassTests.fs
  • Conformance\TypeForwarding\DelegateTests.fs
  • Conformance\TypeForwarding\InterfaceTests.fs
  • Conformance\TypeForwarding\CycleTests.fs
  • Conformance\TypeForwarding\NestedTests.fs

Wave 6: Remaining orphans (20 files)

Found during exhaustive re-sweep (grep for [<Fact>]/[<Theory>] in all .fs not in any .fsproj).

  • InteractiveSession\Misc.fs — 116+ tests
  • CompilerOptions\Fsc\Platform.fs
  • EmittedIL\RealInternalSignature\ClassTypeVisibility.fs
  • EmittedIL\RealInternalSignature\RealInternalSignature.fs
  • Conformance\LexicalAnalysis\Whitespace.fs — 1 test
  • Conformance\LexicalAnalysis\ShiftGenerics.fs — 1 test
  • Conformance\LexicalAnalysis\LineDirectives.fs — 2 tests
  • Conformance\LexicalAnalysis\IdentifiersAndKeywords.fs — 15 tests
  • Conformance\LexicalAnalysis\IdentifierReplacements.fs — 3 tests
  • Conformance\LexicalAnalysis\ConditionalCompilation.fs — 13 tests
  • Conformance\DeclarationElements\ObjectConstructors.fs — 16 tests
  • Conformance\MultiTargeting.fs — 3 tests (FactForDESKTOP)
  • Diagnostics\ParsingAtEOF.fs — 11 tests
  • Diagnostics\NONTERM.fs — 36 tests
  • Misc.fs (root) — 2 unique inline IL tests (Array.Empty, DU cctor renaming)
  • EmittedIL\StringEncoding\StringEncoding.fs — 4 tests
  • CompilerOptions\CliProcessTests.fs — 7 tests (FSC/FSI help, version, invalid options)
  • Miscellaneous\MigratedMisc.fs — 13 tests
  • Libraries\NativeInterop.fs — 1 test
  • FSharp.Core\Microsoft.FSharp.Linq\NullableOperators.fs (in FSharp.Core.UnitTests.fsproj)

Fixes applied to enable inclusion

File Issue Fix
CompilerOptions\Fsc\Platform.fs module Platform conflicted with existing Platform.fs in same namespace Renamed module to PlatformErrors
EmittedIL\RealInternalSignature\ClassTypeVisibility.fs module ClassTypeVisibilityModuleRoot conflicted with existing file Renamed module to ClassTypeVisibility
EmittedIL\RealInternalSignature\RealInternalSignature.fs namespace EmittedIL + module RealInternalSignature conflicted; also had broken |> asLibrary |> compile |> compileExeAndRun pipeline (compileExeAndRun takes CompilationUnit, not CompilationResult) Changed namespace to EmittedIL.RealInternalSignature, renamed module to RealInternalSignatureTests, removed redundant |> asLibrary |> compile before compileExeAndRun (2 instances)
InteractiveSession\Misc.fs Lines 2140-2186 contained 3 duplicate tests using withFsiArgs which doesn't exist in the test framework Removed the 48-line dead section; the working versions using CompilerAssert.RunScriptWithOptionsAndReturnResult at lines 2052-2111 were already present
Conformance\MultiTargeting.fs Used withRawOptions which doesn't exist in the test framework Changed to withOptions
FSharp.Core\Microsoft.FSharp.Linq\NullableOperators.fs NUnit test ([<TestFixture>], Assert.AreEqual) in an xUnit project Removed [<TestFixture>], Assert.AreEqualAssert.Equal, added open System

Duplicate cleanup (9 files deleted)

During the sweep, 9 .fs files were found that contained [<Fact>]/[<Theory>] attributes but were not in any .fsproj and 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:

Deleted file Canonical file (already in .fsproj) Evidence
TupleElimination.fs (root, 5 tests) EmittedIL\TupleElimination.fs (5 tests) All 5 test names identical
Literals.fs (root, 1 test) EmittedIL\Literals.fs (13 tests) Root test is a strict subset
TailCalls.fs (root, 5 tests) EmittedIL\TailCalls.fs (8 tests) All 5 root tests present in canonical file
StringFormatAndInterpolation.fs (root, 1 test) EmittedIL\StringFormatAndInterpolation.fs (4 tests) Root test is a strict subset

Broken duplicates (5 files)

Files that reference non-existent directories or test data, AND whose tests are already covered by working canonical versions:

Deleted file Problem Canonical file Evidence
Operators.fs (root) Uses Directory(__SOURCE_DIRECTORY__ + "/../resources/tests/CodeGen/operators") — that directory does not exist EmittedIL\operators\Operators.fs Same decimal comparison test; canonical uses FileInlineData("decimal_comparison.fs") which exists
AttributeUsage.fs (root, 23 tests) Uses Directory(__SOURCE_DIRECTORY__, ...) at root, but the referenced source files (e.g. AssemblyVersion01.fs, E_WithBitwiseAnd01.fsx) are not at root Conformance\BasicGrammarElements\CustomAttributes\AttributeUsage\AttributeUsage.fs (86 tests) 22 of 23 tests are duplicates; the 1 "unique" test (E_WithBitwiseAnd01.fsx) references a file that does not exist anywhere in the repo — it was DOA
OnOverridesAndIFaceImpl.fs (root, 6 tests) Uses Directory(__SOURCE_DIRECTORY__, ...) at root, but E_InterfaceImpl01.fs etc. are at Conformance/BasicGrammarElements/AccessibilityAnnotations/OnOverridesAndIFaceImpl/ Conformance\BasicGrammarElements\AccessibilityAnnotations\OnOverridesAndIFaceImpl\OnOverridesAndIFaceImpl.fs (6 tests) All 6 tests are identical (names differ only .fs vs _fs suffix)
EmittedIL\Structure\StructFieldEquality.fs Uses FileInlineData("decimal_comparison.fs") but that file is in EmittedIL/operators/, not EmittedIL/Structure/ EmittedIL\operators\Operators.fs Same test, same source file, wrong directory
TypeChecks\TypeExtensions\PropertyShadowingTests.fs References __SOURCE_DIRECTORY__ + "/Shadowing" but TypeChecks/TypeExtensions/Shadowing/ does not exist TypeChecks\PropertyShadowingTests.fs Identical tests; canonical version correctly references TypeChecks/Shadowing/ which exists

Zero 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.

T-Gro and others added 21 commits February 3, 2026 11:36
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.
@github-actions
Copy link
Contributor

✅ No release notes required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant