File tree Expand file tree Collapse file tree 5 files changed +21
-17
lines changed Expand file tree Collapse file tree 5 files changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ NODE_METER_NAME="node-monitor-meter"
1010setup_file () {
1111 echo " # 🚧 Starting smoke-sdk-grpc-ts tests" >&3
1212 echo " # 📦 Building and starting containers: collector ${CONTAINER_NAME} " >&3
13- docker compose up --build --detach collector ${CONTAINER_NAME}
13+ docker compose up --build --detach collector ${CONTAINER_NAME} >&3 2>&3
1414 wait_for_ready_app ${CONTAINER_NAME}
1515 echo " # 🌐 Sending test request to http://localhost:3000" >&3
1616 curl --silent " http://localhost:3000"
@@ -23,9 +23,9 @@ teardown_file() {
2323 echo " # 💾 Saving collector data to data-${CONTAINER_NAME} .json" >&3
2424 cp collector/data.json collector/data-results/data-${CONTAINER_NAME} .json
2525 echo " # 🛑 Stopping ${CONTAINER_NAME} container" >&3
26- docker compose stop ${CONTAINER_NAME}
26+ docker compose stop ${CONTAINER_NAME} >&3 2>&3
2727 echo " # 🔄 Restarting collector" >&3
28- docker compose restart collector
28+ docker compose restart collector >&3 2>&3
2929 wait_for_flush
3030}
3131
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ METER_NAME="hello-world-meter"
99setup_file () {
1010 echo " # 🚧 Starting smoke-sdk-grpc tests" >&3
1111 echo " # 📦 Building and starting containers: collector ${CONTAINER_NAME} " >&3
12- docker compose up --build --detach collector ${CONTAINER_NAME}
12+ docker compose up --build --detach collector ${CONTAINER_NAME} >&3 2>&3
1313 wait_for_ready_app ${CONTAINER_NAME}
1414 echo " # 🌐 Sending test request to http://localhost:3000" >&3
1515 curl --silent " http://localhost:3000"
@@ -22,9 +22,9 @@ teardown_file() {
2222 echo " # 💾 Saving collector data to data-${CONTAINER_NAME} .json" >&3
2323 cp collector/data.json collector/data-results/data-${CONTAINER_NAME} .json
2424 echo " # 🛑 Stopping ${CONTAINER_NAME} container" >&3
25- docker compose stop ${CONTAINER_NAME}
25+ docker compose stop ${CONTAINER_NAME} >&3 2>&3
2626 echo " # 🔄 Restarting collector" >&3
27- docker compose restart collector
27+ docker compose restart collector >&3 2>&3
2828 wait_for_flush
2929}
3030
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ NODE_METER_NAME="node-monitor-meter"
1010setup_file () {
1111 echo " # 🚧 Starting smoke-sdk-http-ts tests" >&3
1212 echo " # 📦 Building and starting containers: collector ${CONTAINER_NAME} " >&3
13- docker compose up --build --detach collector ${CONTAINER_NAME}
13+ docker compose up --build --detach collector ${CONTAINER_NAME} >&3 2>&3
1414 wait_for_ready_app ${CONTAINER_NAME}
1515 echo " # 🌐 Sending test request to http://localhost:3000" >&3
1616 curl --silent " http://localhost:3000"
@@ -23,9 +23,9 @@ teardown_file() {
2323 echo " # 💾 Saving collector data to data-${CONTAINER_NAME} .json" >&3
2424 cp collector/data.json collector/data-results/data-${CONTAINER_NAME} .json
2525 echo " # 🛑 Stopping ${CONTAINER_NAME} container" >&3
26- docker compose stop ${CONTAINER_NAME}
26+ docker compose stop ${CONTAINER_NAME} >&3 2>&3
2727 echo " # 🔄 Restarting collector" >&3
28- docker compose restart collector
28+ docker compose restart collector >&3 2>&3
2929 wait_for_flush
3030}
3131
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ METER_NAME="hello-world-meter"
99setup_file () {
1010 echo " # 🚧 Starting smoke-sdk-http tests" >&3
1111 echo " # 📦 Building and starting containers: collector ${CONTAINER_NAME} " >&3
12- docker compose up --build --detach collector ${CONTAINER_NAME}
12+ docker compose up --build --detach collector ${CONTAINER_NAME} >&3 2>&3
1313 wait_for_ready_app ${CONTAINER_NAME}
1414 echo " # 🌐 Sending test request to http://localhost:3000" >&3
1515 curl --silent " http://localhost:3000"
@@ -22,9 +22,9 @@ teardown_file() {
2222 echo " # 💾 Saving collector data to data-${CONTAINER_NAME} .json" >&3
2323 cp collector/data.json collector/data-results/data-${CONTAINER_NAME} .json
2424 echo " # 🛑 Stopping ${CONTAINER_NAME} container" >&3
25- docker compose stop ${CONTAINER_NAME}
25+ docker compose stop ${CONTAINER_NAME} >&3 2>&3
2626 echo " # 🔄 Restarting collector" >&3
27- docker compose restart collector
27+ docker compose restart collector >&3 2>&3
2828 wait_for_flush
2929}
3030
Original file line number Diff line number Diff line change @@ -100,14 +100,18 @@ wait_for_flush() {
100100wait_for_ready_app () {
101101 CONTAINER=${1:? container name is a required parameter}
102102 MAX_RETRIES=10
103- echo -n " # 🍿 Setting up ${CONTAINER} " >&3
103+ echo " # 🍿 Setting up ${CONTAINER} " >&3
104104 NEXT_WAIT_TIME=0
105- until [ $NEXT_WAIT_TIME -eq $MAX_RETRIES ] || [[ $( docker compose logs ${CONTAINER} | grep " Now listening on:" ) ]]
105+ until [ $NEXT_WAIT_TIME -eq $MAX_RETRIES ] || [[ $( docker compose logs ${CONTAINER} 2>&1 ) =~ " Now listening on:" ]]
106106 do
107- echo -n " ... $(( NEXT_WAIT_TIME++ )) s" >&3
108- sleep $NEXT_WAIT_TIME
107+ echo " # ... waiting $(( NEXT_WAIT_TIME )) s" >&3
108+ if [ $NEXT_WAIT_TIME -gt 0 ]; then
109+ echo " # Container logs:" >&3
110+ docker compose logs ${CONTAINER} 2>&1 | tail -10 >&3
111+ fi
112+ sleep $(( NEXT_WAIT_TIME++ ))
109113 done
110- echo " " >&3
114+ echo " # ✓ ${CONTAINER} is ready " >&3
111115 [ $NEXT_WAIT_TIME -lt $MAX_RETRIES ]
112116}
113117
You can’t perform that action at this time.
0 commit comments