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

Add grpc smoke tests #264

Merged
merged 2 commits into from
Sep 21, 2022
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
8 changes: 8 additions & 0 deletions smoke-tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,13 @@ services:
<<: *env_base
HONEYCOMB_API_ENDPOINT: http://collector:4318/v1/traces
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
ports:
- "127.0.0.1:5001:5001"

app-sdk-grpc:
<<: *app_base
environment:
<<: *env_base
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
ports:
- "127.0.0.1:5001:5001"
33 changes: 33 additions & 0 deletions smoke-tests/smoke-sdk-grpc.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bats

load test_helpers/utilities

CONTAINER_NAME="app-sdk-grpc"
OTEL_SERVICE_NAME="aspnetcore-example"

setup_file() {
echo "# 🚧" >&3
docker-compose up --detach collector ${CONTAINER_NAME}
wait_for_ready_app ${CONTAINER_NAME}
curl --silent "http://localhost:5001/weatherforecast"
wait_for_traces
}

teardown_file() {
cp collector/data.json collector/data-results/data-${CONTAINER_NAME}.json
docker-compose stop ${CONTAINER_NAME}
docker-compose restart collector
wait_for_flush
}

# TESTS

@test "Manual instrumentation produces span with name of span" {
result=$(span_names_for ${OTEL_SERVICE_NAME})
assert_equal "$result" '"sleep"'
}

@test "Manual instrumentation adds custom attribute" {
result=$(span_attributes_for ${OTEL_SERVICE_NAME} | jq "select(.key == \"delay_ms\").value.intValue")
assert_equal "$result" '"100"'
}
2 changes: 1 addition & 1 deletion smoke-tests/smoke-sdk-http.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ teardown_file() {
@test "Manual instrumentation adds custom attribute" {
result=$(span_attributes_for ${OTEL_SERVICE_NAME} | jq "select(.key == \"delay_ms\").value.intValue")
assert_equal "$result" '"100"'
}
}