diff --git a/.github/workflows/cicd-dev-acc.yml b/.github/workflows/cicd-dev-acc.yml index fcbe6a6b..f6d2e9b0 100644 --- a/.github/workflows/cicd-dev-acc.yml +++ b/.github/workflows/cicd-dev-acc.yml @@ -1,4 +1,5 @@ name: IaC Acceptance Tests for CI CD Dev Environment +# This workflow runs all the acc-dev-testcases on: workflow_dispatch: diff --git a/.github/workflows/dev-acc.yml b/.github/workflows/dev-acc.yml index c3264d27..2a695e35 100644 --- a/.github/workflows/dev-acc.yml +++ b/.github/workflows/dev-acc.yml @@ -1,4 +1,6 @@ -name: Dev Acceptance Testing for running an individual or all tests +name: Dev Acceptance Testing +# This workflow is intended to run a particular set of testcases +# If want to execute all test, consider running cicd-dev-acc.yml on: # Runs every 2 days once at 3AM @@ -8,14 +10,14 @@ on: workflow_dispatch: inputs: test_case: - description: 'Enter testcases sperated by space. Leave empty for all' - required: false - default: '' + description: 'Enter testcases sperated by space' + required: true + default: 'TestProvider' type: string test_description: description: 'Enter description for the test' required: true - default: 'Check all Terraform Dev Testcases' + default: 'Check Terraform Dev Testcase' type: string jobs: diff --git a/.github/workflows/reusable-dev-acc.yml b/.github/workflows/reusable-dev-acc.yml index 295d607e..f202b0d7 100644 --- a/.github/workflows/reusable-dev-acc.yml +++ b/.github/workflows/reusable-dev-acc.yml @@ -73,14 +73,18 @@ jobs: run: | echo "Run Date: $(date +'%Y-%m-%d Time: %H:%M:%S %z' )" >> "$LOG_FILE" JOB_FAILED=false - for t in ${{ inputs.test_case }}; do - if ! (export TF_ACC_TEST_PATH="$(pwd)/${{ inputs.test_case_folder }}" && make acceptance case="$t" >> "$LOG_FILE") - then - JOB_FAILED=true - continue - fi - done - if $JOB_FAILED; then exit 1; fi + if [ ${{ inputs.test_case }} != "" ]; then + for t in ${{ inputs.test_case }}; do + if ! (export TF_ACC_TEST_PATH="$(pwd)/${{ inputs.test_case_folder }}" && make acceptance case="$t" >> "$LOG_FILE") + then + JOB_FAILED=true + continue + fi + done + if $JOB_FAILED; then exit 1; fi + else + export TF_ACC_TEST_PATH="$(pwd)/${{ inputs.test_case_folder }}" && make acceptance >> "$LOG_FILE" + fi - name: Print testcases output