diff --git a/.github/workflows/cicd-dev-acc.yml b/.github/workflows/cicd-dev-acc.yml new file mode 100644 index 00000000..962477da --- /dev/null +++ b/.github/workflows/cicd-dev-acc.yml @@ -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 diff --git a/.github/workflows/dev-acc.yml b/.github/workflows/dev-acc.yml index c95a9765..8316ea06 100644 --- a/.github/workflows/dev-acc.yml +++ b/.github/workflows/dev-acc.yml @@ -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: @@ -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 @@ -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 }} diff --git a/acc-dev-testcases/data-sources/network_type.yaml b/acc-dev-testcases/data-sources/network_type.yaml index 64e4dc66..2352509b 100644 --- a/acc-dev-testcases/data-sources/network_type.yaml +++ b/acc-dev-testcases/data-sources/network_type.yaml @@ -1,3 +1,3 @@ acc: - config: | - name = "NSX" + name = "NSX Segment"