From eda2e349d1ead06909b6b69b4818b4211e32de78 Mon Sep 17 00:00:00 2001 From: Jeremy Udit Date: Fri, 7 Jan 2022 12:51:30 -0500 Subject: [PATCH] test: add manual test runs (#1026) * test: add manual test runs * fixup! debug on push * fixup! add for individual auth case * fixup! add support for org auth * fixup! schedule full runs weekly * fixup! stricter label filter --- .../workflows/dotcom-acceptance-tests-all.yml | 2 +- .../dotcom-acceptance-tests-manual.yml | 109 ++++++++++++++++++ .../workflows/ghes-acceptance-tests-all.yml | 2 +- 3 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/dotcom-acceptance-tests-manual.yml diff --git a/.github/workflows/dotcom-acceptance-tests-all.yml b/.github/workflows/dotcom-acceptance-tests-all.yml index 6285339da7..8828928546 100644 --- a/.github/workflows/dotcom-acceptance-tests-all.yml +++ b/.github/workflows/dotcom-acceptance-tests-all.yml @@ -8,7 +8,7 @@ on: # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) # * * * * * - - cron: '0 0 * * *' + - cron: '0 0 * * 3' jobs: diff --git a/.github/workflows/dotcom-acceptance-tests-manual.yml b/.github/workflows/dotcom-acceptance-tests-manual.yml new file mode 100644 index 0000000000..4a9acaa122 --- /dev/null +++ b/.github/workflows/dotcom-acceptance-tests-manual.yml @@ -0,0 +1,109 @@ +name: Dotcom Acceptance Tests (manual) + +on: + pull_request: + types: [labeled] + +jobs: + + acceptance-tests-anonymous: + runs-on: ubuntu-latest + if: contains(join(github.event.pull_request.labels.*.name, ', '), 'test/') + steps: + - name: Parse Args + id: args + run: | + echo "::set-output name=run_allowed::$( + jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2 + )" + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 2 + - name: Acceptance Tests (Anonymous) + id: acceptance-tests-anonymous + uses: terraformtesting/acceptance-tests@v2.2.0 + with: + TF_LOG: INFO + RUN_ALLOWED: ${{ steps.args.outputs.run_allowed }} + - name: Failed Acceptance Tests (Anonymous) + if: ${{ failure() }} + uses: terraformtesting/acceptance-tests@v2.2.0 + with: + TF_LOG: DEBUG + RUN_ALLOWED: ${{ steps.acceptance-tests-anonymous.outputs.run_allowed }} + + + acceptance-tests-individual: + runs-on: ubuntu-latest + if: contains(join(github.event.pull_request.labels.*.name, ', '), 'test') + steps: + - name: Parse Args + id: args + run: | + echo "::set-output name=run_allowed::$( + jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2 + )" + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 2 + - name: Acceptance Tests (Individual) + id: acceptance-tests-individual + uses: terraformtesting/acceptance-tests@v2.2.0 + with: + TF_LOG: INFO + RUN_ALLOWED: ${{ steps.args.outputs.run_allowed }} + GITHUB_OWNER: github-terraform-test-user + GITHUB_TEST_USER_TOKEN: ${{ secrets.DOTCOM_TEST_USER_TOKEN }} + GITHUB_TEST_ORGANIZATION: terraformtesting + - name: Failed Acceptance Tests (Individual) + if: ${{ failure() }} + uses: terraformtesting/acceptance-tests@v2.2.0 + with: + TF_LOG: DEBUG + RUN_ALLOWED: ${{ steps.args.outputs.run_allowed }} + GITHUB_OWNER: github-terraform-test-user + GITHUB_TEST_USER_TOKEN: ${{ secrets.DOTCOM_TEST_USER_TOKEN }} + GITHUB_TEST_ORGANIZATION: terraformtesting + + acceptance-tests-organization: + runs-on: ubuntu-latest + if: contains(join(github.event.pull_request.labels.*.name, ', '), 'test') + steps: + - name: Parse Args + id: args + run: | + echo "::set-output name=run_allowed::$( + jq -rc .label.name $GITHUB_EVENT_PATH | cut -d/ -f 2 + )" + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 2 + + - name: Acceptance Tests (Organization) + id: acceptance-tests-organization + uses: terraformtesting/acceptance-tests@v2.2.0 + with: + TF_LOG: INFO + RUN_ALLOWED: ${{ steps.args.outputs.run_allowed }} + GITHUB_ORGANIZATION: terraformtesting + GITHUB_TEST_USER_TOKEN: ${{ secrets.DOTCOM_TEST_USER_TOKEN }} + GITHUB_TEST_OWNER: github-terraform-test-user + + - name: Failed Acceptance Tests (Organization) + uses: terraformtesting/acceptance-tests@v2.2.0 + if: ${{ failure() }} + with: + TF_LOG: DEBUG + RUN_ALLOWED: ${{ steps.args.outputs.run_allowed }} + GITHUB_ORGANIZATION: terraformtesting + GITHUB_TEST_USER_TOKEN: ${{ secrets.DOTCOM_TEST_USER_TOKEN }} + GITHUB_TEST_OWNER: github-terraform-test-user + + + diff --git a/.github/workflows/ghes-acceptance-tests-all.yml b/.github/workflows/ghes-acceptance-tests-all.yml index 2b0d758036..e889c22f17 100644 --- a/.github/workflows/ghes-acceptance-tests-all.yml +++ b/.github/workflows/ghes-acceptance-tests-all.yml @@ -8,7 +8,7 @@ on: # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) # * * * * * - - cron: '0 0 * * *' + - cron: '0 0 * * 3' jobs: runtime: