Add Prometheus Exporter - Utils Unit Tests#251
Conversation
Codecov Report
@@ Coverage Diff @@
## master #251 +/- ##
=========================================
Coverage ? 92.47%
=========================================
Files ? 142
Lines ? 6204
Branches ? 0
=========================================
Hits ? 5737
Misses ? 467
Partials ? 0 |
…ntiles when it cannot collect quantile data
| target_link_libraries( | ||
| ${testname} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} | ||
| prometheus_exporter prometheus-cpp::pull) | ||
| gtest_add_tests(TARGET ${testname} TEST_PREFIX exporter. TEST_LIST ${testname}) |
There was a problem hiding this comment.
Could you combine this unit tests with the piece of code that is tested into one PR? And provide Bazel build support for it, as well as hooking it into the global CMake build by adding the prometheus directory as a subdirectory to exporters/CMakeLists.txt?
I would greatly help the reviewing process to have those tests running in the CI.
There was a problem hiding this comment.
Yes, I can do that, but I am worrying that the combined PR will be so big. We have three unit test files that contain more than 1000 lines. Can we have such a large PR?
There was a problem hiding this comment.
I think it's good to have each PR buildable, with unit tests that cover the added new functionality. If the only way to ensure that is a bigger PR, than I think it's better to have a bigger PR.
Maybe you can have three PRs: first the exporter utils with unit tests, second the collector with unit tests based on the first, and third the exporter with unit tests based on the second. We can then review and merge from first to third, rebasing later ones when previous ones got merged.
|
Refactored in #280 |
chore(deps): update dependency gazelle to v0.43.0
This PR implements the unit tests for utils in the exporter/prometheus/test folder for the Prometheus Exporter project. The C++ file prometheus_exporter_utils_test.cc implements all the unit test suites for the helper functions that will be called when we translate a OpenTelemetry (OTLP) metric to a Prometheus metric.
Note to reviewers: