From d04e1ce3618cab7047b5058a1a52065316899c45 Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Fri, 12 Aug 2022 18:31:49 +0200 Subject: [PATCH] Add CI jobs for new and deprecated metrics (#1531) --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ ci/do_ci.sh | 35 ++++++++++++++++++++++++++--------- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 854741437d..15274be986 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,22 @@ jobs: sudo ./ci/setup_thrift.sh ./ci/do_ci.sh cmake.test + cmake_deprecated_metrics_test: + name: CMake test (without otlp-exporter and with deprecated metrics) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: setup + run: | + sudo ./ci/setup_cmake.sh + sudo ./ci/setup_ci_environment.sh + - name: run cmake tests (without otlp-exporter) + run: | + sudo ./ci/setup_thrift.sh + ./ci/do_ci.sh cmake.deprecated_metrics.test + cmake_with_async_export_test: name: CMake test (without otlp-exporter and with async export) runs-on: ubuntu-latest @@ -166,6 +182,28 @@ jobs: - name: run tests run: ./ci/do_ci.sh bazel.test + bazel_deprecated_metrics_test: + name: Bazel deprecated metrics + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: Mount Bazel Cache + uses: actions/cache@v3 + env: + cache-name: bazel_cache + with: + path: /home/runner/.cache/bazel + key: bazel_test + - name: setup + run: | + sudo ./ci/setup_thrift.sh dependencies_only + sudo ./ci/setup_ci_environment.sh + sudo ./ci/install_bazelisk.sh + - name: run tests + run: ./ci/do_ci.sh bazel.deprecated_metrics.test + bazel_test_async: name: Bazel with async export runs-on: ubuntu-latest diff --git a/ci/do_ci.sh b/ci/do_ci.sh index f8ec8934da..bf775fa564 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -60,10 +60,7 @@ mkdir -p "${BUILD_DIR}" mkdir -p "${PLUGIN_DIR}" BAZEL_OPTIONS="--copt=-DENABLE_LOGS_PREVIEW --copt=-DENABLE_TEST" -# Previous legacy metrics use virtual drive, which can not be used without RTTI -if [[ "$1" != "bazel.nortti" ]]; then - BAZEL_OPTIONS="$BAZEL_OPTIONS --copt=-DENABLE_METRICS_PREVIEW" -fi + BAZEL_TEST_OPTIONS="$BAZEL_OPTIONS --test_output=errors" BAZEL_OPTIONS_ASYNC="$BAZEL_OPTIONS --copt=-DENABLE_ASYNC_EXPORT" @@ -100,7 +97,7 @@ elif [[ "$1" == "cmake.with_async_export.test" ]]; then -DWITH_ZIPKIN=ON \ -DWITH_JAEGER=ON \ -DWITH_ELASTICSEARCH=ON \ - -DWITH_METRICS_PREVIEW=ON \ + -DWITH_METRICS_PREVIEW=OFF \ -DWITH_LOGS_PREVIEW=ON \ -DCMAKE_CXX_FLAGS="-Werror" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ @@ -108,11 +105,27 @@ elif [[ "$1" == "cmake.with_async_export.test" ]]; then make make test exit 0 -elif [[ "$1" == "cmake.abseil.test" ]]; then +elif [[ "$1" == "cmake.deprecated_metrics.test" ]]; then cd "${BUILD_DIR}" rm -rf * cmake -DCMAKE_BUILD_TYPE=Debug \ + -DWITH_PROMETHEUS=ON \ + -DWITH_ZIPKIN=OFF \ + -DWITH_JAEGER=OFF \ + -DWITH_ELASTICSEARCH=OFF \ -DWITH_METRICS_PREVIEW=ON \ + -DWITH_LOGS_PREVIEW=OFF \ + -DCMAKE_CXX_FLAGS="-Werror" \ + -DWITH_ASYNC_EXPORT_PREVIEW=ON \ + "${SRC_DIR}" + make + make test + exit 0 +elif [[ "$1" == "cmake.abseil.test" ]]; then + cd "${BUILD_DIR}" + rm -rf * + cmake -DCMAKE_BUILD_TYPE=Debug \ + -DWITH_METRICS_PREVIEW=OFF \ -DWITH_LOGS_PREVIEW=ON \ -DCMAKE_CXX_FLAGS="-Werror" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ @@ -136,7 +149,7 @@ elif [[ "$1" == "cmake.c++20.stl.test" ]]; then cd "${BUILD_DIR}" rm -rf * cmake -DCMAKE_BUILD_TYPE=Debug \ - -DWITH_METRICS_PREVIEW=ON \ + -DWITH_METRICS_PREVIEW=OFF \ -DWITH_LOGS_PREVIEW=ON \ -DCMAKE_CXX_FLAGS="-Werror" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ @@ -242,6 +255,10 @@ elif [[ "$1" == "bazel.test" ]]; then bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS //... bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS //... exit 0 +elif [[ "$1" == "bazel.deprecated_metrics.test" ]]; then + bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS --copt=-DENABLE_METRICS_PREVIEW //... + bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS --copt=-DENABLE_METRICS_PREVIEW //... + exit 0 elif [[ "$1" == "bazel.with_async_export.test" ]]; then bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS_ASYNC //... bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS_ASYNC //... @@ -262,8 +279,8 @@ elif [[ "$1" == "bazel.legacy.test" ]]; then elif [[ "$1" == "bazel.noexcept" ]]; then # there are some exceptions and error handling code from the Prometheus and Jaeger Clients # that make this test always fail. ignore Prometheus and Jaeger exporters in the noexcept here. - bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/... - bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/... + bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/... -//sdk/test/metrics:attributes_hashmap_test + bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/... -//sdk/test/metrics:attributes_hashmap_test exit 0 elif [[ "$1" == "bazel.nortti" ]]; then # there are some exceptions and error handling code from the Prometheus and Jaeger Clients