Don't run e2e tests on fork PRs.

This commit is contained in:
Luke Kysow
2018-03-16 13:06:04 -07:00
parent 566febeec4
commit 48763e7345
2 changed files with 18 additions and 23 deletions

View File

@@ -5,7 +5,7 @@ jobs:
docker:
- image: circleci/golang:1.10
environment:
TERRAFORM_VERSION: 0.10.8
TERRAFORM_VERSION: 0.11.4
steps:
- checkout
- setup_remote_docker:
@@ -17,23 +17,8 @@ jobs:
name: post coverage to codecov.io
command: bash <(curl -s https://codecov.io/bash)
- run: make build-service
- run:
name: Install e2e dependencies
command: make end-to-end-deps
- run:
name: Starting atlantis server in the background
command: cd "${CIRCLE_WORKING_DIRECTORY}/e2e" && ./atlantis server --gh-user="$GITHUB_USERNAME" --gh-token="$GITHUB_PASSWORD" --data-dir="/tmp" --log-level="debug" --repo-whitelist="github.com/runatlantis/atlantis-tests" &> /tmp/atlantis-server.log
background: true
- run: sleep 2
- run:
name: Starting ngrok
command: cd "${CIRCLE_WORKING_DIRECTORY}/e2e" && ./ngrok http 4141 > /tmp/ngrok.log
background: true
- run: sleep 2
- run: echo "export ATLANTIS_URL=$(curl -s 'http://localhost:4040/api/tunnels' | jq -r '.tunnels[] | select(.proto=="http") | .public_url')" >> $BASH_ENV
- run:
name: Run e2e tests
command: make end-to-end-tests
# We don't run e2e tests on fork PRs because they don't have access to the secret env vars.
- run: if [ -z "${CIRCLE_PR_REPONAME}" ]; then ./scripts/e2e.sh; fi
- run:
name: Build image
command: |

View File

@@ -3,20 +3,30 @@
set -euo pipefail
IFS=$'\n\t'
cd e2e/
# download all the tooling needed for e2e tests
${CIRCLE_WORKING_DIRECTORY}/scripts/e2e-deps.sh
cd "${CIRCLE_WORKING_DIRECTORY}/e2e"
# Download dependencies
# start atlantis server in the background and wait for it to start
./atlantis server --gh-user="$GITHUB_USERNAME" --gh-token="$GITHUB_PASSWORD" --data-dir="/tmp" --log-level="debug" --repo-whitelist="github.com/runatlantis/atlantis-tests" &> /tmp/atlantis-server.log &
sleep 2
# start ngrok in the background and wait for it to start
./ngrok http 4141 > /tmp/ngrok.log &
sleep 2
# find out what URL ngrok has given us
export ATLANTIS_URL=$(curl -s 'http://localhost:4040/api/tunnels' | jq -r '.tunnels[] | select(.proto=="http") | .public_url')
# Now we can start the e2e tests
echo "Running 'make deps'"
make deps
# Run tests
echo "Running 'make test'"
make test
# Build packages to make sure they can be compiled
echo "Running 'make build'"
make build
# Run e2e tests
echo "Running e2e test: 'make run'"
make run