-
Notifications
You must be signed in to change notification settings - Fork 291
Description
Summary
The new testconfig.json file should allow setting environment variables the same way the old runsettings.xml files did.
Many frameworks and systems rely on environment variables for configuration, and having a mechanism to pass those for the specific test run via the testconfig.json instead of forcing them to be defined globally is ideal.
This also helps bridging the gap with the old runsettings.xml-based mechanism, which did allow for specifying environment variables as part of its spec.
Background and Motivation
We are migrating some of our test projects to the new Microsoft.Test.Platform framework, and as part of that, we want to replace all usages of the runsettings file with the new testconfig.json.
One of the features lacking in testconfig.json currently is being able to define environment variables for the test.
Proposed Feature
A new json section should be supported as part of the testconfig.json schema that allows one to define environment variables. Here is an example:
{
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development",
"HEADED": "1"
}
}Alternative Designs
For now, we created our own custom ITestHostEnvironmentVariableProvider implementation that reads the values from IConfiguration and sets them manually.
We would like to have this as a native feature, so we don't have to maintain that extension.