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

Latest commit

 

History

History
82 lines (55 loc) · 1.78 KB

CONTRIBUTING.md

File metadata and controls

82 lines (55 loc) · 1.78 KB

Contributing to Babylon

Using make

# To build and deploy
$ make # make deploy-local works too
# To check linting
$ make lint

Local kubernetes development

$ minikube start

$ eval $(minikube -p minikube docker-env)

$ docker build -t babylon .

$ kubectl apply -f minikube.yaml

Integration tests with kuttl

We have set up integration tests using kuttl. The tests are found in tests/e2e, see kuttl's documentation. All tests will have a running instance of babylon in the background, as specified in tests/before/babylon.yaml.

Tests work by specifying a cluster configuration, and then performing assertions on that configuration. For example asserting that babylon has deleted some kind of resource.

Setup kuttl

Automatically

$ make test

Manually

# install packages
$ brew tap kudobuilder/tap
$ brew install kuttl-cli

# run integration tests with kubernetes-in-docker (KIND)
$ kubectl kuttl test

# or you can run integration tests with minikube
$ minikube start
$ kubectl kuttl test --start-kind=false

Access running application

$ minikube ip
192.168.64.2 # example, copy your own
$ sudo $EDITOR /etc/hosts
192.168.64.2 babylon.local
$ sudo killall -HUP mDNSResponder

Developer setup

You must have pre-commit installed, then run make hooks to install git hooks.

Local InfluxDB testing

minikube.yaml contains setup for InfluxDB instance.

Prerequisites

  • Setup influxdb.local in etc/hosts. See "Access running application" section.

Test query to query the data from the InfluxDB instance:

curl -G 'http://influxdb.local/query?pretty=true' --data-urlencode "db=testdb" --data-urlencode "q=SHOW SERIES"