Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSTest: document testconfig.json #43743

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Evangelink
Copy link
Member

@Evangelink Evangelink commented Nov 25, 2024

Summary

Relates to microsoft/testfx#3872


Internal previews

📄 File 🔗 Preview link
docs/core/testing/unit-testing-mstest-configure.md Configure MSTest


## testconfig.json

When running your tests with MSTest, you can use a `testconfig.json` file to configure the behavior of the test runner. The `testconfig.json` file is a JSON file that contains the configuration settings for the test runner. The file is used to configure the test runner and the test execution environment. For more information, refer to [Microsoft.Testing.Platform testconfig.json documentation](unit-testing-platform-config.md#testconfigjson).
Copy link
Member

Choose a reason for hiding this comment

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

My understanding is that the file name should be <AssemblyName>.testconfig.json. However, we have an MSBuild target in Microsoft.Testing.Platform.MSBuild that copies testconfig.json to <AssemblyName>.testconfig.json, right?

Do we want to document that? Are there valid supported scenarios where Microsoft.Testing.Platform.MSBuild won't be referenced and the user will have to precisely name the file as <AssemblyName>.testconfig.json?

Copy link
Member Author

Choose a reason for hiding this comment

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

My understanding is that the file name should be .testconfig.json. However, we have an MSBuild target in Microsoft.Testing.Platform.MSBuild that copies testconfig.json to .testconfig.json, right?

Both points are correct. You can have only a .testconfig.json file and it will be copied and renamed correctly by the MSBuild extension. You can also do it manually following the <AssemblyName>.testconfig.json pattern.

Do we want to document that?

If that's not already documented on platform side then yes platform side doc should be updated to mention that. Could you file a ticket on our repo to fix that?

Are there valid supported scenarios where Microsoft.Testing.Platform.MSBuild won't be referenced and the user will have to precisely name the file as .testconfig.json?

This is user/framework author choice. If for some reason you don't want to use it you can avoid to rely on our MSBuild feature.


When running your tests with MSTest, you can use a `testconfig.json` file to configure the behavior of the test runner. The `testconfig.json` file is a JSON file that contains the configuration settings for the test runner. The file is used to configure the test runner and the test execution environment. For more information, refer to [Microsoft.Testing.Platform testconfig.json documentation](unit-testing-platform-config.md#testconfigjson).

Starting with MSTest 3.7, you can also configure MSTest runs in the same configuration file. The sections below describe the settings that you can use in the `testconfig.json` file.
Copy link
Member

Choose a reason for hiding this comment

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

This is about microsoft/testfx#3872 right?

In unit-testing-platform-config.md, maybe the new --config-file should be documented?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is about microsoft/testfx#3872 right?

Yes

In unit-testing-platform-config.md, maybe the new --config-file should be documented?

Yes, please do a ticket for it.

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

Successfully merging this pull request may close these issues.

3 participants