Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2058 from 2opremio/refactor-e2e-tests
Browse files Browse the repository at this point in the history
Refactor e2e test
  • Loading branch information
2opremio authored May 22, 2019
2 parents 59641c6 + 015bfd5 commit c15480f
Show file tree
Hide file tree
Showing 12 changed files with 244 additions and 233 deletions.
52 changes: 26 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
version: 2
jobs:
build:
working_directory: /go/src/github.com/weaveworks/flux
docker:
- image: circleci/golang:1.10
- image: memcached
working_directory: ~/go/src/github.com/weaveworks/flux
machine: true
environment:
GO_VERSION: 1.12.5
GOPATH: /home/circleci/go
PATH: /bin:/usr/bin:/usr/local/go/bin:/home/circleci/go/bin
steps:
- checkout
- setup_remote_docker

- run:
# Ensure latest version of git
name: Install Golang
command: |
echo "deb http://deb.debian.org/debian stretch-backports main" | sudo tee -a /etc/apt/sources.list.d/stretch-backports.list
curl -OL https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz
tar -xf go${GO_VERSION}.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo mv go /usr/local
mkdir -p "$HOME/go/bin"
go version
- run:
name: Update packages and Start Memcached
command: |
# These repos fail and we don't need them:
sudo rm /etc/apt/sources.list.d/circleci_trusty.list /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install -t stretch-backports -y --only-upgrade git
sudo apt-get install -y git rng-tools docker-ce memcached
git version
- run: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
docker version
- run:
name: Install Dep
command: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- run: dep ensure -vendor-only
- run: make check-generated
- run: make test TEST_FLAGS="-race -tags integration -timeout 60s"
- run: make all

- run: make e2e

- deploy:
name: Maybe push prerelease images
command: |
Expand All @@ -34,7 +48,6 @@ jobs:
docker tag "docker.io/weaveworks/helm-operator:$(docker/image-tag)" "docker.io/weaveworks/helm-operator-prerelease:$(docker/image-tag)"
docker push "docker.io/weaveworks/helm-operator-prerelease:$(docker/image-tag)"
fi
- deploy:
name: Maybe push release image and upload binaries
command: |
Expand All @@ -50,17 +63,6 @@ jobs:
RELEASE_TAG=$(echo "$CIRCLE_TAG" | cut -c 6-)
docker push "docker.io/weaveworks/helm-operator:${RELEASE_TAG}"
fi
e2e-testing:
machine: true
working_directory: ~/go/src/github.com/weaveworks/flux
steps:
- checkout
- run: test/e2e/e2e-golang.sh
- run: test/e2e/e2e-flux-build.sh
- run: test/e2e/e2e-kind.sh
- run: test/e2e/e2e-helm.sh
- run: test/e2e/e2e-git.sh
- run: test/e2e/e2e-flux-chart.sh
workflows:
version: 2
Expand All @@ -70,6 +72,4 @@ workflows:
filters:
tags:
only: /(helm-)?[0-9]+(\.[0-9]+)*(-[a-z]+)?/
- e2e-testing:
requires:
- build

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ docker/fluxy-dumbconf.priv
test/profiles
test/bin/kubectl
test/bin/helm
test/bin/kind
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ release-bins:
clean:
go clean
rm -rf ./build
rm -f test/bin/kubectl test/bin/helm
rm -f test/bin/kubectl test/bin/helm test/bin/kind

realclean: clean
rm -rf ./cache

test: test/bin/helm test/bin/kubectl
PATH="${PWD}/bin:${PWD}/test/bin:${PATH}" go test ${TEST_FLAGS} $(shell go list ./... | grep -v "^github.com/weaveworks/flux/vendor" | sort -u)

e2e: test/bin/helm test/bin/kubectl build/.flux.done build/.helm-operator.done
PATH="${PWD}/test/bin:${PATH}" CURRENT_OS_ARCH=$(CURRENT_OS_ARCH) test/e2e/run.sh

build/.%.done: docker/Dockerfile.%
mkdir -p ./build/docker/$*
cp $^ ./build/docker/$*/
Expand Down
2 changes: 1 addition & 1 deletion gpg/gpgtest/gpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func GPGKey(t *testing.T) (string, string, func()) {
t.Fatal(err)
}

gpgCmd := exec.Command("gpg", "--homedir", newDir, "--list-keys", "--with-colons")
gpgCmd := exec.Command("gpg", "--homedir", newDir, "--list-keys", "--with-colons", "--with-fingerprint")
grepCmd := exec.Command("grep", "^fpr")
cutCmd := exec.Command("cut", "-d:", "-f10")

Expand Down
13 changes: 0 additions & 13 deletions test/e2e/e2e-flux-build.sh

This file was deleted.

113 changes: 0 additions & 113 deletions test/e2e/e2e-flux-chart.sh

This file was deleted.

17 changes: 0 additions & 17 deletions test/e2e/e2e-git.sh

This file was deleted.

19 changes: 0 additions & 19 deletions test/e2e/e2e-golang.sh

This file was deleted.

15 changes: 0 additions & 15 deletions test/e2e/e2e-helm.sh

This file was deleted.

26 changes: 0 additions & 26 deletions test/e2e/e2e-kind.sh

This file was deleted.

2 changes: 0 additions & 2 deletions test/e2e/git-dep.yaml → test/e2e/gitsrv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
labels:
name: gitsrv
name: gitsrv
namespace: flux
spec:
replicas: 1
selector:
Expand Down Expand Up @@ -46,7 +45,6 @@ metadata:
labels:
name: gitsrv
name: gitsrv
namespace: flux
spec:
ports:
- name: ssh
Expand Down
Loading

0 comments on commit c15480f

Please sign in to comment.