Skip to content

Commit

Permalink
Adding e2e tests back and upgrading terraform version 0.9.11 (runatla…
Browse files Browse the repository at this point in the history
…ntis#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
  • Loading branch information
anubhavmishra authored Aug 11, 2017
1 parent 6f583aa commit c663be4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
29 changes: 14 additions & 15 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
1 change: 1 addition & 0 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 0 additions & 4 deletions scripts/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c663be4

Please sign in to comment.