Skip to content
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

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

Merged
merged 10 commits into from
Oct 3, 2024

Conversation

majocha
Copy link
Contributor

@majocha majocha commented Sep 28, 2024

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 owner September 28, 2024 07:56
Copy link
Contributor

✅ No release notes required

src/FSharp.Build/Fsi.fs Outdated Show resolved Hide resolved
@majocha
Copy link
Contributor Author

majocha commented Oct 2, 2024

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
Copy link
Contributor Author

majocha commented Oct 2, 2024

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.

@majocha majocha closed this Oct 2, 2024
@majocha majocha reopened this Oct 2, 2024
@majocha majocha closed this Oct 2, 2024
@majocha majocha reopened this Oct 2, 2024
@vzarytovskii vzarytovskii enabled auto-merge (squash) October 3, 2024 09:42
@vzarytovskii vzarytovskii merged commit 7e9fd41 into dotnet:main Oct 3, 2024
32 checks passed
@majocha majocha deleted the testok branch October 3, 2024 11:21
Sign up for free to 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