Skip to content

Commit c2c0f5e

Browse files
Evangelinkgewarren
andauthored
Document the platform configuration (#42185)
Co-authored-by: Genevieve Warren <[email protected]>
1 parent 3c57dfa commit c2c0f5e

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Microsoft.Testing.Platform config options
3+
description: Learn how to configure Microsoft.Testing.Platform using configuration settings.
4+
author: Evangelink
5+
ms.author: amauryleve
6+
ms.date: 08/15/2024
7+
---
8+
9+
# Microsoft.Testing.Platform configuration settings
10+
11+
Microsoft.Testing.Platform supports the use of configuration files and environment variables to configure the behavior of the test platform. This article describes the configuration settings that you can use to configure the test platform.
12+
13+
## testconfig.json
14+
15+
The test platform uses a configuration file named *[appname].testconfig.json* to configure the behavior of the test platform. The *testconfig.json* file is a JSON file that contains configuration settings for the test platform.
16+
17+
The *testconfig.json* file has the following structure:
18+
19+
```json
20+
{
21+
"platformOptions": {
22+
"config-property-name1": "config-value1",
23+
"config-property-name2": "config-value2"
24+
}
25+
}
26+
```
27+
28+
The platform will automatically detect and load the *[appname].testconfig.json* file located in the output directory of the test project (close to the executable).
29+
30+
When using [Microsoft.Testing.Platform.MSBuild](https://www.nuget.org/packages/Microsoft.Testing.Platform.MSBuild), you can simply create a *testconfig.json* file that will be automatically renamed to *[appname].testconfig.json* and moved to the output directory of the test project.
31+
32+
> [!NOTE]
33+
> The *[appname].testconfig.json* file will get overwritten on subsequent builds.
34+
35+
## Environment variables
36+
37+
Environment variables can be used to supply some runtime configuration information.
38+
39+
> [!NOTE]
40+
> Environment variables take precedence over configuration settings in the *testconfig.json* file.

docs/navigate/devops-testing/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ items:
179179
href: ../../core/testing/unit-testing-platform-faq.md
180180
- name: Comparison with VSTest
181181
href: ../../core/testing/unit-testing-platform-vs-vstest.md
182+
- name: Configure the test platform
183+
href: ../../core/testing/unit-testing-platform-config.md
182184
- name: Extensions
183185
items:
184186
- name: Overview

0 commit comments

Comments
 (0)