name acc test check step

& use parameter as force var env
main
Martin Guibert 2021-06-01 15:42:51 +02:00
parent 66ad988342
commit a693499c0d
2 changed files with 10 additions and 2 deletions

View File

@ -14,17 +14,23 @@ jobs:
- bin/ - bin/
test_acc: test_acc:
parameters: parameters:
force_acc_test:
type: boolean
default: false
pattern: pattern:
type: string type: string
machine: machine:
image: ubuntu-2004:202010-01 image: ubuntu-2004:202010-01
environment: environment:
FORCE_ACC_TEST: << parameters.force_acc_test >>
ACC_PATTERN: << parameters.pattern >> ACC_PATTERN: << parameters.pattern >>
AWS_DEFAULT_REGION: us-east-1 AWS_DEFAULT_REGION: us-east-1
CHECKPOINT_DISABLE: true # Disable terraform version check CHECKPOINT_DISABLE: true # Disable terraform version check
steps: steps:
- checkout - checkout
- run: ./scripts/halt_before_acc.sh - run:
name: Check if acceptance tests should run
command: ./scripts/halt_before_acc.sh
- go/install: - go/install:
version: "1.16.2" version: "1.16.2"
# Disable cache at it seem to broke go 1.16 installation # Disable cache at it seem to broke go 1.16 installation
@ -178,12 +184,13 @@ workflows:
name: "Acceptance tests: << matrix.pattern >>" name: "Acceptance tests: << matrix.pattern >>"
matrix: matrix:
parameters: parameters:
force_acc_test:
- true
pattern: pattern:
- TestAcc_Aws - TestAcc_Aws
- TestAcc_Github_ - TestAcc_Github_
context: context:
- driftctl-acc - driftctl-acc
- nigthly
triggers: triggers:
- schedule: - schedule:
cron: "0 3 * * *" cron: "0 3 * * *"

View File

@ -6,5 +6,6 @@ if [[ $COMMIT_MESSAGE == *"[RUN ACC]"* ]] || [[ $FORCE_ACC_TEST == "true" ]]; th
# If user is not member of core team, context is not applie so acc test won't run anyway # If user is not member of core team, context is not applie so acc test won't run anyway
echo "Running acceptance tests" echo "Running acceptance tests"
else else
echo "Not running acceptance tests"
circleci-agent step halt circleci-agent step halt
fi fi