Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up CI and dev setup #4

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and test

on:
push:
branches: [ master, fix_ci ]
branches: [ master ]
pull_request:
branches: [ master ]

Expand All @@ -25,19 +25,19 @@ jobs:
restore-keys: ${{ runner.os }}-mix-
- name: Start supporting services
run: docker compose --profile with-postgres up -d
- name: Ensure Schema Registry is started
- name: Ensure Kafka is started
# Copied from: https://github.com/happening-oss/kafka-client/blob/develop/.github/workflows/ci.yml
run: |
# give up after 60 seconds
max_wait_time=60

# Use a loop to check if Schema Registry is ready
# Use a loop to check if Kafka is ready
start_time=$(date +%s)
until docker compose logs schema-registry | grep -q "started"; do
until docker compose logs kafka | grep -q "started"; do
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ "$elapsed_time" -ge "$max_wait_time" ]; then
echo "Schema Registry did not start within the specified timeout."
echo "Kafka did not start within the specified timeout."
exit 1 # Exit the workflow with an error
fi

Expand Down
9 changes: 0 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,3 @@ services:
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
CLUSTER_ID: MkU3OEVBNTcwNTJENDM2Qk
schema-registry:
image: confluentinc/cp-schema-registry:7.5.1
environment:
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka:29092
SCHEMA_REGISTRY_HOST_NAME: localhost
ports:
- 8081:8081
depends_on:
- kafka
2 changes: 1 addition & 1 deletion test/kafkaesque/integration_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ defmodule Kafkaesque.IntegrationTest do

# Sending shutdown and waiting for it
Process.exit(main_pid, :shutdown)
assert_receive {:DOWN, ^ref, :process, ^main_pid, :shutdown}, 5000
assert_receive {:DOWN, ^ref, :process, ^main_pid, :shutdown}, 15_000

# Due to the termination logic, in case of shutdown no messages are left
# in publishing state
Expand Down
Loading