Skip to content

Commit

Permalink
improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-hpe committed Jan 3, 2024
1 parent 99ea557 commit 79a24a6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cicd-dev-acc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: IaC Acceptance Tests for CI CD Dev Environment
# This workflow runs all the acc-dev-testcases

on:
workflow_dispatch:
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/dev-acc.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/reusable-dev-acc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 79a24a6

Please sign in to comment.