You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe it would be great to better integrate googletest into the opentelemetry-cpp's build process, so when distro/system-wide googletest source code is available, it can be built along with opentelemetry-cpp.
I found a related issue while packaging opentelemetry-cpp to debian, getting tests that end up with FATAL, even if they should pass. E.g.:
test 515
Start 515: exporter.otlp.OtlpHttpExporterTest.Shutdown
515: Test command: /home/santiago/cpp/opentelemetry-cpp-1.19.0/obj-x86_64-linux-gnu/exporters/otlp/otlp_http_exporter_test "--gtest_filter=OtlpHttpExporterTest.Shutdown"
515: Working Directory: /home/santiago/cpp/opentelemetry-cpp-1.19.0/obj-x86_64-linux-gnu/exporters/otlp
515: Test timeout computed to be: 1500
515: Running main() from ./googletest/src/gtest_main.cc
515: Note: Google Test filter = OtlpHttpExporterTest.Shutdown
515: [==========] Running 1 test from 1 test suite.
515: [----------] Global test environment set-up.
515: [----------] 1 test from OtlpHttpExporterTest
515: [ RUN ] OtlpHttpExporterTest.Shutdown
515: [Error] File: ./exporters/otlp/src/otlp_http_exporter.cc:150 [OTLP TRACE HTTP Exporter] ERROR: Export 0 trace span(s) failed, exporter is shutdown
515: [ OK ] OtlpHttpExporterTest.Shutdown (0 ms)
515: [----------] 1 test from OtlpHttpExporterTest (0 ms total)
515:
515: [----------] Global test environment tear-down
515: [==========] 1 test from 1 test suite ran. (0 ms total)
515: [ PASSED ] 1 test.
515:
515: [ FATAL ] ./googletest/include/gtest/internal/gtest-port.h:1811:: pthread_key_delete(key_)failed with error 22
515/609 Test #515: exporter.otlp.OtlpHttpExporterTest.Shutdown ..........................................................Subprocess aborted***Exception: 0.01 sec
Running main() from ./googletest/src/gtest_main.cc
Note: Google Test filter = OtlpHttpExporterTest.Shutdown
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from OtlpHttpExporterTest
[ RUN ] OtlpHttpExporterTest.Shutdown
[Error] File: ./exporters/otlp/src/otlp_http_exporter.cc:150 [OTLP TRACE HTTP Exporter] ERROR: Export 0 trace span(s) failed, exporter is shutdown
[ OK ] OtlpHttpExporterTest.Shutdown (0 ms)
[----------] 1 test from OtlpHttpExporterTest (0 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[ PASSED ] 1 test.
[ FATAL ] ./googletest/include/gtest/internal/gtest-port.h:1811:: pthread_key_delete(key_)failed with error 22
I understand that for opentelemetry-cpp's CI, googletest is setup with ./ci/setup_googletest.sh, but it is suboptimal from a distro packaging PoV.
I'd propose to rely on CMake's very features (ExternalProject / FindGTest) to build and find the googletest libraries. I belive
The text was updated successfully, but these errors were encountered:
lalitb
added
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
and removed
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
labels
Feb 19, 2025
@santiagorr Thanks for the issue. Would you like to contribute the PR?
I am far from being a cmake expert. I could try, if nobody else is eager to address it, but it would be great if someone with more cmake experience is available.
Add GoogleTest as a git submodule or equivalent. This may not always be possible or appropriate. Git submodules, for example, have their own set of advantages and drawbacks.
I believe it would be great to better integrate googletest into the opentelemetry-cpp's build process, so when distro/system-wide googletest source code is available, it can be built along with opentelemetry-cpp.
As googletest upstream recommends, gtest and gmock should be compiled with the same flags than the tested code (http://groups.google.com/group/googletestframework/browse_thread/thread/668eff1cebf5309d). Upstream doesn't recommend to rely on precompiled libraries.
I found a related issue while packaging opentelemetry-cpp to debian, getting tests that end up with
FATAL
, even if they should pass. E.g.:I understand that for opentelemetry-cpp's CI, googletest is setup with ./ci/setup_googletest.sh, but it is suboptimal from a distro packaging PoV.
I'd propose to rely on CMake's very features (
ExternalProject
/FindGTest
) to build and find the googletest libraries. I beliveThe text was updated successfully, but these errors were encountered: