Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI jobs for new and deprecated metrics #1531

Merged
merged 14 commits into from
Aug 12, 2022
60 changes: 59 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 deprecated metrics)
esigo marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down Expand Up @@ -98,6 +114,28 @@ jobs:
CC: /usr/bin/gcc-4.8
CXX: /usr/bin/g++-4.8

cmake_gcc_48_otlp_exporter_deprecated_metrics_test:
name: CMake gcc 4.8 (with otlp exporter and deprecated metrics)
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: setup
run: |
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_gcc48.sh
- name: setup cmake
run: |
sudo CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 ./ci/setup_cmake.sh
- name: setup grpc
run: |
sudo CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 ./ci/setup_grpc.sh -v 4.8
- name: run tests
run: ./ci/do_ci.sh cmake.legacy.exporter.otprotocol.deprecated_metrics.test
env:
CC: /usr/bin/gcc-4.8
CXX: /usr/bin/g++-4.8
cmake_test_cxx20:
name: CMake C++20 test
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -165,7 +203,27 @@ jobs:
sudo ./ci/install_bazelisk.sh
- name: run tests
run: ./ci/do_ci.sh bazel.test

bazel_deprecated_metrics_test:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - add newline before and after this test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, done

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
Expand Down
45 changes: 42 additions & 3 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,35 @@ 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 \
"${SRC_DIR}"
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 \
Expand All @@ -136,7 +152,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 \
Expand All @@ -158,6 +174,25 @@ elif [[ "$1" == "cmake.legacy.test" ]]; then
make
make test
exit 0
elif [[ "$1" == "cmake.legacy.exporter.otprotocol.deprecated_metrics.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
export BUILD_ROOT="${BUILD_DIR}"
${SRC_DIR}/tools/build-gtest.sh
${SRC_DIR}/tools/build-benchmark.sh
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_STANDARD=11 \
-DWITH_OTLP=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_METRICS_PREVIEW=ON \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
"${SRC_DIR}"
grpc_cpp_plugin=`which grpc_cpp_plugin`
proto_make_file="CMakeFiles/opentelemetry_proto.dir/build.make"
sed -i "s~gRPC_CPP_PLUGIN_EXECUTABLE-NOTFOUND~$grpc_cpp_plugin~" ${proto_make_file} #fixme
make -j $(nproc)
cd exporters/otlp && make test
exit 0
elif [[ "$1" == "cmake.legacy.exporter.otprotocol.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
Expand Down Expand Up @@ -242,6 +277,10 @@ elif [[ "$1" == "bazel.test" ]]; then
bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS //...
owent marked this conversation as resolved.
Show resolved Hide resolved
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 //...
Expand Down