Skip to content

[Testing Platform] Command line arguments file source #3499

Closed

Description

From what I can tell options are only supported currently from the command line.

It might be useful to try to find a well-known file that can store options within it. This way it can be source controlled by teams, and provide a more deterministic result between local development and CI builds without developers having to know which various flags to set.

E.g.

test-options.json

{
    "minimum-expected-tests": 200,
    "coverage": true,
    "report-trx": true
}

Activity

  1. Evangelink commented on Aug 9, 2024

    @Evangelink
    Member

    We have it partially done but that does need to be finished and documented (cc Marco Rossignoli (@MarcoRossignoli)).

  2. added
    area/mtp
    and removed
    needs/triage
    on Aug 9, 2024
  3. MarcoRossignoli commented on Aug 9, 2024

    @MarcoRossignoli
    Contributor

    We have it partially done but that does need to be finished and documented (cc Marco Rossignoli (@MarcoRossignoli)).

    Actually is not yet implemented but it's doable and a good idea, maybe a section like

    {
        "testingPlatform" :
        {
            "additionalCommandLine" : "--someoption file --anotherone"
        }
    }

    That we can parse and add, we need to understand what to do in case of duplicates (override, merge, throw) and ordering of the apply.

  4. thomhurst commented on Aug 9, 2024

    @thomhurst
    ContributorAuthor

    I'd probably take the file as the base values, and then any actual command line options override them

  5. nohwnd commented on Aug 19, 2024

    @nohwnd
    Member

    I'd probably take the file as the base values, and then any actual command line options override them

    👍 This is how the current vstest works. It takes config file, then answer file, then commandline arguments, then inline settings (settings specified on commandline after --).

    One great addition to that would imho be also applying settings file over a settings file, so we can have slightly different settings in CI, similar to my.configy.json, my.dev.config.json

    e.g. --settings my-settings.json --settings my-settings.ci.json

    maybe a section like additionalCommandLine

    Marco Rossignoli (@MarcoRossignoli) I think there is a good concept hidden in there, IMHO the settings and commandline parameters should be closely related and there should be a definitive step where all settings are finalized and are applied back to a "runsettings" object. This object is then the source of truth for the local run, or a remote run.

    In less abstract terms we should be able to write a plugin / execution mode that takes given command line parameters and turns them into runsettings.

  6. MarcoRossignoli commented on Aug 19, 2024

    @MarcoRossignoli
    Contributor

    In less abstract terms we should be able to write a plugin / execution mode that takes given command line parameters and turns them into runsettings.

    My main problem are complex configuration, in command line you cannot express too much and the configuration file in future could change the format like toml. One thing that we can do is maybe override the config with a convention "--overrideconfig-mstest-parallelize true" for scalar value

    {
    ...
     "mstest":
     {
        "parallelize" : false  
     }
    }

    here in command line we have only strings without type safety.

  7. nohwnd commented on Aug 19, 2024

    @nohwnd
    Member

    That is the direction I am proposing. Command Line -> config file, not the other way around. So not being able to handle all settings in commandline is okay.

    What I would like to avoid is the situation in VSTest where we say that runsettings are the source of truth, but we cannot easily convert from commandline parameters to runsettings, and so distributed runs don't allow all providing additional commandline parameters, and users have to convert to runsettings manually.

  8. thomhurst commented on Aug 19, 2024

    @thomhurst
    ContributorAuthor

    Or maybe allow choice of ordering like asp/generic host builder?

  9. thomhurst commented on Aug 19, 2024

    @thomhurst
    ContributorAuthor

    Or maybe allow choice of ordering like asp/generic host builder?

  10. MarcoRossignoli commented on Aug 19, 2024

    @MarcoRossignoli
    Contributor

    Or maybe allow choice of ordering like asp/generic host builder?

    What you mean?

  11. thomhurst commented on Aug 19, 2024

    @thomhurst
    ContributorAuthor

    Or maybe allow choice of ordering like asp/generic host builder?

    What you mean?

    The Microsoft host builder model allows you to choose overriding settings by extension methods of .AddEnvVariables or .AddJsonFile. you could let the framework decide that if using automatic hook registrations, or if the framework allows the user to build their own entry main method, they could set up the order themselves.

    Would be more work but give more flexibility. Just a thought.

  12. Youssef1313 commented on Apr 15, 2026

    @Youssef1313
    Member

    We already have response files today. Why would a new file (or updating testconfig.json) be needed?

  13. added
    needs/info
    needs/author-feedback
    on Apr 15, 2026
  14. microsoft-github-policy-service commented on Apr 23, 2026

    @microsoft-github-policy-service
    Contributor

    Hello Tom Longhurst (@thomhurst),
    This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mtpneeds/author-feedbackneeds/infostate/stale

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions