-
Notifications
You must be signed in to change notification settings - Fork 996
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make run.sh executable from within e2e (#619)
- Loading branch information
Showing
20 changed files
with
169 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.PHONY: clean copy docker push tools test | ||
|
||
BINARY ?= postgres-operator-e2e-tests | ||
BUILD_FLAGS ?= -v | ||
CGO_ENABLED ?= 0 | ||
ifeq ($(RACE),1) | ||
BUILD_FLAGS += -race -a | ||
CGO_ENABLED=1 | ||
endif | ||
|
||
LOCAL_BUILD_FLAGS ?= $(BUILD_FLAGS) | ||
LDFLAGS ?= -X=main.version=$(VERSION) | ||
|
||
IMAGE ?= registry.opensource.zalan.do/acid/$(BINARY) | ||
VERSION ?= $(shell git describe --tags --always --dirty) | ||
TAG ?= $(VERSION) | ||
GITHEAD = $(shell git rev-parse --short HEAD) | ||
GITURL = $(shell git config --get remote.origin.url) | ||
GITSTATU = $(shell git status --porcelain || echo 'no changes') | ||
TTYFLAGS = $(shell test -t 0 && echo '-it') | ||
|
||
ifndef GOPATH | ||
GOPATH := $(HOME)/go | ||
endif | ||
|
||
KIND_PATH := $(GOPATH)/bin | ||
PATH := $(GOPATH)/bin:$(PATH) | ||
|
||
default: tools | ||
|
||
clean: | ||
rm -fr manifests | ||
|
||
copy: clean | ||
mkdir manifests | ||
cp ../manifests -r . | ||
|
||
docker: copy | ||
docker build --build-arg "VERSION=$(VERSION)" -t "$(IMAGE):$(TAG)" . | ||
|
||
push: docker | ||
docker push "$(IMAGE):$(TAG)" | ||
|
||
tools: docker | ||
# install pinned version of 'kind' | ||
# leave the name as is to avoid overwriting official binary named `kind` | ||
wget https://github.com/kubernetes-sigs/kind/releases/download/v0.4.0/kind-linux-amd64 | ||
chmod +x kind-linux-amd64 | ||
mv kind-linux-amd64 $(KIND_PATH) | ||
|
||
test: | ||
./run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Postgres Operator end-to-end tests | ||
|
||
End-to-end tests shall ensure that the Postgres Operator does its job when | ||
applying manifests against a Kubernetes (K8s) environment. A test runner | ||
Dockerfile is provided to run e2e tests without the need to install K8s and | ||
its runtime `kubectl` in advance. The test runner uses | ||
[kind](https://kind.sigs.k8s.io/) to create a local K8s cluster which runs on | ||
Docker. | ||
|
||
## Prerequisites | ||
|
||
Docker | ||
Go | ||
|
||
## Build test runner | ||
|
||
In the directory of the cloned Postgres Operator repository change to the e2e | ||
folder and run: | ||
|
||
```bash | ||
make | ||
``` | ||
|
||
This will build the `postgres-operator-e2e-tests` image and download the kind | ||
runtime. | ||
|
||
## Run tests | ||
|
||
In the e2e folder you can invoke tests either with `make test` or with: | ||
|
||
```bash | ||
./run.sh | ||
``` | ||
|
||
To run both the build and test step you can invoke `make e2e` from the parent | ||
directory. | ||
|
||
## Covered use cases | ||
|
||
The current tests are all bundled in [`test_e2e.py`](tests/test_e2e.py): | ||
|
||
* support for multiple namespaces | ||
* scale Postgres cluster up and down | ||
* taint-based eviction of Postgres pods | ||
* invoking logical backup cron job | ||
* uniqueness of master pod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This version is replaced during release process. | ||
__version__ = '2019.0.dev1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.