SCM Integration for CI/CD Pipelines
Environment Variables
To ensure test runs can be sorted and identified based on SCM data, the following environment variables should be set:
SBVT_SCM_COMMIT_ID=<your_commit_id>
Description: Holds the commit ID of the code being tested.
Example:
export SBVT_SCM_COMMIT_ID=$(git rev-parse HEAD)
SBVT_SCM_BRANCH=<your_branch>
Description: Holds the name of the branch from which the code is being fetched.
Example:
export SBVT_SCM_BRANCH=$(git rev-parse --abbrev-ref HEAD)
Configuration Steps
Set environment variables in the CI/CD pipeline. For Git:
export SBVT_SCM_COMMIT_ID=$(git rev-parse HEAD) export SBVT_SCM_BRANCH=$(git rev-parse --abbrev-ref HEAD)
Include environment variables in the TestRun configuration
Ensure the
SBVT_SCM_COMMIT_ID
andSBVT_SCM_BRANCH
variables are included in your TestRun configuration file or pipeline script.
Configure TestRun configuration file
Example TestRun configuration file: (
testrun-config.yml
):scm: type: git repository: https://your-repo-url.git #Your repository link branch: ${SBVT_SCM_BRANCH) #Name of your branch commit_id: ${SBVT_SCM_COMMIT_ID} #Your commit ID