-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Adds a docker-compose.yml and removes embedded kafka from integration tests * Adds docker-compose commands to travis-ci * runs docker-compose on travis in detached mode * fixes incorrect test * removes git hooks as they have been deprecated * refactors stream tests * Fixes ci: updates travis.yml to run tests for both kafka 1 and kafka 2 * removes deprecated method punctuate from timestamp transformer * updates kafka-streams version to 2.1.0 * Adds upgrade-from config for updating from kafka-streams 1 to 2 * refactors streams.clj, moves offset-reset-config validation out into a function * adds a .env file to set default KAFKA_VERSION for docker-compose * refactors ci: creates topic from within docker container instead of pulling kafka code * moves logic for running tests in ci out into a script * moves the upgrade-from config to stream-routes * all integration stream tests now run with different application-ids * refactors code and introduces lint stage in ci * Adds a make-file and changes container name in docker-compose * Adds rabbitmq to docker-compose * removes duplicate import from streams.clj * Runs make test-all command in ci * refactors code, stream-tests get values from config. * Updates dev-setup in readme * Add changelog-topic-replication to test * Add code-coverage stage in CI pipeline
- Loading branch information
1 parent
a4ff017
commit 461666e
Showing
13 changed files
with
177 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
KAFKA_VERSION=2 |
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 |
---|---|---|
@@ -1,22 +1,36 @@ | ||
language: clojure | ||
|
||
services: | ||
- rabbitmq | ||
- docker | ||
|
||
stages: | ||
- lint-check | ||
- test | ||
- coverage | ||
- name: deploy | ||
if: (repo == gojek/ziggurat) AND (tag IS present) | ||
jobs: | ||
include: | ||
- stage: test | ||
- stage: lint-check | ||
script: | ||
- lein clean | ||
- lein deps | ||
- mv -fv resources/config.test.{ci.edn,edn} | ||
- lein cljfmt check | ||
- lein test-all | ||
after_script: | ||
- lein code-coverage | ||
- curl --form 'json_file=@coverage/coveralls.json' "${COVERALLS_URL}" | ||
- lein kibit | ||
- stage: test | ||
name: "kafka-1" | ||
env: | ||
- KAFKA_VERSION=1 | ||
script: | ||
- ./bin/run_tests_in_ci.sh | ||
- stage: test | ||
name: "kafka-2" | ||
env: | ||
- KAFKA_VERSION=2 | ||
script: | ||
- ./bin/run_tests_in_ci.sh | ||
|
||
- stage: coverage | ||
script: | ||
- make coverage | ||
|
||
- stage: deploy | ||
script: lein deploy clojars |
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,26 @@ | ||
.PHONY: all | ||
all: test-all test | ||
|
||
topic="topic" | ||
|
||
setup: | ||
docker-compose down | ||
lein deps | ||
docker-compose up -d | ||
sleep 10 | ||
docker exec -it ziggurat_kafka /opt/bitnami/kafka/bin/kafka-topics.sh --create --topic $(topic) --partitions 3 --replication-factor 1 --zookeeper ziggurat_zookeeper | ||
|
||
test-all: setup | ||
ZIGGURAT_STREAM_ROUTER_DEFAULT_ORIGIN_TOPIC=$(topic) lein test-all | ||
docker-compose down | ||
|
||
test: setup | ||
ZIGGURAT_STREAM_ROUTER_DEFAULT_ORIGIN_TOPIC=$(topic) lein test | ||
docker-compose down | ||
|
||
coverage: setup | ||
lein code-coverage | ||
ifdef COVERALLS_URL | ||
curl --form 'json_file=@coverage/coveralls.json' "$(COVERALLS_URL)" | ||
endif | ||
docker-compose down |
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,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
lein clean | ||
mv -fv resources/config.test.{ci.edn,edn} | ||
make test-all |
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,24 @@ | ||
version: '3.3' | ||
|
||
services: | ||
rabbitmq: | ||
image: 'rabbitmq' | ||
ports: | ||
- '5672:5672' | ||
container_name: 'ziggurat_rabbitmq' | ||
zookeeper: | ||
image: 'bitnami/zookeeper:latest' | ||
ports: | ||
- '2181:2181' | ||
container_name: 'ziggurat_zookeeper' | ||
environment: | ||
- ALLOW_ANONYMOUS_LOGIN=yes | ||
kafka: | ||
image: 'bitnami/kafka:${KAFKA_VERSION}' | ||
ports: | ||
- '9092:9092' | ||
container_name: 'ziggurat_kafka' | ||
environment: | ||
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 | ||
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 | ||
- ALLOW_PLAINTEXT_LISTENER=yes |
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
Oops, something went wrong.