[RUN ACC] add tags to be able to run acc test on pr

main
Martin Guibert 2021-05-31 17:32:16 +02:00
parent ea8e1c5aa5
commit 66ad988342
2 changed files with 23 additions and 1 deletions

View File

@ -24,6 +24,7 @@ jobs:
CHECKPOINT_DISABLE: true # Disable terraform version check
steps:
- checkout
- run: ./scripts/halt_before_acc.sh
- go/install:
version: "1.16.2"
# Disable cache at it seem to broke go 1.16 installation
@ -180,7 +181,9 @@ workflows:
pattern:
- TestAcc_Aws
- TestAcc_Github_
context: driftctl-acc
context:
- driftctl-acc
- nigthly
triggers:
- schedule:
cron: "0 3 * * *"
@ -200,6 +203,15 @@ workflows:
branches:
ignore:
- main
- test_acc:
name: "Acceptance tests: << matrix.pattern >>"
matrix:
parameters:
pattern:
- TestAcc_Aws
- TestAcc_Github_
context:
- driftctl-acc
push:
jobs:
- test:

10
scripts/halt_before_acc.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
COMMIT_MESSAGE="$(git log --format=oneline -n 1 $CIRCLE_SHA1)"
if [[ $COMMIT_MESSAGE == *"[RUN ACC]"* ]] || [[ $FORCE_ACC_TEST == "true" ]]; then
# If user is not member of core team, context is not applie so acc test won't run anyway
echo "Running acceptance tests"
else
circleci-agent step halt
fi