@@ -1410,3 +1410,51 @@ cmd3"
14101410 unstub docker
14111411 unstub buildkite-agent
14121412}
1413+
1414+ @test " Run with disable-host-otel-tracing enabled" {
1415+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
1416+ export BUILDKITE_COMMAND=" echo hello world"
1417+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_CHECK_LINKED_CONTAINERS=false
1418+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_CLEANUP=false
1419+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_DISABLE_HOST_OTEL_TRACING=true
1420+
1421+ stub docker \
1422+ " compose -f docker-compose.yml -p buildkite1111 up -d --scale myservice=0 myservice : echo ran myservice dependencies" \
1423+ " compose -f docker-compose.yml -p buildkite1111 run --name buildkite1111_myservice_build_1 -T --rm myservice /bin/sh -e -c 'echo hello world' : echo ran myservice with OTEL disabled"
1424+
1425+ stub buildkite-agent \
1426+ " meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1"
1427+
1428+ run " $PWD " /hooks/command
1429+
1430+ assert_success
1431+ assert_output --partial " ran myservice with OTEL disabled"
1432+
1433+ unstub docker
1434+ unstub buildkite-agent
1435+ }
1436+
1437+ @test " Run with disable-host-otel-tracing disabled" {
1438+ export BUILDKITE_BUILD_ID=" 1111"
1439+ export BUILDKITE_JOB_ID=" 1111"
1440+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
1441+ export BUILDKITE_COMMAND=" echo hello world"
1442+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_CHECK_LINKED_CONTAINERS=false
1443+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_CLEANUP=false
1444+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_DISABLE_HOST_OTEL_TRACING=false
1445+
1446+ stub docker \
1447+ " compose -f docker-compose.yml -p buildkite1111 up -d --scale myservice=0 myservice : echo ran myservice dependencies" \
1448+ " compose -f docker-compose.yml -p buildkite1111 run --name buildkite1111_myservice_build_1 -T --rm myservice /bin/sh -e -c 'echo hello world' : echo ran myservice with OTEL enabled"
1449+
1450+ stub buildkite-agent \
1451+ " meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1"
1452+
1453+ run " $PWD " /hooks/command
1454+
1455+ assert_success
1456+ assert_output --partial " ran myservice with OTEL enabled"
1457+
1458+ unstub docker
1459+ unstub buildkite-agent
1460+ }
0 commit comments