Skip to content

Consider --results-directory before configuration - #5201

Merged
Youssef Fahmy (Youssef1313) merged 6 commits into
microsoft:mainfrom
Youssef1313:results-dir
Mar 11, 2025
Merged

Youssef Fahmy (Youssef1313) merged 6 commits into
microsoft:mainfrom
Youssef1313:results-dir

Conversation

@Youssef1313

Copy link
Copy Markdown
Member

Fixes #5189

@Evangelink Amaury Levé (Evangelink) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Marco Rossignoli (@MarcoRossignoli) I recall we discussed that and I thought we ended up with:

  • Env var wins over
  • CLI args that wins over
  • config file

Do I recall incorrectly?

@Youssef1313

Youssef Fahmy (Youssef1313) commented Mar 10, 2025 •

Copy link
Copy Markdown
Member Author

Marco Rossignoli (@MarcoRossignoli) I recall we discussed that and I thought we ended up with:

  • Env var wins over
  • CLI args that wins over
  • config file

Do I recall incorrectly?

Currently, config file is winning over CLI. The PR brings the behavior you describe where CLI wins over config file. I don't see results directory being controllable via env variable so the env variable part is irrelevant here for this specific case.

@nohwnd

Copy link
Copy Markdown
Member

Yes, env > cli > config file

So file config can be committed and implicit (#3559), overriden by commandline parameters, either from cli or script or from ci yml,
and then env variables, so they can be used specifically in CI to setup secrets / pipeline overrides.

we also discuss it here: #3499 (comment)

@Youssef1313

Copy link
Copy Markdown
Member Author

/backport to rel/3.8

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Youssef Fahmy (@Youssef1313) backporting to rel/3.8 failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Consider `--results-directory` before configuration
Using index info to reconstruct a base tree...
M	src/Platform/Microsoft.Testing.Platform/Configurations/AggregatedConfiguration.cs
M	src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs
M	test/UnitTests/Microsoft.Testing.Platform.UnitTests/Configuration/AggregatedConfigurationTests.cs
Falling back to patching base and 3-way merge...
Auto-merging test/UnitTests/Microsoft.Testing.Platform.UnitTests/Configuration/AggregatedConfigurationTests.cs
Auto-merging src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs
Auto-merging src/Platform/Microsoft.Testing.Platform/Configurations/AggregatedConfiguration.cs
CONFLICT (content): Merge conflict in src/Platform/Microsoft.Testing.Platform/Configurations/AggregatedConfiguration.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Consider `--results-directory` before configuration
Error: The process '/usr/bin/git' failed with exit code 128

NOTE: A PR will be created, but needs to be revised manually!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/mtp Microsoft.Testing.Platform core library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Results directory from configuration is preferred over command-line option --results-directory

3 participants