Skip to content

Commit

Permalink
Fix instrumentation tests for arm64 (signalfx#3876)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyc-splunk authored Nov 7, 2023
1 parent a9f9d94 commit 9319083
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions instrumentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ tests: test-java test-nodejs

.PHONY: test-java
test-java: dist
(cd tests/java && ./test.sh)
(cd tests/java && ARCH=$(ARCH) ./test.sh)

.PHONY: test-nodejs
test-nodejs: dist
(cd tests/nodejs && ./test.sh)
(cd tests/nodejs && ARCH=$(ARCH) ./test.sh)
6 changes: 3 additions & 3 deletions instrumentation/tests/java/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ set -euo pipefail

arch="${ARCH:-amd64}"
BASE="eclipse-temurin:11"
if [[ arch = "arm64" ]]; then
if [[ "$arch" = "arm64" ]]; then
BASE="arm64v8/eclipse-temurin:11"
fi

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

cp "${SCRIPT_DIR}/../../dist/libsplunk_${arch}.so" libsplunk.so
docker buildx build -q --platform linux/${arch} --build-arg BASE=$BASE -o type=image,name=zeroconfig-test-java,push=false .
OUTPUT=$(docker run --rm zeroconfig-test-java)
OUTPUT=$(docker run --platform linux/${arch} --rm zeroconfig-test-java)
echo "========== OUTPUT =========="
echo "$OUTPUT"
echo "============================"
Expand All @@ -30,7 +30,7 @@ echo "Test absence of OTEL_EXPORTER_OTLP_ENDPOINT"
echo "$OUTPUT" | grep -v "OTEL_EXPORTER_OTLP_ENDPOINT" > /dev/null && echo "Test passes" || exit 1

# Check we didn't inject env vars into processes outside of java.
OUTPUT_BASH=$(docker run --rm zeroconfig-test-java /usr/bin/env)
OUTPUT_BASH=$(docker run --platform linux/${arch} --rm zeroconfig-test-java /usr/bin/env)
echo "======= BASH OUTPUT ========"
echo "$OUTPUT_BASH"
echo "============================"
Expand Down
4 changes: 2 additions & 2 deletions instrumentation/tests/nodejs/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ set -euo pipefail

arch="${ARCH:-amd64}"
BASE="node:16"
if [[ arch = "arm64" ]]; then
if [[ "$arch" = "arm64" ]]; then
BASE="arm64v8/node:16"
fi
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

cp "${SCRIPT_DIR}/../../dist/libsplunk_${arch}.so" libsplunk.so
docker buildx build -q --platform linux/${arch} --build-arg BASE=$BASE -o type=image,name=zeroconfig-test-nodejs,push=false .
OUTPUT=$(docker run --rm zeroconfig-test-nodejs)
OUTPUT=$(docker run --platform linux/${arch} --rm zeroconfig-test-nodejs)
echo "========== OUTPUT =========="
echo "$OUTPUT"
echo "============================"
Expand Down

0 comments on commit 9319083

Please sign in to comment.