Skip to content

Tests: remove dependency on CurrentDirectory ("test.ok" files) - #17815

Merged
vzarytovskii merged 10 commits into
dotnet:mainfrom
majocha:testok
Oct 3, 2024
Merged

Tests: remove dependency on CurrentDirectory ("test.ok" files)#17815
vzarytovskii merged 10 commits into
dotnet:mainfrom
majocha:testok

Conversation

@majocha

Copy link
Copy Markdown
Contributor

This is mostly cherrypick from #17662.

A lot of FSharpSuite tests write a "test.ok" file to current dir to signal success. This is bad because current directory is a shared resource.

This makes them write to stdout instead.
Not pretty either, but Console.Out can be very simply intercepted in a multi-threaded way to unblock running those tests in parallel.

Inspired by #17709.

@majocha
majocha requested a review from a team as a code ownerSeptember 28, 2024 07:56
@github-actions

Copy link
Copy Markdown
Contributor

✅ No release notes required

Comment threadFSharpTests.Directory.Build.targets Outdated
Comment threadsrc/FSharp.Build/Fsi.fs Outdated
Comment threadFSharpTests.Directory.Build.targets Outdated
@majocha

majocha commented Oct 2, 2024

Copy link
Copy Markdown
ContributorAuthor

Tested contributor scenario on WIndows:
With env variable BUILDING_USING_DOTNET=true

git clean -xdf
dotnet build .\FSharp.Compiler.Service.sln
dotnet test .\tests\FSharp.Compiler.ComponentTests\

Tests running fine.

@majocha

majocha commented Oct 2, 2024

Copy link
Copy Markdown
ContributorAuthor

I also added BUILDING_USING_DOTNET condition to FSharpSuite.Tests.

Now

dotnet test .\tests\fsharp --filter "nameof-fsi"

Verifies the relevant test successfully runs RunFSharpScriptAndPrintOutput target.

@majochamajocha closed this Oct 2, 2024
@majochamajocha reopened this Oct 2, 2024
@majochamajocha closed this Oct 2, 2024
@majochamajocha reopened this Oct 2, 2024
Comment threadtests/fsharp/FSharpSuite.Tests.fsproj
0101
0101 approved these changes Oct 3, 2024
Comment threadtests/FSharp.Test.Utilities/TestFramework.fs
@vzarytovskii
vzarytovskii enabled auto-merge (squash) October 3, 2024 09:42
@vzarytovskii
vzarytovskii merged commit 7e9fd41 into dotnet:mainOct 3, 2024
@majocha
majocha deleted the testok branch October 3, 2024 11:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants

@majocha@0101@Martin521@T-Gro@vzarytovskii