Skip to content

Commit

Permalink
Merge branch 'main' into SBVT-2444
Browse files Browse the repository at this point in the history
  • Loading branch information
tnelms1 authored May 20, 2024
2 parents 7e008c8 + 7e352da commit ca79cf6
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/browser_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: ${{ steps.set-test-run-name.outputs.TEST_RUN_NAME }}
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE
4 changes: 4 additions & 0 deletions .github/workflows/cypress_version-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: ${{ steps.set-test-run-name.outputs.TEST_RUN_NAME }}
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE


Expand Down Expand Up @@ -114,4 +116,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: ${{ steps.set-test-run-name.outputs.TEST_RUN_NAME }}
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE
2 changes: 2 additions & 0 deletions .github/workflows/linux_quick-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: ${{ steps.set-test-run-name.outputs.TEST_RUN_NAME }}
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE


2 changes: 2 additions & 0 deletions .github/workflows/mac_windows_quick-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: "${{ github.workflow }}—${{ runner.os }}—${{ github.ref }}"
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE


Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/npm-package_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: ${{ steps.set-test-run-name.outputs.TEST_RUN_NAME }}
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE


2 changes: 2 additions & 0 deletions .github/workflows/print_report-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: "${{ github.workflow }}—${{ runner.os }}—${{ github.ref }}"
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE


2 changes: 2 additions & 0 deletions .github/workflows/typescript-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: ${{ steps.set-test-run-name.outputs.TEST_RUN_NAME }}
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE


2 changes: 2 additions & 0 deletions .github/workflows/webkit-browser_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PROJECT_TOKEN: ${{ secrets.DEV_EXAMPLE_7 }}
TEST_RUN_NAME: "${{ github.workflow }}—${{ runner.os }}—${{ github.ref }}"
SBVT_SCM_BRANCH: ${{ github.head_ref || github.ref_name }}
SBVT_SCM_COMMIT_ID: ${{ github.sha }}
DEBUG: TRUE
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ module.exports = {
// OR save on the environment variable
// SBVT_TEST_GROUP_NAME = 'test group name'
```
## Assigning SCM data to a test run

Save Source Control Manager data on the environment variable
```bash
SBVT_SCM_BRANCH=branch-name
SBVT_SCM_COMMIT_ID=commit-hash
```

## Manual Setup

Expand Down
5 changes: 4 additions & 1 deletion plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ function makeGlobalRunHooks() {
const postResponse = await apiRequest('post', `${configFile.url}/api/v1/projects/${configFile.projectId}/testruns`, {
testRunName: configFile.testRunName,
sdk: 'cypress',
sdkVersion: `${package_json.version}/c${usersCypress.version}`, ...(!!process.env.SBVT_TEST_GROUP_ID ? {testGroupId: process.env.SBVT_TEST_GROUP_ID} : !!configFile.testGroupName ? {testGroupId: await getCreateTestGroupId(getUsersTestGroupName(configFile.testGroupName), configFile.projectToken)} : {}),
sdkVersion: `${package_json.version}/c${usersCypress.version}`,
...(!!process.env.SBVT_TEST_GROUP_ID ? {testGroupId: process.env.SBVT_TEST_GROUP_ID} : !!configFile.testGroupName ? {testGroupId: await getCreateTestGroupId(getUsersTestGroupName(configFile.testGroupName), configFile.projectToken)} : {}),
...(!!process.env.SBVT_SCM_COMMIT_ID ? {scmCommitId: process.env.SBVT_SCM_COMMIT_ID} : {}),
...(!!process.env.SBVT_SCM_BRANCH ? {scmBranch: process.env.SBVT_SCM_BRANCH} : {}),
});
configFile.testRunId = postResponse.data.testRunId;
logger.debug('config.testRunId: ' + configFile.testRunId);
Expand Down

0 comments on commit ca79cf6

Please sign in to comment.