Skip to content

Commit 4560db1

Browse files
Merge pull request #21 from rainforestapp/RF-25670-branching
[RF-25670] Support starting a run on a branch
2 parents 06d0777 + b079b17 commit 4560db1

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ jobs:
7777
with:
7878
actual: ${{ steps.test_environment_id_custom_url.outputs.command }}
7979
expected: run --skip-update --token "test_token" --run-group 42 --junit-file results/rainforest/junit.xml --save-run-id .rainforest_run_id --custom-url "https://something.com" --description "foo bar" --release "1.0"
80+
- name: Branch
81+
id: test_branch
82+
uses: ./
83+
with:
84+
token: test_token
85+
run_group_id: 42
86+
description: foo bar
87+
branch: feature-branch
88+
release: '1.0'
89+
dry_run: true
90+
- name: Branch
91+
uses: ./.github/actions/test
92+
with:
93+
actual: ${{ steps.test_branch.outputs.command }}
94+
expected: run --skip-update --token "test_token" --run-group 42 --junit-file results/rainforest/junit.xml --save-run-id .rainforest_run_id --branch "feature-branch" --description "foo bar" --release "1.0"
8095
- name: Missing token command
8196
id: test_missing_token
8297
uses: ./

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ Set to a value larger than `0` to retry failed tests excuted by our automation a
106106
#### Default behavior
107107
If no `automation_max_retries` parameter is passed in, the [default from your account or run group is used](https://help.rainforestqa.com/docs/test-retries).
108108

109+
### `branch`
110+
Use a specific Rainforest branch for this run.
111+
#### Default behavior
112+
If no `branch_name` parameter is passed in, the `main` branch will be used.
113+
109114
## Rerunning failed tests
110115
If your Rainforest run fails due to a ["non-bug"](https://rainforest.engineering/2021-01-20-shipping-faster-orb/) (your testing environment might have had a hiccup, or a test might have needed to be tweaked, etc), then rather than make code changes and then run your full testing suite once more, you'll instead want to rerun just the tests that failed. The Rainforest QA GitHub Action uses GitHub [caching](https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows) to know when a workflow is [being rerun](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs). It will then automatically rerun only the tests which failed in the previous run.
111116

action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ inputs:
5959
required: false
6060
default: ''
6161

62+
branch:
63+
description: Use a specific Rainforest branch for this run
64+
required: false
65+
default: ''
66+
6267
outputs:
6368
command:
6469
description: The CLI command that was run
@@ -194,6 +199,11 @@ runs:
194199
fi
195200
fi
196201
202+
# Set branch
203+
if [ -n "${{ inputs.branch }}" ] ; then
204+
RUN_COMMAND="${RUN_COMMAND} --branch \"${{ inputs.branch }}\""
205+
fi
206+
197207
# Set description
198208
if [ -z "${RAINFOREST_RUN_ID}" ] && [ -n "${{ inputs.description }}" ] ; then
199209
RUN_COMMAND="${RUN_COMMAND} --description \"${{ inputs.description }}\""

0 commit comments

Comments
 (0)