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

test: add manual test runs #1026

Merged
merged 6 commits into from
Jan 7, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/dotcom-acceptance-tests-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the goal on this change to save on rate limits? Overall GitHub resources/churn?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!


jobs:

Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/dotcom-acceptance-tests-manual.yml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what's the reason for fetch-depth: 2 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will revisit here with more context, seems architectural though.

- name: Acceptance Tests (Anonymous)
id: acceptance-tests-anonymous
uses: terraformtesting/[email protected]
with:
TF_LOG: INFO
RUN_ALLOWED: ${{ steps.args.outputs.run_allowed }}
- name: Failed Acceptance Tests (Anonymous)
if: ${{ failure() }}
uses: terraformtesting/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]
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



2 changes: 1 addition & 1 deletion .github/workflows/ghes-acceptance-tests-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down