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

ensure metric partitions are created before running e2e-tests in ci #37

Merged
merged 1 commit into from
Sep 27, 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
6 changes: 6 additions & 0 deletions .github/workflows/ci-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ jobs:
run: bash ${GITHUB_WORKSPACE}/scripts/wait-for-proxy-service-running.sh
env:
PROXY_CONTAINER_PORT: 7777
- name: wait for proxy service metric partitions database tables to be created
run: bash ${GITHUB_WORKSPACE}/scripts/wait-for-proxy-service-database-metric-partitions.sh
env:
# needs to be 1 + number of partitions created by /clients/database/migrations/20230523101344_partition_proxied_request_metrics_table.up.sql
MINIMUM_REQUIRED_PARTITIONS: 30
PROXY_CONTAINER_PORT: 7777
- name: run e2e tests
run: make e2e-test
- name: print proxy service logs
Expand Down
17 changes: 17 additions & 0 deletions scripts/wait-for-proxy-service-database-metric-partitions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -x

while true
do
CREATED_PARTITIONS=$(curl -f http://localhost:"${PROXY_CONTAINER_PORT}/status/database" | jq '.total_proxied_request_metric_partitions')

echo "$CREATED_PARTITIONS partitions exist"

if [ "$CREATED_PARTITIONS" -ge "$MINIMUM_REQUIRED_PARTITIONS" ]
then
echo "MINIMUM_REQUIRED_PARTITIONS created $CREATED_PARTITIONS; required: $MINIMUM_REQUIRED_PARTITIONS"
exit 0
fi

sleep 1
done
Loading