Skip to content

Commit

Permalink
Merge pull request #213 from HewlettPackard/cicd-acc
Browse files Browse the repository at this point in the history
US56815: Add IaC test case for CI CD purpose
  • Loading branch information
manjunath-batakurki authored Dec 20, 2023
2 parents 71041d6 + 39eea07 commit 46a7d25
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 8 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/cicd-dev-acc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Dev Acceptance Tests for CI CD

on:
workflow_dispatch:

jobs:
test-provider:
uses: ./.github/workflows/dev-acc.yml
with:
test_case: TestProvider
secrets: inherit

test-datasouces:
needs:
- test-provider
if: "${{ always() && needs.test-provider.result != 'failed' }}"
uses: ./.github/workflows/dev-acc.yml
with:
test_case: TestAccDataSource
secrets: inherit

test-vmaas-instance:
uses: ./.github/workflows/dev-acc.yml
with:
test_case: TestVmaasInstance
secrets: inherit
25 changes: 18 additions & 7 deletions .github/workflows/dev-acc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Test scenario tags'
test_case:
description: 'Enter testcase'
required: false
default: ''
type: string

# release:
# types: [published]
env:
Expand All @@ -24,6 +24,7 @@ env:
HPEGL_VMAAS_LOCATION: ${{ secrets.DEV_HPEGL_VMAAS_LOCATION }}
HPEGL_VMAAS_SPACE_NAME: ${{ secrets.DEV_HPEGL_VMAAS_SPACE_NAME}}
TF_ACC: ${{ secrets.TF_ACC }}
LOG_FILE: "${{ github.event.inputs.test_case }}Logs.txt"
jobs:
acc:
runs-on: ubuntu-20.04
Expand All @@ -49,4 +50,14 @@ jobs:

- name: Run Acceptance test
run: |
export TF_ACC_TEST_PATH="$(pwd)/acc-dev-testcases" && make acceptance
echo "Run Date: $(date +'%Y-%m-%d Time: %H:%M:%S %z' )" >> $LOG_FILE
export TF_ACC_TEST_PATH="$(pwd)/acc-dev-testcases" && make acceptance case='${{ github.event.inputs.test_case }}' >> $LOG_FILE
- name: Print testcases output
run: cat $LOG_FILE

- name: Push the report to github artifacts
uses: actions/upload-artifact@v3
with:
name: "Terraform Test report: ${{ github.event.inputs.test_case }}"
path: ${{ env.LOG_FILE }}
2 changes: 1 addition & 1 deletion acc-dev-testcases/data-sources/network_type.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
acc:
- config: |
name = "NSX"
name = "NSX Segment"

0 comments on commit 46a7d25

Please sign in to comment.