Skip to content

Commit 2e78652

Browse files
committed
ci: add more logs to tests
1 parent 51ec095 commit 2e78652

File tree

5 files changed

+43
-5
lines changed

5 files changed

+43
-5
lines changed

smoke-tests/smoke-sdk-grpc-ts.bats

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,39 @@ METER_NAME="hello-world-meter"
88
NODE_METER_NAME="node-monitor-meter"
99

1010
setup_file() {
11-
echo "# 🚧" >&3
11+
echo "# 🚧 Starting smoke-sdk-grpc-ts tests" >&3
12+
echo "# 📦 Building and starting containers: collector ${CONTAINER_NAME}" >&3
1213
docker compose up --build --detach collector ${CONTAINER_NAME}
1314
wait_for_ready_app ${CONTAINER_NAME}
15+
echo "# 🌐 Sending test request to http://localhost:3000" >&3
1416
curl --silent "http://localhost:3000"
1517
wait_for_traces
1618
# wait_for_metrics
1719
}
1820

1921
teardown_file() {
22+
echo "# 🧹 Cleaning up smoke-sdk-grpc-ts tests" >&3
23+
echo "# 💾 Saving collector data to data-${CONTAINER_NAME}.json" >&3
2024
cp collector/data.json collector/data-results/data-${CONTAINER_NAME}.json
25+
echo "# 🛑 Stopping ${CONTAINER_NAME} container" >&3
2126
docker compose stop ${CONTAINER_NAME}
27+
echo "# 🔄 Restarting collector" >&3
2228
docker compose restart collector
2329
wait_for_flush
2430
}
2531

2632
# TESTS
2733

2834
@test "Auto instrumentation produces 3 Express middleware spans" {
35+
echo "# ✅ Testing: Auto instrumentation produces 3 Express middleware spans" >&3
2936
result=$(span_names_for "@opentelemetry/instrumentation-express")
3037
assert_equal "$result" '"middleware - query"
3138
"middleware - expressInit"
3239
"request handler - /"'
3340
}
3441

3542
@test "Auto instrumentation produces an http request span" {
43+
echo "# ✅ Testing: Auto instrumentation produces an http request span" >&3
3644
result=$(span_names_for "@opentelemetry/instrumentation-http")
3745
assert_equal "$result" '"GET /"'
3846
}

smoke-tests/smoke-sdk-grpc.bats

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,39 @@ TRACER_NAME="hello-world-tracer"
77
METER_NAME="hello-world-meter"
88

99
setup_file() {
10-
echo "# 🚧" >&3
10+
echo "# 🚧 Starting smoke-sdk-grpc tests" >&3
11+
echo "# 📦 Building and starting containers: collector ${CONTAINER_NAME}" >&3
1112
docker compose up --build --detach collector ${CONTAINER_NAME}
1213
wait_for_ready_app ${CONTAINER_NAME}
14+
echo "# 🌐 Sending test request to http://localhost:3000" >&3
1315
curl --silent "http://localhost:3000"
1416
wait_for_traces
1517
# wait_for_metrics 5
1618
}
1719

1820
teardown_file() {
21+
echo "# 🧹 Cleaning up smoke-sdk-grpc tests" >&3
22+
echo "# 💾 Saving collector data to data-${CONTAINER_NAME}.json" >&3
1923
cp collector/data.json collector/data-results/data-${CONTAINER_NAME}.json
24+
echo "# 🛑 Stopping ${CONTAINER_NAME} container" >&3
2025
docker compose stop ${CONTAINER_NAME}
26+
echo "# 🔄 Restarting collector" >&3
2127
docker compose restart collector
2228
wait_for_flush
2329
}
2430

2531
# TESTS
2632

2733
@test "Auto instrumentation produces 3 Express middleware spans" {
34+
echo "# ✅ Testing: Auto instrumentation produces 3 Express middleware spans" >&3
2835
result=$(span_names_for "@opentelemetry/instrumentation-express")
2936
assert_equal "$result" '"middleware - query"
3037
"middleware - expressInit"
3138
"request handler - /"'
3239
}
3340

3441
@test "Auto instrumentation produces an http request span" {
42+
echo "# ✅ Testing: Auto instrumentation produces an http request span" >&3
3543
result=$(span_names_for "@opentelemetry/instrumentation-http")
3644
assert_equal "$result" '"GET /"'
3745
}

smoke-tests/smoke-sdk-http-ts.bats

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,51 @@ METER_NAME="hello-world-meter"
88
NODE_METER_NAME="node-monitor-meter"
99

1010
setup_file() {
11-
echo "# 🚧" >&3
11+
echo "# 🚧 Starting smoke-sdk-http-ts tests" >&3
12+
echo "# 📦 Building and starting containers: collector ${CONTAINER_NAME}" >&3
1213
docker compose up --build --detach collector ${CONTAINER_NAME}
1314
wait_for_ready_app ${CONTAINER_NAME}
15+
echo "# 🌐 Sending test request to http://localhost:3000" >&3
1416
curl --silent "http://localhost:3000"
1517
wait_for_traces
1618
# wait_for_metrics 15
1719
}
1820

