Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
Signed-off-by: mehul gautam <[email protected]>
  • Loading branch information
mehul gautam committed Jul 14, 2024
1 parent d203bac commit 9996f30
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
5 changes: 4 additions & 1 deletion examples/hotrod/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ services:
- jaeger-example

hotrod:
image: ${REGISTRY:-}jaegertracing/example-hotrod:${JAEGER_VERSION:-latest}
image: ${REGISTRY:-}jaegertracing/example-hotrod:${GITHUB_SHA:-${JAEGER_VERSION:-latest}}
# To run the latest trunk build, find the tag at Docker Hub and use the line below
# https://hub.docker.com/r/jaegertracing/example-hotrod-snapshot/tags
#image: jaegertracing/example-hotrod-snapshot:0ab8f2fcb12ff0d10830c1ee3bb52b745522db6c
ports:
- "8080:8080"
- "8083:8083"
Expand Down
34 changes: 19 additions & 15 deletions scripts/hotrod-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,47 @@

set -euxf -o pipefail

docker_compose_file="./examples/hotrod/docker-compose.yml"
export REGISTRY="localhost:5000/"
platforms="linux/amd64,linux/s390x,linux/ppc64le,linux/arm64"

teardown() {
echo "Tearing down..."
docker compose -f "$docker_compose_file" down
}
trap teardown EXIT

make build-examples GOOS=linux GOARCH=amd64
make build-examples GOOS=linux GOARCH=s390x
make build-examples GOOS=linux GOARCH=ppc64le
make build-examples GOOS=linux GOARCH=arm64


platforms="linux/amd64,linux/s390x,linux/ppc64le,linux/arm64"
make prepare-docker-buildx

# build image locally (-l) for integration test
# Build image locally (-l) for integration test
bash scripts/build-upload-a-docker-image.sh -l -c example-hotrod -d examples/hotrod -p "${platforms}"

export HOTROD_IMAGE="localhost:5000/jaegertracing/example-hotrod"
docker compose -f ./examples/hotrod/docker-compose.yml up -d
docker compose -f "$docker_compose_file" up -d

i=0
while [[ "$(curl -s -o /dev/null -w '%{http_code}' localhost:8080)" != "200" && ${i} -lt 30 ]]; do
while [[ "$(curl -s -o /dev/null -w '%{http_code}' localhost:8080)" != "200" && $i -lt 30 ]]; do
sleep 1
i=$((i+1))
done

body=$(curl localhost:8080)
if [[ $body != *"Rides On Demand"* ]]; then
echo "String \"Rides On Demand\" is not present on the index page"
exit 1
fi

curl -X POST "http://localhost:8080/dispatch?customer=123"
# Extract the logs from the docker compose service
logs=$(docker compose -f ./examples/hotrod/docker-compose.yml logs hotrod)

# Extract the trace_id from the logs
TRACE_ID=$(echo "$logs" | grep -oP '(?<="trace_id": ")[^"]+' | tail -n 1)
response=$(curl -i -X POST "http://localhost:8080/dispatch?customer=123")
TRACE_ID=$(echo "$response" | grep -Fi "Traceresponse" | awk '{print $2}' | cut -d '-' -f 2)

JAEGER_QUERY_URL="http://localhost:16686"
EXPECTED_SPANS=10 # Change this to the expected number of spans
MAX_RETRIES=30
SLEEP_INTERVAL=10
EXPECTED_SPANS=10
MAX_RETRIES=30
SLEEP_INTERVAL=10

# Function to poll Jaeger for the trace
poll_jaeger() {
Expand Down

0 comments on commit 9996f30

Please sign in to comment.