Skip to content

Commit

Permalink
Add CMake OTELCPP_MAINTAINER_MODE (open-telemetry#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored and yxue committed Dec 5, 2022
1 parent c1aa65f commit 4be80df
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,55 @@ jobs:
cmake_gcc_maintainer_test:
name: CMake gcc (maintainer mode)
<<<<<<< HEAD
=======
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
run: |
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_cmake.sh
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_ci_environment.sh
- name: run cmake gcc (maintainer mode)
run: |
sudo CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/setup_thrift.sh
CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ./ci/do_ci.sh cmake.maintainer.test
cmake_clang_maintainer_test:
name: CMake clang (maintainer mode)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
run: |
sudo CC=/usr/bin/clang-12 CXX=/usr/bin/clang++-12 ./ci/setup_cmake.sh
sudo CC=/usr/bin/clang-12 CXX=/usr/bin/clang++-12 ./ci/setup_ci_environment.sh
- name: run cmake clang (maintainer mode)
run: |
sudo CC=/usr/bin/clang-12 CXX=/usr/bin/clang++-12 ./ci/setup_thrift.sh
CC=/usr/bin/clang-12 CXX=/usr/bin/clang++-12 ./ci/do_ci.sh cmake.maintainer.test
cmake_msvc_maintainer_test:
name: CMake msvc (maintainer mode)
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
run: |
./ci/setup_windows_cmake.ps1
./ci/setup_windows_ci_environment.ps1
- name: run tests
run: ./ci/do_ci.ps1 cmake.maintainer.test

cmake_deprecated_metrics_test:
name: CMake test (without otlp-exporter and with deprecated metrics)
>>>>>>> cf9ebb02 (Add CMake OTELCPP_MAINTAINER_MODE (#1650))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Increment the:
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
## [1.8.1] 2022-12-04

* [ETW Exporter] Tail based sampling support [#1780](https://github.com/open-telemetry/opentelemetry-cpp/pull/1780)
Expand Down Expand Up @@ -275,6 +276,8 @@ update the semantic convention in instrumentation library is needed.
>>>>>>> 737da806 (Upgrade opentelemetry-proto to v0.19.0 (#1579))
=======
>>>>>>> 92618117 (Prepare v1.6.1 release (#1630))
=======
>>>>>>> cf9ebb02 (Add CMake OTELCPP_MAINTAINER_MODE (#1650))
* [TRACE SDK] Add trace sdk builders (#1393)
[#1471](https://github.com/open-telemetry/opentelemetry-cpp/pull/1471)
* [EXAMPLE] Fix memory ownership of InMemorySpanExporter (#1473)
Expand All @@ -295,6 +298,10 @@ update the semantic convention in instrumentation library is needed.
=======
=======
=======
=======
* [BUILD] Add CMake OTELCPP_MAINTAINER_MODE [#1650](https://github.com/open-telemetry/opentelemetry-cpp/pull/1650)

>>>>>>> fa5f9fc1 (Add CMake OTELCPP_MAINTAINER_MODE (#1650))
## [1.6.1] 2022-09-22

>>>>>>> 5c180a16 (Prepare v1.6.1 release (#1630))
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,13 @@ option(BUILD_W3CTRACECONTEXT_TEST "Whether to build w3c trace context" OFF)

option(OTELCPP_MAINTAINER_MODE "Build in maintainer mode (-Wall -Werror)" OFF)

<<<<<<< HEAD
set(OTELCPP_PROTO_PATH
""
CACHE PATH "Path to opentelemetry-proto")

=======
>>>>>>> cf9ebb02 (Add CMake OTELCPP_MAINTAINER_MODE (#1650))
if(WIN32)
if(BUILD_TESTING)
if(MSVC)
Expand Down
4 changes: 4 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ elif [[ "$1" == "cmake.maintainer.test" ]]; then
-DWITH_JAEGER=ON \
-DWITH_ELASTICSEARCH=ON \
-DWITH_LOGS_PREVIEW=ON \
<<<<<<< HEAD
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
=======
-DWITH_METRICS_PREVIEW=OFF \
>>>>>>> cf9ebb02 (Add CMake OTELCPP_MAINTAINER_MODE (#1650))
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DOTELCPP_MAINTAINER_MODE=ON \
"${SRC_DIR}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ class HistogramExemplarReservoir : public FixedSizeExemplarReservoir
const MetricAttributes & /* attributes */,
const opentelemetry::context::Context & /* context */) override
{
<<<<<<< HEAD
size_t max_size = boundaries_.size();
for (size_t i = 0; i < max_size; ++i)
=======
int max_size = boundaries_.size();
for (int i = 0; i < max_size; ++i)
>>>>>>> cf9ebb02 (Add CMake OTELCPP_MAINTAINER_MODE (#1650))
{
if (value <= boundaries_[i])
{
Expand Down
8 changes: 8 additions & 0 deletions sdk/test/metrics/async_metric_storage_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,20 @@ TEST_P(WritableMetricStorageTestFixture, TestAggregation)
if (opentelemetry::nostd::get<std::string>(
data_attr.attributes.find("RequestType")->second) == "GET")
{
<<<<<<< HEAD
EXPECT_EQ(opentelemetry::nostd::get<int64_t>(data.value_), get_count1);
=======
EXPECT_EQ(opentelemetry::nostd::get<long>(data.value_), get_count1);
>>>>>>> cf9ebb02 (Add CMake OTELCPP_MAINTAINER_MODE (#1650))
}
else if (opentelemetry::nostd::get<std::string>(
data_attr.attributes.find("RequestType")->second) == "PUT")
{
<<<<<<< HEAD
EXPECT_EQ(opentelemetry::nostd::get<int64_t>(data.value_), put_count1);
=======
EXPECT_EQ(opentelemetry::nostd::get<long>(data.value_), put_count1);
>>>>>>> cf9ebb02 (Add CMake OTELCPP_MAINTAINER_MODE (#1650))
}
}
return true;
Expand Down

0 comments on commit 4be80df

Please sign in to comment.