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

Roadblocks on updating tests baselines #18289

Open
auduchinok opened this issue Feb 4, 2025 · 7 comments
Open

Roadblocks on updating tests baselines #18289

auduchinok opened this issue Feb 4, 2025 · 7 comments

Comments

@auduchinok
Copy link
Member

auduchinok commented Feb 4, 2025

There're some things that make it more difficult to contribute to this repo than it used to be.

Surface area tests

  • There're two different files need updating, the debug and release ones, despite their contents are the same
    • Let's have only one instead? It would save developers from switching the solution configuration and extra file manipulations
  • The actual and expected files are in different directories
    • Let's put the actual file next to the expected one, so it's easier to compare and replace them
  • The contents get reordered
    • Let's have a stable sorting, so it's easier to see the actual difference

ILVerify

@T-Gro
Copy link
Member

T-Gro commented Feb 4, 2025

I think all are sensible.

@KevinRansom
Copy link
Member

@auduchinok best not to write back to where the source code lives. It for sure impacts parallel test runs. A single file is a decent idea, the DirectoryAttribute tests have a probing scheme that allows release/debug/net472/netcore to produce varying output we can certainly do something like that for surface area.

I believe FSharp.Core has different debug out, at least it used to. So multiple possibilities are probably still useful.

@KevinRansom
Copy link
Member

The contents get reordered

  • Let's have a stable sorting, so it's easier to see the actual difference

This is a bit wierd since we do sort before producing the actual file:

So this needs looking at, but yes sorting should be done and why it fails to be stable understood.

@KevinRansom
Copy link
Member

There're some things that make it more difficult to contribute to this repo than it used to be.

Surface area tests

  • There're two different files need updating, the debug and release ones, despite their contents are the same

    • Let's have only one instead? It would save developers from switching the solution configuration and extra file manipulations
  • The actual and expected files are in different directories

    • Let's put the actual file next to the expected one, so it's easier to compare and replace them
  • The contents get reordered

    • Let's have a stable sorting, so it's easier to see the actual difference

ILVerify

Yes, this is annoying.

Now that IL verify has been added as part of the test framework we should consider making these verifications standard testcases rather than an explicit CI path.

We should also try to eliminate all of the validation errors that exist in the ilverify baselines, either by ensuring ilverify doesn't produce the errors if they are truly "not an issue" or fixing the compiler codegen if they are valid issues.

@auduchinok
Copy link
Member Author

A single file is a decent idea, the DirectoryAttribute tests have a probing scheme that allows release/debug/net472/netcore to produce varying output we can certainly do something like that for surface area.

I believe FSharp.Core has different debug out, at least it used to.

Let's have a single file at least for FCS then, as it's updated quite frequently and doesn't need the second file for now. If it ever changes we'll reconsider it for sure

@auduchinok
Copy link
Member Author

I'm trying to update the baselines in #18311.

I've opened up a CMD instance (it seems to be the shell in the tests) and executed

set TEST_UPDATE_BSL=1

as suggested in the dev guide.

I've then run the tests using this command:

build.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release

The two tests have indeed failed, but the baselines have not been updated. Is there something I'm missing?

What is the easiest way to run these tests isolated?

@majocha
Copy link
Contributor

majocha commented Feb 17, 2025

dotnet test FSharp.sln -c Release -f net9.0 --filter "SurfaceArea" should work.
with TEST_UPDATE_BSL Surface area tests will just overwrite the baselines, which is nice, because it will show up in git changes immediately.

EDIT: I see you probably mean typecheck error baselines. I don't think those update with TEST_UPDATE_BSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: New
Development

No branches or pull requests

5 participants