Skip to content

Force assign callerFilePath#5711

Merged
JanKrivanek merged 1 commit into
dotnet:mainfrom
JanKrivanek:verify-ci-breaks
Dec 2, 2022
Merged

Force assign callerFilePath#5711
JanKrivanek merged 1 commit into
dotnet:mainfrom
JanKrivanek:verify-ci-breaks

Conversation

@JanKrivanek
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

/backport to release/7.0.2xx

@github-actions
Copy link
Copy Markdown

ghost commented Dec 14, 2022

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

mmitche pushed a commit to dotnet/sdk that referenced this pull request Apr 2, 2026
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