Merge pull request #36 from rainforestapp/dependabot/github_actions/a… #235
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run ShellCheck | |
uses: ludeeus/[email protected] | |
with: | |
scandir: './steps' | |
- name: Install faketime | |
run: | | |
sudo apt-get update | |
sudo apt-get install libfaketime | |
- name: Base case command | |
id: test_base | |
uses: ./ | |
env: | |
LD_PRELOAD: /usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1 | |
FAKETIME: '2021-12-31 23:59:59' | |
with: | |
token: test_token | |
run_group_id: 42 | |
dry_run: true | |
- name: Base case test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_base.outputs.command }} | |
expected: run --skip-update --token "test_token" --run-group 42 --junit-file results/rainforest/junit.xml --save-run-id .rainforest_run_id --description "rainforestapp/github-action - ${{ github.ref_name }} test 2021-12-31T23:59:59Z" --release "${{ github.sha }}" | |
- name: All parameters command | |
id: test_all_parameters | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
description: foo bar | |
environment_id: 117 | |
conflict: cancel-all | |
execution_method: automation | |
release: '1.0' | |
automation_max_retries: 2 | |
background: true | |
dry_run: true | |
- name: All parameters test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_all_parameters.outputs.command }} | |
expected: run --skip-update --token "test_token" --run-group 42 --junit-file results/rainforest/junit.xml --save-run-id .rainforest_run_id --conflict cancel-all --environment-id 117 --execution-method automation --automation-max-retries 2 --description "foo bar" --release "1.0" --background | |
- name: Custom URL command | |
id: test_custom_url | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
description: foo bar | |
custom_url: https://something.com | |
release: '1.0' | |
dry_run: true | |
- name: Custom URL test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_custom_url.outputs.command }} | |
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" | |
- name: Environment ID and Custom URL command | |
id: test_environment_id_custom_url | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
description: foo bar | |
environment_id: 117 | |
custom_url: https://something.com | |
release: '1.0' | |
dry_run: true | |
- name: Environment ID and Custom URL test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_environment_id_custom_url.outputs.command }} | |
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" | |
- name: Branch command | |
id: test_branch | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
description: foo bar | |
branch: feature-branch | |
release: '1.0' | |
dry_run: true | |
- name: Branch test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_branch.outputs.command }} | |
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" | |
- name: Quoted parameters command | |
id: test_quoted_parameters | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
description: something"exit 1 | |
branch: some name"exit 2 | |
release: some sha"exit 3 | |
dry_run: true | |
- name: Quoted parameters test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_quoted_parameters.outputs.command }} | |
expected: run --skip-update --token "test_token" --run-group 42 --junit-file results/rainforest/junit.xml --save-run-id .rainforest_run_id --branch "some name\"exit 2" --description "something\"exit 1" --release "some sha\"exit 3" | |
- name: Missing token command | |
id: test_missing_token | |
uses: ./ | |
with: | |
dry_run: true | |
continue-on-error: true | |
- name: Missing token test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_missing_token.outputs.error }} | |
expected: Token not set | |
- name: Invalid run group command | |
id: test_invalid_run_group | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: nike | |
dry_run: true | |
continue-on-error: true | |
- name: Invalid run group test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_invalid_run_group.outputs.error }} | |
expected: run_group_id not a positive integer (nike) | |
- name: Invalid environment ID command | |
id: test_invalid_environment_id | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
environment_id: hostile | |
dry_run: true | |
continue-on-error: true | |
- name: Invalid environment ID test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_invalid_environment_id.outputs.error }} | |
expected: environment_id not a positive integer (hostile) | |
- name: Invalid conflict command | |
id: test_invalid_conflict | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
conflict: WWIII | |
dry_run: true | |
continue-on-error: true | |
- name: Invalid conflict test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_invalid_conflict.outputs.error }} | |
expected: WWIII not in (cancel cancel-all) | |
- name: Invalid execution_method command | |
id: test_invalid_execution_method | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
execution_method: sarlacc_pit | |
dry_run: true | |
continue-on-error: true | |
- name: Invalid execution_method test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_invalid_execution_method.outputs.error }} | |
expected: sarlacc_pit not in (automation crowd automation_and_crowd on_premise) | |
- name: Invalid crowd command | |
id: test_invalid_crowd | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
crowd: hipsters | |
dry_run: true | |
continue-on-error: true | |
- name: Invalid crowd test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_invalid_crowd.outputs.error }} | |
expected: hipsters not in (default automation automation_and_crowd on_premise_crowd) | |
- name: Invalid automation max retries command | |
id: test_invalid_automation_max_retries | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
automation_max_retries: infinite | |
dry_run: true | |
continue-on-error: true | |
- name: Invalid automation max retries test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_invalid_automation_max_retries.outputs.error }} | |
expected: automation_max_retries not a positive integer (infinite) | |
- name: Invalid parameter generic test | |
uses: ./.github/actions/test | |
with: | |
each: true | |
actual: |- | |
${{ steps.test_missing_token.outcome }} | |
${{ steps.test_invalid_run_group.outcome }} | |
${{ steps.test_invalid_environment_id.outcome }} | |
${{ steps.test_invalid_conflict.outcome }} | |
${{ steps.test_invalid_execution_method.outcome }} | |
${{ steps.test_invalid_crowd.outcome }} | |
${{ steps.test_invalid_automation_max_retries.outcome }} | |
expected: failure | |
- name: Rerun test setup | |
run: | | |
echo "343" > .rainforest_run_id | |
- name: Rerun command | |
id: test_rerun | |
uses: ./ | |
with: | |
token: test_token | |
run_group_id: 42 | |
environment_id: 117 | |
description: foo bar | |
conflict: cancel | |
execution_method: automation | |
release: '1.0' | |
background: true | |
dry_run: true | |
- name: Rerun test | |
uses: ./.github/actions/test | |
with: | |
actual: ${{ steps.test_rerun.outputs.command }} | |
expected: rerun "343" --skip-update --token "test_token" --junit-file results/rainforest/junit.xml --save-run-id .rainforest_run_id --conflict cancel --release "1.0" --background |