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

feat(e2e): migrate off circleci #4576

Merged
merged 10 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
30 changes: 0 additions & 30 deletions .circleci/config.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,41 @@ jobs:
runs-on: ubuntu-22.04
steps:
- run: 'echo "No build required"'

e2e:
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
# dont run e2e tests on forked PRs
if: github.repository == 'runatlantis/atlantis'
env:
TERRAFORM_VERSION: 1.8.3
GITHUB_USERNAME: ${{ secrets.ATLANTISBOT_GITHUB_USERNAME }}
GITHUB_PASSWORD: ${{ secrets.ATLANTISBOT_GITHUB_PASSWORD }}
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
NGROK_AUTH_TOKEN: ${{ secrets.ATLANTISBOT_NGROK_AUTH_TOKEN }}
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
with:
go-version-file: go.mod

# This version of TF will be downloaded before Atlantis is started.
# We do this instead of setting --default-tf-version because setting
# that flag starts the download asynchronously so we'd have a race
# condition.
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
- uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3
with:
terraform_version: 1.8.3
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved

- name: Setup deps
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
run: |
wget -q -nc https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz
tar -xzf ngrok-v3-stable-linux-amd64.tgz && \
chmod +x ngrok
./ngrok --help
- name: Setup gitconfig
run: |
git config --global user.email "[email protected]"
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
git config --global user.name "atlantisbot"

- run: |
make build-service
./scripts/e2e.sh
3 changes: 0 additions & 3 deletions e2e/.gitconfig

This file was deleted.

28 changes: 0 additions & 28 deletions scripts/e2e-deps.sh

This file was deleted.

13 changes: 6 additions & 7 deletions scripts/e2e.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
IFS=$'\n\t'

# download all the tooling needed for e2e tests
CIRCLE_WORKING_DIRECTORY="${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}" # https://discuss.circleci.com/t/circle-working-directory-doesnt-expand/17007/5
${CIRCLE_WORKING_DIRECTORY}/scripts/e2e-deps.sh
cd "${CIRCLE_WORKING_DIRECTORY}/e2e"

# start atlantis server in the background and wait for it to start
./atlantis server \
--gh-user="$GITHUB_USERNAME" \
Expand All @@ -19,15 +13,20 @@ cd "${CIRCLE_WORKING_DIRECTORY}/e2e"
&> /tmp/atlantis-server.log &
sleep 2

echo "Started atlantis server"

# start ngrok in the background and wait for it to start
./ngrok config add-authtoken $NGROK_AUTH_TOKEN
./ngrok http 4141 > /tmp/ngrok.log &
sleep 2
sleep 4

# find out what URL ngrok has given us
export ATLANTIS_URL=$(curl -s 'http://localhost:4040/api/tunnels' | jq -r '.tunnels[] | select(.proto=="https") | .public_url')

echo "ATLANTIS_URL is $ATLANTIS_URL"

# Now we can start the e2e tests
cd "${GITHUB_WORKSPACE}/e2e"
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved
echo "Running 'make build'"
make build

Expand Down
Loading