From 1423c384fedf463dc3b4440e04d3c393a1ec5f91 Mon Sep 17 00:00:00 2001 From: Douglas Barker Date: Wed, 21 May 2025 19:15:22 -0600 Subject: [PATCH 1/3] add all components to the fetch content test --- .github/workflows/ci.yml | 3 ++ ci/do_ci.sh | 22 ++++++------- .../cmake/fetch_content_test/CMakeLists.txt | 31 ++++++++++++++++++- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8415f13967..1bea80756e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,9 @@ jobs: sudo -E ./ci/setup_ci_environment.sh sudo -E ./ci/setup_cmake.sh sudo -E ./ci/setup_googletest.sh + sudo -E ./ci/install_abseil.sh + sudo -E ./ci/install_protobuf.sh + sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp - name: run fetch content cmake test run: | ./ci/do_ci.sh cmake.fetch_content.test diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 57b2053512..10b4f98216 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -535,17 +535,17 @@ elif [[ "$1" == "cmake.fetch_content.test" ]]; then -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON \ -DWITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON \ -DWITH_OTLP_RETRY_PREVIEW=ON \ - -DWITH_OTLP_GRPC=OFF \ - -DWITH_OTLP_HTTP=OFF \ - -DWITH_OTLP_FILE=OFF \ - -DWITH_OTLP_HTTP_COMPRESSION=OFF \ - -DWITH_HTTP_CLIENT_CURL=OFF \ - -DWITH_PROMETHEUS=OFF \ - -DWITH_ZIPKIN=OFF \ - -DWITH_ELASTICSEARCH=OFF \ - -DWITH_EXAMPLES=OFF \ - -DWITH_EXAMPLES_HTTP=OFF \ - -DBUILD_W3CTRACECONTEXT_TEST=OFF \ + -DWITH_OTLP_GRPC=ON \ + -DWITH_OTLP_HTTP=ON \ + -DWITH_OTLP_FILE=ON \ + -DWITH_OTLP_HTTP_COMPRESSION=ON \ + -DWITH_HTTP_CLIENT_CURL=ON \ + -DWITH_PROMETHEUS=ON \ + -DWITH_ZIPKIN=ON \ + -DWITH_ELASTICSEARCH=ON \ + -DWITH_EXAMPLES=ON \ + -DWITH_EXAMPLES_HTTP=ON \ + -DBUILD_W3CTRACECONTEXT_TEST=ON \ -DOPENTELEMETRY_INSTALL=OFF \ -DOPENTELEMETRY_CPP_SRC_DIR="${SRC_DIR}" \ "${SRC_DIR}/install/test/cmake/fetch_content_test" diff --git a/install/test/cmake/fetch_content_test/CMakeLists.txt b/install/test/cmake/fetch_content_test/CMakeLists.txt index 0bfbc87669..79df956248 100644 --- a/install/test/cmake/fetch_content_test/CMakeLists.txt +++ b/install/test/cmake/fetch_content_test/CMakeLists.txt @@ -33,7 +33,18 @@ FetchContent_MakeAvailable(opentelemetry-cpp) add_executable( fetch_content_src_test ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_api.cc - ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_sdk.cc) + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_sdk.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_ext_common.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_ext_http_curl.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_exporters_ostream.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_exporters_in_memory.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_exporters_otlp_common.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_exporters_otlp_grpc.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_exporters_otlp_http.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_exporters_otlp_file.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_exporters_prometheus.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_exporters_zipkin.cc + ${OPENTELEMETRY_CPP_SRC_DIR}/install/test/src/test_exporters_elasticsearch.cc) target_link_libraries( fetch_content_src_test @@ -42,6 +53,24 @@ target_link_libraries( opentelemetry-cpp::metrics opentelemetry-cpp::trace opentelemetry-cpp::logs + opentelemetry-cpp::http_client_curl + opentelemetry-cpp::in_memory_span_exporter + opentelemetry-cpp::in_memory_metric_exporter + opentelemetry-cpp::ostream_log_record_exporter + opentelemetry-cpp::ostream_metrics_exporter + opentelemetry-cpp::ostream_span_exporter + opentelemetry-cpp::otlp_file_exporter + opentelemetry-cpp::otlp_file_log_record_exporter + opentelemetry-cpp::otlp_file_metric_exporter + opentelemetry-cpp::otlp_grpc_exporter + opentelemetry-cpp::otlp_grpc_log_record_exporter + opentelemetry-cpp::otlp_grpc_metrics_exporter + opentelemetry-cpp::otlp_http_exporter + opentelemetry-cpp::otlp_http_log_record_exporter + opentelemetry-cpp::otlp_http_metric_exporter + opentelemetry-cpp::prometheus_exporter + opentelemetry-cpp::zipkin_trace_exporter + opentelemetry-cpp::elasticsearch_log_record_exporter GTest::gtest GTest::gtest_main) From 3386566e3aade8f2fc550978ec7dd978cd09c9f0 Mon Sep 17 00:00:00 2001 From: Douglas Barker Date: Wed, 21 May 2025 19:37:08 -0600 Subject: [PATCH 2/3] use apt to install abseil, protobuf, and grpc for the fetch content test --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1bea80756e..bc585fc26e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,7 @@ jobs: runs-on: ubuntu-24.04 env: CXX_STANDARD: '17' + BUILD_TYPE: 'Debug' steps: - name: Harden the runner (Audit all outbound calls) uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 @@ -75,9 +76,10 @@ jobs: sudo -E ./ci/setup_ci_environment.sh sudo -E ./ci/setup_cmake.sh sudo -E ./ci/setup_googletest.sh - sudo -E ./ci/install_abseil.sh - sudo -E ./ci/install_protobuf.sh - sudo -E ./ci/setup_grpc.sh -m -p protobuf -p abseil-cpp + - name: Install abseil, protobuf, and grpc with apt + run: | + sudo -E apt-get update + sudo -E apt-get install -y libabsl-dev libprotobuf-dev libgrpc++-dev protobuf-compiler protobuf-compiler-grpc - name: run fetch content cmake test run: | ./ci/do_ci.sh cmake.fetch_content.test From 297b9344ae8d00f2d2e2a2554f92df21d265a9e3 Mon Sep 17 00:00:00 2001 From: Douglas Barker Date: Wed, 21 May 2025 19:39:41 -0600 Subject: [PATCH 3/3] add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 741642377b..a6f91d0b50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,9 @@ Increment the: * [EXPORTER] ostream log exporter, fixed memory ownership issues [#3417](https://github.com/open-telemetry/opentelemetry-cpp/pull/3417) +* [TEST] Test all components in a CMake super build + [#3433](https://github.com/open-telemetry/opentelemetry-cpp/pull/3433) + Important changes: * [EXPORTER] ostream log exporter, fixed memory ownership issues