1921
teardown_file() {
22+
echo "# 🧹 Cleaning up smoke-sdk-http-ts tests" >&3
23+
echo "# 💾 Saving collector data to data-${CONTAINER_NAME}.json" >&3
2024
cp collector/data.json collector/data-results/data-${CONTAINER_NAME}.json
25+
echo "# 🛑 Stopping ${CONTAINER_NAME} container" >&3
2126
docker compose stop ${CONTAINER_NAME}
27+
echo "# 🔄 Restarting collector" >&3
2228
docker compose restart collector
2329
wait_for_flush
2430
}
2531

2632
# TESTS
2733

2834
@test "Auto instrumentation produces 3 Express middleware spans" {
35+
echo "# ✅ Testing: Auto instrumentation produces 3 Express middleware spans" >&3
2936
result=$(span_names_for "@opentelemetry/instrumentation-express")
3037
assert_equal "$result" '"middleware - query"
3138
"middleware - expressInit"
3239
"request handler - /"'
3340
}
3441

3542
@test "Auto instrumentation produces an http request span" {
43+
echo "# ✅ Testing: Auto instrumentation produces an http request span" >&3
3644
result=$(span_names_for "@opentelemetry/instrumentation-http")
3745
assert_equal "$result" '"GET /"'
3846
}
3947

4048
@test "Manual instrumentation produces span with name of span" {
49+
echo "# ✅ Testing: Manual instrumentation produces span with name of span" >&3
4150
result=$(span_names_for ${TRACER_NAME})
4251
assert_equal "$result" '"sleep"'
4352
}
4453

4554
@test "Manual instrumentation adds custom attribute" {
55+
echo "# ✅ Testing: Manual instrumentation adds custom attribute" >&3
4656
result=$(span_attributes_for ${TRACER_NAME} | jq "select(.key == \"delay_ms\").value.intValue")
4757
assert_equal "$result" '"100"'
4858
}

smoke-tests/smoke-sdk-http.bats

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,51 @@ TRACER_NAME="hello-world-tracer"
77
METER_NAME="hello-world-meter"
88

99
setup_file() {
10-
echo "# 🚧" >&3
10+
echo "# 🚧 Starting smoke-sdk-http tests" >&3
11+
echo "# 📦 Building and starting containers: collector ${CONTAINER_NAME}" >&3
1112
docker compose up --build --detach collector ${CONTAINER_NAME}
1213
wait_for_ready_app ${CONTAINER_NAME}
14+
echo "# 🌐 Sending test request to http://localhost:3000" >&3
1315
curl --silent "http://localhost:3000"
1416
wait_for_traces
1517
# wait_for_metrics 15
1618
}
1719

1820
teardown_file() {
21+
echo "# 🧹 Cleaning up smoke-sdk-http tests" >&3
22+
echo "# 💾 Saving collector data to data-${CONTAINER_NAME}.json" >&3
1923
cp collector/data.json collector/data-results/data-${CONTAINER_NAME}.json
24+
echo "# 🛑 Stopping ${CONTAINER_NAME} container" >&3
2025
docker compose stop ${CONTAINER_NAME}
26+
echo "# 🔄 Restarting collector" >&3
2127
docker compose restart collector
2228
wait_for_flush
2329
}
2430

2531
# TESTS
2632

2733
@test "Auto instrumentation produces 3 Express middleware spans" {
34+
echo "# ✅ Testing: Auto instrumentation produces 3 Express middleware spans" >&3
2835
result=$(span_names_for "@opentelemetry/instrumentation-express")
2936
assert_equal "$result" '"middleware - query"
3037
"middleware - expressInit"
3138
"request handler - /"'
3239
}
3340

3441
@test "Auto instrumentation produces an http request span" {
42+
echo "# ✅ Testing: Auto instrumentation produces an http request span" >&3
3543
result=$(span_names_for "@opentelemetry/instrumentation-http")
3644
assert_equal "$result" '"GET /"'
3745
}
3846

3947
@test "Manual instrumentation produces span with name of span" {
48+
echo "# ✅ Testing: Manual instrumentation produces span with name of span" >&3
4049
result=$(span_names_for ${TRACER_NAME})
4150
assert_equal "$result" '"sleep"'
4251
}
4352

4453
@test "Manual instrumentation adds custom attribute" {
54+
echo "# ✅ Testing: Manual instrumentation adds custom attribute" >&3
4555
result=$(span_attributes_for ${TRACER_NAME} | jq "select(.key == \"delay_ms\").value.intValue")
4656
assert_equal "$result" '"100"'
4757
}

smoke-tests/test_helpers/utilities.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,21 @@ metrics_received() {
1818

1919
# test span name
2020
span_names_for() {
21+
echo "# 🔍 Getting span names for library: $1" >&3
2122
spans_from_library_named $1 | jq '.name'
2223
}
2324

2425
# test span attributes
2526
span_attributes_for() {
2627
# $1 - library name
27-
28+
echo "# 🔍 Getting span attributes for library: $1" >&3
2829
spans_from_library_named $1 | \
2930
jq ".attributes[]"
3031
}
3132

3233
# test metric name
3334
metric_names_for() {
35+
echo "# 🔍 Getting metric names for library: $1" >&3
3436
metrics_from_library_named $1 | jq '.name'
3537
}
3638

0 commit comments

Comments
 (0)