Skip to content

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

Closed

Description

To me, it seems like --results-directory should win over configuration files.

Relevant code:

string? resultDirectory = this[PlatformConfigurationConstants.PlatformResultDirectory];
if (resultDirectory is null)
{
if (commandLineOptions.TryGetOptionArgumentList(PlatformCommandLineProvider.ResultDirectoryOptionKey, out string[]? resultDirectoryArg))
{
_resultDirectory = resultDirectoryArg[0];
}
}
else
{
_resultDirectory = resultDirectory;
}

This can cause issues for retry extension. If user is originally calling the test executable passing a runsettings files that contains ResultsDirectory entry. Then, retry extension will re-pass the runsettings file along with --results-directory pointing to the attempt directory. The new run is now using the same ResultsDirectory and not using the attempt folder.

CONSIDER: Producing a warning if ResultsDirectory is specified twice (only if they are different? or always?).

AB#2415008

Activity

  1. added
    area/mtp
    on Mar 8, 2025
  2. Youssef1313 commented on Mar 8, 2025

    @Youssef1313
    MemberAuthor

    Jakub Jareš (@nohwnd) I'll let you decide if you want this in 1.6.3 or if you are fine with this being in 1.7.

  3. Youssef1313 commented on Mar 10, 2025

    @Youssef1313
    MemberAuthor

    CONSIDER: Producing a warning if ResultsDirectory is specified twice (only if they are different? or always?).

    This is going to be too problematic as it basically kills the idea of setting ResultsDirectory in configuration files (e.g, runsettings) while using the Retry extensions. The retries will explicitly pass --results-directory as well as passing the original runsettings via --settings

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

Metadata

Metadata

Labels

area/mtpstate/in-pr

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions