Environment Variables ​
In most scenarios, the values in config file are dynamic and can be represented through environment variables. To use environment variables in the config file, wrap the environment variable name inside {}
.
Config ​
Sample partial config file.
json
{
"targets": [
{
"name": "teams",
"inputs": {
"url": "{TEAMS_URL}",
"publish": "test-summary"
}
}
]
}
.env file ​
This library also reads all environment variables defined in .env
file.
LIMITATIONS
.env
file should be located at the same path where these library is getting invoked.
Pre Defined Environment Variables ​
TestBeats Portal ​
TEST_BEATS_PROJECT
- project nameTEST_BEATS_RUN
- test run nameTEST_BEATS_API_KEY
- TestBeats API keyTEST_BEATS_DELAY
- Delay between fetching analysis from portal. Default is3000
ms.
CI Info ​
TEST_BEATS_CI_NAME
- name of the CI providerTEST_BEATS_CI_GIT
- name of the Git providerTEST_BEATS_CI_REPOSITORY_URL
- repository URLTEST_BEATS_CI_REPOSITORY_NAME
- repository nameTEST_BEATS_CI_REPOSITORY_REF
- repository branch name or pull requestTEST_BEATS_CI_REPOSITORY_COMMIT_SHA
- repository commit SHATEST_BEATS_CI_BUILD_URL
- build URLTEST_BEATS_CI_BUILD_NUMBER
- build numberTEST_BEATS_CI_BUILD_NAME
- build nameTEST_BEATS_CI_BUILD_REASON
- build reasonTEST_BEATS_CI_USER
- user name