-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use docker compose for cassandra integration tests #5520
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.8' | ||
|
||
services: | ||
cassandra: | ||
image: cassandra:3.11 | ||
ports: | ||
- "9042:9042" | ||
- "9160:9160" | ||
networks: | ||
- cassandra-net | ||
healthcheck: | ||
test: ["CMD", "cqlsh", "-e", "describe keyspaces"] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 5 | ||
|
||
networks: | ||
cassandra-net: | ||
driver: bridge |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.8' | ||
|
||
services: | ||
cassandra: | ||
image: cassandra:4.0 | ||
ports: | ||
- "9042:9042" | ||
- "9160:9160" | ||
networks: | ||
- cassandra-net | ||
healthcheck: | ||
test: ["CMD", "cqlsh", "-e", "describe keyspaces"] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 5 | ||
|
||
networks: | ||
cassandra-net: | ||
driver: bridge |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,22 +15,14 @@ check_arg() { | |
} | ||
|
||
setup_cassandra() { | ||
local tag=$1 | ||
local image=cassandra | ||
local params=( | ||
--detach | ||
--publish 9042:9042 | ||
--publish 9160:9160 | ||
) | ||
local cid | ||
cid=$(docker run "${params[@]}" "${image}:${tag}") | ||
echo "cid=${cid}" >> "$GITHUB_OUTPUT" | ||
echo "${cid}" | ||
local compose_file=$1 | ||
docker compose -f "$compose_file" up -d | ||
echo "docker_compose_file=${compose_file}" >> "${GITHUB_OUTPUT:-/dev/null}" | ||
} | ||
|
||
teardown_cassandra() { | ||
local cid=$1 | ||
docker kill "${cid}" | ||
local compose_file=$1 | ||
docker compose -f "$compose_file" down | ||
exit "${exit_status}" | ||
} | ||
|
||
|
@@ -53,13 +45,14 @@ apply_schema() { | |
|
||
run_integration_test() { | ||
local version=$1 | ||
local major_version=${version%%.*} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we do the same with es/os scripts? Their matrix was changed "7.x" -> "7", which makes the workflow names look weird. I would prefer to go back to 7.x / 8.x There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be a separate PR for that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok i will create a new pr after this |
||
local schema_version=$2 | ||
local jaegerVersion=$3 | ||
local primaryKeyspace="jaeger_v1_dc1" | ||
local archiveKeyspace="jaeger_v1_dc1_archive" | ||
local compose_file="docker-compose/cassandra/v$major_version.yaml" | ||
|
||
local cid | ||
cid=$(setup_cassandra "${version}") | ||
setup_cassandra "${compose_file}" | ||
|
||
apply_schema "$schema_version" "$primaryKeyspace" | ||
apply_schema "$schema_version" "$archiveKeyspace" | ||
|
@@ -76,7 +69,7 @@ run_integration_test() { | |
fi | ||
|
||
# shellcheck disable=SC2064 | ||
trap "teardown_cassandra ${cid}" EXIT | ||
trap "teardown_cassandra ${compose_file}" EXIT | ||
} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hellspawn679 I don't think this is working, the dependabot runs did not pick this up. I suspect that when you pick
docker
ecosystem and a directory, dependabot looks for standard file names likeDockerfile
ordocker-compose.yml
. Since you're using custom file names likev3.yml
, dependabot doesn't know that they are for docker-compose. We probably need to list the files explicitly instead of specifying a dir only.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#5552