Skip to content

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 name
  • TEST_BEATS_RUN - test run name
  • TEST_BEATS_API_KEY - TestBeats API key
  • TEST_BEATS_DELAY - Delay between fetching analysis from portal. Default is 3000 ms.

CI Info ​

  • TEST_BEATS_CI_NAME - name of the CI provider
  • TEST_BEATS_CI_GIT - name of the Git provider
  • TEST_BEATS_CI_REPOSITORY_URL - repository URL
  • TEST_BEATS_CI_REPOSITORY_NAME - repository name
  • TEST_BEATS_CI_REPOSITORY_REF - repository branch name or pull request
  • TEST_BEATS_CI_REPOSITORY_COMMIT_SHA - repository commit SHA
  • TEST_BEATS_CI_BUILD_URL - build URL
  • TEST_BEATS_CI_BUILD_NUMBER - build number
  • TEST_BEATS_CI_BUILD_NAME - build name
  • TEST_BEATS_CI_BUILD_REASON - build reason
  • TEST_BEATS_CI_USER - user name

Released under the MIT License.