From bc833959de807bafde455bd3a48a28e07b4b1c26 Mon Sep 17 00:00:00 2001 From: macnev2013 Date: Thu, 12 Jan 2023 22:43:06 +0530 Subject: [PATCH 1/8] updated: workflow to support caching --- .github/workflows/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 21ef7c3..3560705 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,14 +24,14 @@ jobs: with: submodules: 'true' - id: set-matrix - run: echo "matrix=$(python get-services.py ${{ github.event.inputs.services || 'ls-community' }})" >> $GITHUB_OUTPUT + run: echo "matrix=$(python get-services.py ${{ github.event.inputs.services || 'acm' }})" >> $GITHUB_OUTPUT outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} test_service: needs: prepare_list strategy: - max-parallel: 10 +# max-parallel: 10 fail-fast: false matrix: service: ${{ fromJson(needs.prepare_list.outputs.matrix) }} @@ -46,11 +46,14 @@ jobs: - uses: actions/setup-go@v3 with: go-version: 1.18.x + cache: true + cache-dependency-path: terraform-provider-aws/go.mod - name: Set up Python 3.10.5 uses: actions/setup-python@v4 with: python-version: '3.10.5' + cache: 'pip' - name: Install system dependencies run: | From 56c4fe84d8e4eee426cbe3c86c62f488fcac2871 Mon Sep 17 00:00:00 2001 From: macnev2013 Date: Thu, 12 Jan 2023 22:47:16 +0530 Subject: [PATCH 2/8] fix: branch name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3560705..2de5afe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ on: description: localstack docker image name to test against push: branches: - - pytest-plugin + - pytest-plugin-fork name: Terraform Tests jobs: From 244cd9f3ebc18890ca15e23b55336ffb18a5d109 Mon Sep 17 00:00:00 2001 From: macnev2013 Date: Thu, 12 Jan 2023 23:09:55 +0530 Subject: [PATCH 3/8] added: schedule for workflow --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2de5afe..68554bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,7 @@ on: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '0 19 * * 6' workflow_dispatch: inputs: services: From 11c972c9049241ad22d1a2a2f8b605690ef1de27 Mon Sep 17 00:00:00 2001 From: macnev2013 Date: Thu, 12 Jan 2023 23:24:52 +0530 Subject: [PATCH 4/8] workflow run: all services --- .github/workflows/main.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 68554bd..b660fc5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: with: submodules: 'true' - id: set-matrix - run: echo "matrix=$(python get-services.py ${{ github.event.inputs.services || 'acm' }})" >> $GITHUB_OUTPUT + run: echo "matrix=$(python get-services.py ${{ github.event.inputs.services || 'ls-community' }})" >> $GITHUB_OUTPUT outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -48,15 +48,12 @@ jobs: - uses: actions/setup-go@v3 with: - go-version: 1.18.x - cache: true - cache-dependency-path: terraform-provider-aws/go.mod + go-version: '1.18.x' - name: Set up Python 3.10.5 uses: actions/setup-python@v4 with: python-version: '3.10.5' - cache: 'pip' - name: Install system dependencies run: | From 379cb9a727d51924bf7579dd6d06e9eff6bc2e6c Mon Sep 17 00:00:00 2001 From: macnev2013 Date: Fri, 13 Jan 2023 00:38:31 +0530 Subject: [PATCH 5/8] fix: dependancy caching in go --- .github/workflows/main.yml | 5 ++++- requirements.txt | 9 ++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b660fc5..3198f5a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: with: submodules: 'true' - id: set-matrix - run: echo "matrix=$(python get-services.py ${{ github.event.inputs.services || 'ls-community' }})" >> $GITHUB_OUTPUT + run: echo "matrix=$(python get-services.py ${{ github.event.inputs.services || 'acm' }})" >> $GITHUB_OUTPUT outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -49,11 +49,14 @@ jobs: - uses: actions/setup-go@v3 with: go-version: '1.18.x' + cache: true + cache-dependency-path: terraform-provider-aws/go.sum - name: Set up Python 3.10.5 uses: actions/setup-python@v4 with: python-version: '3.10.5' + cache: 'pip' - name: Install system dependencies run: | diff --git a/requirements.txt b/requirements.txt index cbf71bd..12240bb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ -click -pytest -docker -requests -pytest-xdist +click==8.1.3 +pytest==7.2.0 +docker==6.0.1 +requests==2.28.2 From 9d0a32c9c2097db66c62c98ed28850528ff37843 Mon Sep 17 00:00:00 2001 From: macnev2013 Date: Fri, 13 Jan 2023 01:19:08 +0530 Subject: [PATCH 6/8] updated: changed the service to check caching --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3198f5a..0676f55 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: with: submodules: 'true' - id: set-matrix - run: echo "matrix=$(python get-services.py ${{ github.event.inputs.services || 'acm' }})" >> $GITHUB_OUTPUT + run: echo "matrix=$(python get-services.py ${{ github.event.inputs.services || 'sts' }})" >> $GITHUB_OUTPUT outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -78,7 +78,6 @@ jobs: - name: Run ${{ matrix.service }} Tests run: | - echo "::remove-matcher owner=python::" pytest --junitxml=target/reports/pytest.xml terraform-provider-aws/internal/service/${{ matrix.service }} -s -v --ls-start --ls-image ${{ github.event.inputs.localstack-image || 'localstack/localstack:latest' }} - name: Publish ${{ matrix.service }} Test Results From a09659a5446e901f2c924d4095000db7f5fb6d6e Mon Sep 17 00:00:00 2001 From: macnev2013 Date: Fri, 13 Jan 2023 01:45:48 +0530 Subject: [PATCH 7/8] removed: comment from gh workflow --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0676f55..80fa951 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,5 @@ on: schedule: - # * is a special character in YAML so you have to quote this string - cron: '0 19 * * 6' workflow_dispatch: inputs: From 67954ad02bf3e112fc00b252adba6128fceea78e Mon Sep 17 00:00:00 2001 From: macnev2013 Date: Fri, 13 Jan 2023 14:22:23 +0530 Subject: [PATCH 8/8] updated: workflow finalization --- .github/workflows/main.yml | 11 ++++++----- conftest.py | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 80fa951..f5f0541 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,9 +12,10 @@ on: type: string default: 'localstack/localstack:latest' description: localstack docker image name to test against - push: - branches: - - pytest-plugin-fork +# disabled pipeline for push events, as we want to run the pipeline only on a schedule or manually +# push: +# branches: +# - pytest-plugin-fork name: Terraform Tests jobs: @@ -26,14 +27,14 @@ jobs: with: submodules: 'true' - id: set-matrix - run: echo "matrix=$(python get-services.py ${{ github.event.inputs.services || 'sts' }})" >> $GITHUB_OUTPUT + run: echo "matrix=$(python get-services.py ${{ github.event.inputs.services || 'ls-community' }})" >> $GITHUB_OUTPUT outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} test_service: needs: prepare_list strategy: -# max-parallel: 10 + max-parallel: 10 fail-fast: false matrix: service: ${{ fromJson(needs.prepare_list.outputs.matrix) }} diff --git a/conftest.py b/conftest.py index 8cc058c..f6fcfe4 100644 --- a/conftest.py +++ b/conftest.py @@ -48,6 +48,7 @@ def runtest(self): 'AWS_DEFAULT_REGION': 'us-west-2', 'AWS_ALTERNATE_ACCESS_KEY_ID': 'test', 'AWS_ALTERNATE_SECRET_ACCESS_KEY': 'test', + 'AWS_ALTERNATE_SECRET_ACCESS_KEY': 'test', 'AWS_ALTERNATE_REGION': 'us-east-2', 'AWS_THIRD_REGION': 'eu-west-1', })