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

Force assign callerFilePath #5711

Merged
merged 1 commit into from
Dec 2, 2022
Merged

Conversation

JanKrivanek
Copy link
Member

@JanKrivanek JanKrivanek commented Dec 1, 2022

Problem

Fixes #5710

Issue rootcause discovered when working on: VerifyTests/Verify#729

When usage of Veriy built on one OS and then called from other - the default implementation of VerifySettings.DerivePathInfo then leads to ArgumentNullException - as parsing paths with Path utility returns empty/null for paths from other platform.
This can be accidentaly remediated by passing custom DerivePathInfo. That's static - so it can happen to be injected by unrelated test in CI (that was the reason for randomness).

Solution

Explicitly inject callerFilePath to Verify. Pass through path obtained from the external caller of our API - so that path originates from the same build where the verification functionality is invoked.

Checks:

  • Added unit tests
  • Added #nullable enable to all the modified files ?

@JanKrivanek JanKrivanek requested a review from a team as a code owner December 1, 2022 11:16
Copy link
Member

@YuliiaKovalova YuliiaKovalova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@JanKrivanek JanKrivanek merged commit a6015a0 into dotnet:main Dec 2, 2022
@JanKrivanek JanKrivanek deleted the verify-ci-breaks branch December 2, 2022 09:15
@JanKrivanek
Copy link
Member Author

/backport to release/7.0.2xx

@github-actions
Copy link
Contributor

Started backporting to release/7.0.2xx: https://github.com/dotnet/templating/actions/runs/3697001866

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Random Verify exceptions in CI
3 participants