Environment Variables
TUnit supports configuration through environment variables, allowing you to set defaults without modifying command-line arguments. This is particularly useful for CI/CD pipelines and development environments.
TUnit-Specific Environment Variablesâ
TUNIT_DISABLE_LOGOâ
Disables the TUnit ASCII art logo when starting a test session.
# Bash/Linux/macOS
export TUNIT_DISABLE_LOGO=true
# PowerShell
$env:TUNIT_DISABLE_LOGO = "true"
# Windows Command Prompt
set TUNIT_DISABLE_LOGO=true
Equivalent to: --disable-logo
Use case: Reduces output noise in CI/CD logs or when using AI/LLM coding assistants that parse test output.
TUNIT_DISABLE_GITHUB_REPORTERâ
Disables the automatic GitHub Actions test summary reporter.
export TUNIT_DISABLE_GITHUB_REPORTER=true
Use case: When you want to use a custom reporting solution instead of the built-in GitHub Actions integration.
TUNIT_GITHUB_REPORTER_STYLEâ
Controls the style of the GitHub Actions test reporter output.
export TUNIT_GITHUB_REPORTER_STYLE=collapsible # default
export TUNIT_GITHUB_REPORTER_STYLE=full
Values:
collapsible(default): Wraps detailed test results in expandable HTML blocksfull: Displays all test details directly
Equivalent to: --github-reporter-style
TUNIT_DISABLE_JUNIT_REPORTERâ
Disables the JUnit XML reporter.
export TUNIT_DISABLE_JUNIT_REPORTER=true
TUNIT_ENABLE_JUNIT_REPORTERâ
Explicitly enables the JUnit XML reporter.
export TUNIT_ENABLE_JUNIT_REPORTER=true
JUNIT_XML_OUTPUT_PATHâ
Sets the output path for JUnit XML reports.
export JUNIT_XML_OUTPUT_PATH=/path/to/output.xml
TUNIT_MAX_PARALLEL_TESTSâ
Sets the maximum number of tests that can run in parallel.
export TUNIT_MAX_PARALLEL_TESTS=4 # Limit to 4 concurrent tests
export TUNIT_MAX_PARALLEL_TESTS=0 # Unlimited parallelism
Equivalent to: --maximum-parallel-tests
Note: Command-line arguments take precedence over environment variables.
Microsoft Testing Platform Environment Variablesâ
These environment variables are provided by the underlying Microsoft Testing Platform:
TESTINGPLATFORM_TELEMETRY_OPTOUTâ
Disables telemetry collection.
export TESTINGPLATFORM_TELEMETRY_OPTOUT=1
TESTINGPLATFORM_UI_LANGUAGEâ
Sets the language for platform messages and logs.
export TESTINGPLATFORM_UI_LANGUAGE=en-us
Platform-Level Flagsâ
Some command-line flags are handled by the Microsoft Testing Platform rather than TUnit directly. These flags currently do not have environment variable equivalents:
--no-progress- Disables progress reporting to screen--no-ansi- Disables ANSI escape characters
Workarounds for --no-progressâ
While there's no environment variable for --no-progress, you can use these alternatives:
1. MSBuild Property (with dotnet test):
<PropertyGroup>
<TestingPlatformCommandLineArguments>--no-progress</TestingPlatformCommandLineArguments>
</PropertyGroup>
2. Shell Wrapper:
#!/bin/bash
# run-tests.sh
./MyTestProject.exe --no-progress "$@"
3. Direct Command Line:
./MyTestProject.exe --no-progress
CI/CD Examplesâ
GitHub Actionsâ
- name: Run Tests
env:
TUNIT_DISABLE_LOGO: true
TUNIT_GITHUB_REPORTER_STYLE: collapsible
run: dotnet test
Azure DevOpsâ
- task: DotNetCoreCLI@2
env:
TUNIT_DISABLE_LOGO: true
inputs:
command: 'test'
GitLab CIâ
test:
variables:
TUNIT_DISABLE_LOGO: "true"
script:
- dotnet test
Dockerâ
ENV TUNIT_DISABLE_LOGO=true
ENV TUNIT_MAX_PARALLEL_TESTS=4
Priority Orderâ
When the same setting is configured in multiple places, TUnit follows this priority order (highest to lowest):
- Command-line arguments - Always take precedence
- Environment variables - Applied when command-line argument is not provided
- Configuration files - Applied as defaults
Summary Tableâ
| Environment Variable | Equivalent Flag | Description |
|---|---|---|
TUNIT_DISABLE_LOGO | --disable-logo | Disables ASCII art logo |
TUNIT_GITHUB_REPORTER_STYLE | --github-reporter-style | GitHub reporter style |
TUNIT_DISABLE_GITHUB_REPORTER | - | Disables GitHub reporter |
TUNIT_DISABLE_JUNIT_REPORTER | - | Disables JUnit reporter |
TUNIT_ENABLE_JUNIT_REPORTER | - | Enables JUnit reporter |
JUNIT_XML_OUTPUT_PATH | - | JUnit output path |
TUNIT_MAX_PARALLEL_TESTS | --maximum-parallel-tests | Max parallel tests |