From c663be424787edf3de909f13bcc0c1e923a2952d Mon Sep 17 00:00:00 2001 From: Anubhav Mishra Date: Thu, 10 Aug 2017 21:17:50 -0700 Subject: [PATCH] Adding e2e tests back and upgrading terraform version 0.9.11 (#113) * Adding e2e tests back and upgrading terraform version 0.9.11 * Fixing the binary name for e2e tests * revert binary name change * missed indentation for makefile * use owner name for branch head for pull request creation --- circle.yml | 29 ++++++++++++++--------------- e2e/Makefile | 1 + e2e/e2e.go | 2 +- scripts/e2e.sh | 4 ---- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/circle.yml b/circle.yml index f7cd5d001..c4c13f225 100644 --- a/circle.yml +++ b/circle.yml @@ -3,7 +3,7 @@ machine: environment: GOPATH: "${HOME}/.go_workspace" WORKDIR: "${GOPATH}/src/github.com/hootsuite/atlantis" - TERRAFORM_VERSION: 0.8.8 + TERRAFORM_VERSION: 0.9.11 dependencies: pre: @@ -22,17 +22,16 @@ test: # Run tests - cd "${WORKDIR}" && ./scripts/build.sh -# Disable e2e test until we open source atlantis-tests repo and figure out when to run e2e tests -# post: -# # Run e2e tests -# - cd "${WORKDIR}" && ./scripts/e2e-deps.sh -# # Start atlantis server -# - cd "${WORKDIR}/e2e" && ./atlantis server --gh-user="$GITHUB_USERNAME" --gh-token="$GITHUB_PASSWORD" --data-dir="/tmp" --log-level="debug" &> /tmp/atlantis-server.log: -# background: true -# - sleep 2 -# - cd "${WORKDIR}/e2e" && ./ngrok http 4141: -# background: true -# - sleep 2 -# # Set ATLANTIS_URL environment variable to be used by atlantis e2e test to create the webhook -# - echo '' >> ~/.circlerc && echo 'export ATLANTIS_URL=$(curl -s 'http://localhost:4040/api/tunnels' | jq -r '.tunnels[1].public_url') ' >> ~/.circlerc -# - cd "${WORKDIR}/e2e" && ../scripts/e2e.sh + post: + # Run e2e tests + - cd "${WORKDIR}" && ./scripts/e2e-deps.sh + # Start atlantis server + - cd "${WORKDIR}/e2e" && ./atlantis server --gh-user="$GITHUB_USERNAME" --gh-token="$GITHUB_PASSWORD" --data-dir="/tmp" --log-level="debug" &> /tmp/atlantis-server.log: + background: true + - sleep 2 + - cd "${WORKDIR}/e2e" && ./ngrok http 4141: + background: true + - sleep 2 + # Set ATLANTIS_URL environment variable to be used by atlantis e2e test to create the webhook + - echo '' >> ~/.circlerc && echo 'export ATLANTIS_URL=$(curl -s 'http://localhost:4040/api/tunnels' | jq -r '.tunnels[1].public_url') ' >> ~/.circlerc + - cd "${WORKDIR}/e2e" && ../scripts/e2e.sh diff --git a/e2e/Makefile b/e2e/Makefile index d3e763889..fb80b2f72 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -13,6 +13,7 @@ deps: ## Get go dependencies go get -v . build: ## Build the main Go service + rm -f atlantis-tests go build -v -o atlantis-tests . deps-test: ## Run tests for go dependencies diff --git a/e2e/e2e.go b/e2e/e2e.go index e34ed199a..9c6e686a1 100644 --- a/e2e/e2e.go +++ b/e2e/e2e.go @@ -95,7 +95,7 @@ func (t *E2ETester) Start() (*E2EResult, error) { // create a new pr title := fmt.Sprintf("This is a test pull request for atlantis e2e test for %s project type", t.projectType.Name) - head := fmt.Sprintf("%s:%s", t.githubClient.username, branchName) + head := fmt.Sprintf("%s:%s", t.ownerName, branchName) body := "" base := "master" newPullRequest := &github.NewPullRequest{Title: &title, Head: &head, Body: &body, Base: &base} diff --git a/scripts/e2e.sh b/scripts/e2e.sh index 3653834c4..c95884db5 100755 --- a/scripts/e2e.sh +++ b/scripts/e2e.sh @@ -7,10 +7,6 @@ IFS=$'\n\t' echo "Running 'make deps'" make deps -# Test dependencies -echo "Running 'make deps-test'" -make deps-test - # Run tests echo "Running 'make test'" make test