Skip to content

Commit 78a34a7

Browse files
committed
Add CI for trace context validation
1 parent 06283f7 commit 78a34a7

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,3 +923,42 @@ jobs:
923923
- name: run ./ci/docfx.cmd
924924
shell: cmd
925925
run: ./ci/docfx.cmd
926+
927+
w3c_trace_context_compliance_v1:
928+
name: W3C Distributed Tracing Validation V1
929+
runs-on: ubuntu-24.04
930+
steps:
931+
- name: Checkout open-telemetry/opentelemetry-cpp
932+
uses: actions/checkout@v4
933+
with:
934+
submodules: 'recursive'
935+
- name: setup
936+
env:
937+
CC: /usr/bin/gcc-14
938+
CXX: /usr/bin/g++-14
939+
PROTOBUF_VERSION: 21.12
940+
run: |
941+
sudo -E ./ci/setup_googletest.sh
942+
sudo -E ./ci/setup_ci_environment.sh
943+
- name: run w3c trace-context test server (background)
944+
env:
945+
CXX_STANDARD: '14'
946+
run: |
947+
./ci/do_ci.sh cmake.w3c.trace-context.build-server
948+
echo "action running from $(pwd)"
949+
ls -lah $HOME/build/ext/test/w3c_tracecontext_test
950+
./$HOME/build/ext/test/w3c_tracecontext_test/w3c_tracecontext_test &
951+
sleep 10
952+
- name: Checkout w3c/trace-context repo
953+
uses: actions/checkout@v4
954+
with:
955+
repository: w3c/trace-context
956+
path: trace-context
957+
- name: install dependencies
958+
run: |
959+
sudo apt update && sudo apt install python3-pip
960+
sudo pip3 install aiohttp
961+
- name: run w3c trace-context test suite
962+
run:
963+
|
964+
python ${GITHUB_WORKSPACE}/trace-context/test/test.py http://localhost:30000/test

ci/do_ci.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,19 @@ elif [[ "$1" == "cmake.exporter.otprotocol.with_async_export.test" ]]; then
393393
make -j $(nproc)
394394
cd exporters/otlp && make test
395395
exit 0
396+
elif [[ "$1" == "cmake.w3c.trace-context.build-server" ]]; then
397+
echo "Building w3c trace context test server"
398+
cd "${BUILD_DIR}"
399+
rm -rf *
400+
cmake "${CMAKE_OPTIONS[@]}" \
401+
-DBUILD_W3CTRACECONTEXT_TEST=ON \
402+
-DCMAKE_CXX_STANDARD=${CXX_STANDARD} \
403+
"${SRC_DIR}"
404+
eval "$MAKE_COMMAND"
405+
echo "currently at $(pwd)"
406+
echo "${BUILD_DIR}"
407+
ls -lah "${BUILD_DIR}/ext/test/w3c_tracecontext_test"
408+
exit 0
396409
elif [[ "$1" == "cmake.do_not_install.test" ]]; then
397410
cd "${BUILD_DIR}"
398411
rm -rf *

0 commit comments

Comments
 (0)