Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

US56815: Add IaC test case for CI CD purpose #213

Merged
merged 6 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading