Skip to content

Commit a8cb8de

Browse files
authored
chore: Supports running Test Suite in QA on sundays (#2711)
* Revert "chore: Use `qa` for TestSuite on Sundays (#2701)" This reverts commit 942e097. * chore: Supports running qa only on Sundays * address PR comments * refactor: move job to steps of variables * chore: Add top level description
1 parent 90d2224 commit a8cb8de

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

.github/workflows/terraform-compatibility-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
uses: ./.github/workflows/test-suite.yml
4848
with:
4949
terraform_matrix: '["${{ matrix.terraform_version }}"]'
50-
atlas_cloud_env: ${{ inputs.atlas_cloud_env }}
50+
atlas_cloud_env: ${{ inputs.atlas_cloud_env || 'dev' }}
5151
send_notification: false
5252

5353
slack-notification:

.github/workflows/test-suite.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: 'Test Suite'
22

3-
# Runs acceptance and migrations tests with a set of terraform versions and provider versions (used for migration tests). This worflow is scheduled daily except Saturdays, but can also be run manually.
3+
# Runs acceptance and migrations tests with a set of terraform versions and provider versions (used for migration tests).
4+
# This worflow is scheduled daily and runs against dev every day except for Sunday when we run against QA. It can also be run manually.
5+
# The 1st day of the month we run terraform-compatibility-matrix.yml and therefore, we skip the test-suite (see shedule->cron below).
46
on:
57
workflow_dispatch:
68
inputs:
@@ -33,47 +35,47 @@ on:
3335
default: true
3436

3537
schedule:
36-
# https://crontab.guru/#0_0_2-31_*_0
37-
- cron: "0 0 2-31 * 1-6" # workflow runs at 00:00 on every day-of-month from 2 through 31 and on every day-of-week from Monday through Saturday.
38-
- cron: "0 0 2-31 * 0" # workflow runs at 00:00 on every day-of-month from 2 through 31 and on Sunday.
39-
38+
- cron: "0 0 2-31 * *" # workflow runs every day at midnight UTC except on the first day of the month
4039
concurrency:
4140
group: '${{ github.workflow }}'
4241
cancel-in-progress: false
4342

4443
jobs:
45-
versions:
44+
variables:
4645
env:
4746
schedule_terraform_matrix: '["${{ vars.TF_VERSION_LATEST }}"]'
4847
schedule_provider_matrix: '[""]' # "" for latest version
4948
runs-on: ubuntu-latest
5049
outputs:
5150
terraform_matrix: ${{ inputs.terraform_matrix || env.schedule_terraform_matrix }}
5251
provider_matrix: ${{ inputs.provider_matrix || env.schedule_provider_matrix }}
52+
day: ${{ steps.set_day.outputs.DAY }}
5353
steps:
54-
- if: false
55-
run: echo jobs need steps
56-
54+
- name: set day
55+
id: set_day
56+
run: |
57+
echo "DAY=$(date +'%a')"
58+
echo "DAY=$(date +'%a')" >> "$GITHUB_OUTPUT"
5759
clean-before:
5860
secrets: inherit
5961
uses: ./.github/workflows/cleanup-test-env.yml
6062

6163
tests:
62-
needs: [clean-before, versions]
64+
needs: [clean-before, variables]
6365
if: ${{ !cancelled() }}
6466
strategy:
6567
max-parallel: 1
6668
fail-fast: false
6769
matrix:
68-
terraform_version: ${{ fromJSON(needs.versions.outputs.terraform_matrix) }}
69-
provider_version: ${{ fromJSON(needs.versions.outputs.provider_matrix) }}
70+
terraform_version: ${{ fromJSON(needs.variables.outputs.terraform_matrix) }}
71+
provider_version: ${{ fromJSON(needs.variables.outputs.provider_matrix) }}
7072
name: tests-${{ matrix.terraform_version || 'latest' }}-${{ matrix.provider_version || 'latest' }}
7173
secrets: inherit
7274
uses: ./.github/workflows/acceptance-tests.yml
7375
with:
7476
terraform_version: ${{ matrix.terraform_version }}
7577
provider_version: ${{ matrix.provider_version }}
76-
atlas_cloud_env: ${{ inputs.atlas_cloud_env || github.event.schedule == '0 0 2-31 * 0' && 'qa' || 'dev' }}
78+
atlas_cloud_env: ${{ inputs.atlas_cloud_env || needs.variables.outputs.day == 'Sun' && 'qa' }}
7779

7880
clean-after:
7981
needs: tests

0 commit comments

Comments
 (0)