@@ -8,41 +8,51 @@ METER_NAME="hello-world-meter"
88NODE_METER_NAME=" node-monitor-meter"
99
1010setup_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
1921teardown_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}
0 commit comments