Skip to content

Commit

Permalink
Work on testing
Browse files Browse the repository at this point in the history
 * Tests fail with vault > 0.9.6 and consul > 1.0.6
 * Added docker file for running repeatable tests
  • Loading branch information
magiconair committed May 16, 2018
1 parent f3eca46 commit 287bc6a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fabio
dist/
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
*-amd64
*.out
*.orig
*.out
*.p12
*.pem
*.pprof
*.sha256
*.swp
*.tar.gz
*.test
*.un~
*.zip
.DS_Store
.idea
.vagrant
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ before_script:
- echo $HOSTNAME
- mkdir -p $GOPATH/bin
- wget --version
- wget https://releases.hashicorp.com/consul/1.0.7/consul_1.0.7_linux_amd64.zip
- wget https://releases.hashicorp.com/consul/1.0.6/consul_1.0.6_linux_amd64.zip
- wget https://releases.hashicorp.com/vault/0.9.6/vault_0.9.6_linux_amd64.zip
- unzip -d $GOPATH/bin consul_1.0.7_linux_amd64.zip
- unzip -d $GOPATH/bin consul_1.0.6_linux_amd64.zip
- unzip -d $GOPATH/bin vault_0.9.6_linux_amd64.zip
- vault --version
- consul --version
12 changes: 12 additions & 0 deletions Dockerfile-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu
COPY consul_1.0.6_linux_amd64.zip /tmp
COPY vault_0.9.6_linux_amd64.zip /tmp
COPY go1.10.2.linux-amd64.tar.gz /tmp
RUN apt-get update && apt-get -y install unzip make git-core
RUN unzip /tmp/consul*.zip -d /usr/local/bin
RUN unzip /tmp/vault*.zip -d /usr/local/bin
RUN tar -C /usr/local -x -f /tmp/go*.tar.gz
ENV PATH=/usr/local/go/bin:/root/go/bin:$PATH
WORKDIR /root/go/src/github.com/fabiolb/fabio
COPY . .
CMD "/bin/bash"
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ GOVENDOR = $(shell which govendor)
# VENDORFMT is the path to the vendorfmt binary.
VENDORFMT = $(shell which vendorfmt)

CONSUL_VERSION=1.0.6
VAULT_VERSION=0.9.6
GO_VERSION=1.10.2

# all is the default target
all: test

Expand Down Expand Up @@ -115,12 +119,19 @@ docker-aliases:
docker push magiconair/fabio:$(VERSION)-$(GOVERSION)
docker push magiconair/fabio:latest

docker-test:
test -r consul_$(CONSUL_VERSION)_linux_amd64.zip || wget https://releases.hashicorp.com/consul/$(CONSUL_VERSION)/consul_$(CONSUL_VERSION)_linux_amd64.zip
test -r vault_$(VAULT_VERSION)_linux_amd64.zip || wget https://releases.hashicorp.com/vault/$(VAULT_VERSION)/vault_$(VAULT_VERSION)_linux_amd64.zip unzip -o -d ~/bin ~/consul.zip
test -r go$(GO_VERSION).linux-amd64.tar.gz || wget https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz
docker build -t test-fabio -f Dockerfile-test .
docker run -it test-fabio

# codeship runs the CI on codeship
codeship:
go version
go env
wget -O ~/consul.zip https://releases.hashicorp.com/consul/1.0.7/consul_1.0.7_linux_amd64.zip
wget -O ~/vault.zip https://releases.hashicorp.com/vault/0.9.6/vault_0.9.6_linux_amd64.zip
wget -O ~/consul.zip https://releases.hashicorp.com/consul/$(CONSUL_VERSION)/consul_$(CONSUL_VERSION)_linux_amd64.zip
wget -O ~/vault.zip https://releases.hashicorp.com/vault/$(VAULT_VERSION)/vault_$(VAULT_VERSION)_linux_amd64.zip
unzip -o -d ~/bin ~/consul.zip
unzip -o -d ~/bin ~/vault.zip
vault --version
Expand Down

0 comments on commit 287bc6a

Please sign in to comment.