opentelemetry-go-instrumentation icon indicating copy to clipboard operation
opentelemetry-go-instrumentation copied to clipboard

Run bats tests in docker image

Open MrAlias opened this issue 2 years ago • 3 comments

Originally posted by @MrAlias in https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/121#discussion_r1195459989

MrAlias avatar May 16 '23 17:05 MrAlias

🫢 With all the dockering going on, I don't know why I didn't think of that.

typing typing … oh no!

OK. First challenge: the bats/bats image does not include jq upon which most of the test assertions are based. 😞

❯ make fixture-gin
… 
kubectl cp -c filecp default/test-opentelemetry-collector-0:tmp/trace.json ./test/e2e/gin/traces-orig.json
rm -f ./test/e2e/gin/traces.json
docker run -it -v "/Users/robbkidd/work/tracing/otel/otel-go-inst:/code" bats/bats:latest ./test/e2e/gin/verify.bats
verify.bats
 ✗ go-auto :: includes service.name in resource attributes
   (in test file test/e2e/gin/verify.bats, line 8)
     `result=$(resource_attributes_received | jq "select(.key == \"service.name\").value.stringValue")' failed with status 127
   /code/test/e2e/gin/verify.bats: line 8: jq: command not found
   /code/test/e2e/gin/../../test_helpers/utilities.bash: line 19: jq: command not found
   /code/test/e2e/gin/../../test_helpers/utilities.bash: line 30: jq: command not found
… 

robbkidd avatar May 16 '23 19:05 robbkidd

@MrAlias Is it needed for beta?

pellared avatar Jul 21 '23 13:07 pellared

@MrAlias Is it needed for beta?

Not as far as I can see.

MrAlias avatar Jul 24 '23 15:07 MrAlias