Skip to content

Lookup test configuration from a file #3559

Closed as not planned
Closed as not planned

Description

@nohwnd

Summary

There are many configuration options in runsettings/other files. It would be nice to not have to specify them in commandline, or in VS in UI.

Background and Motivation

It is hard to recommend people to configure their test base in some non-default way when they don't have an easy way to consume such settings. For example running on commandline with settings requires to always specify them:

dotnet test --settings mysettings.runsettings

and in VS they need to be set in UI by every developer.

Proposed Feature

Lookup settings / configuration file by recursing directories, similarly to Directory.Build.props, nuget.config or .editorconfig, to allow using settings by default without having to specify them on commandline or in UI.

Offload the lookup to MSBuild when building the test project, and copy the settings next to the test project so we keep the bin folder self-contained and portable.

Alternative Designs

Activity

  1. nohwnd commented on Aug 15, 2024

    @nohwnd
    MemberAuthor

    When is this useful?

    For example I would like my tests to run with output that shows passed tests, and never uses ansi. I would like to be able to set those settings in my repo, and version them and have them automatically picked up for any test run.

  2. Evangelink commented on Aug 15, 2024

    @Evangelink
    Member

    Thanks Jakub Jareš (@nohwnd)!

    I find it useful indeed but I think I would prefer this behavior to not be part of the core platform so it remains 100% deterministic.

    I am wondering if this could be an added feature of VS and dotnet test (could be some kind of shared library or an extension) that does the lookup and force the --settings path to the call. This means we would have a different UX when calling the exe directly but I think it's fine.

  3. added
    state/needs-approval
    area/mtp
    on Aug 15, 2024
  4. Evangelink commented on Aug 15, 2024

    @Evangelink
    Member

    Actually as runsettings are coming from the bridge, it's probably find to say the lookup feature is provided by the bridge.

  5. nohwnd commented on Aug 15, 2024

    @nohwnd
    MemberAuthor

    It does not have to be runsettings specifically, I would much rather have it built in for some configuration that the platform is able to consume. I don't think runsettings should be used in the future as the way to configure test runs.

  6. Evangelink commented on Aug 15, 2024

    @Evangelink
    Member

    I would much rather have it built in for some configuration that the platform

    See related ticket.

  7. thomhurst commented on Aug 15, 2024

    @thomhurst
    Contributor

    Is this the same as #3499 ?

  8. Evangelink commented on Aug 15, 2024

    @Evangelink
    Member

    Partially, this ticket is about how to find the configuration file (similarly to #3562). Yours is asking about the support of command line options in the config file.

    BTW you could already have a look at https://github.com/microsoft/testfx/blob/main/docs/testingplatform/configuration.md to start adding your settings in this file. We will be releasing 1.4 preview today (please use this version if you want to do so).

  9. Evangelink commented on Apr 20, 2026

    @Evangelink
    Member

    Closing as won't fix for now

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/mtpstate/needs-approvaltype/discussion

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions