diff --git a/.github/workflows/ci-pr-validation.yaml b/.github/workflows/ci-pr-validation.yaml index 61134aae..d88eb137 100644 --- a/.github/workflows/ci-pr-validation.yaml +++ b/.github/workflows/ci-pr-validation.yaml @@ -59,8 +59,8 @@ jobs: cmake -S wireshark -B build-wireshark cmake --build build-wireshark - unit-tests: - name: Run unit tests + build: + name: Run build runs-on: ubuntu-22.04 timeout-minutes: 120 @@ -84,22 +84,78 @@ jobs: fi make check-format + - name: Install gtest-parallel + run: | + sudo curl -o /gtest-parallel https://raw.githubusercontent.com/google/gtest-parallel/master/gtest_parallel.py + + - name: Build perf tools + run: | + cmake . -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON -DBUILD_PERF_TOOLS=ON + cmake --build . -j8 + + build-test: + name: Run test build + runs-on: ubuntu-22.04 + timeout-minutes: 120 + + steps: + - name: checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + - name: Build tests run: | cmake . -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON cmake --build . -j8 - - name: Install gtest-parallel - run: | - sudo curl -o /gtest-parallel https://raw.githubusercontent.com/google/gtest-parallel/master/gtest_parallel.py + - uses: actions/upload-artifact@master + with: + name: build + path: ./pulsar-client-cpp + + unit-tests: + name: Run unit tests + needs: build-test + runs-on: ubuntu-22.04 + timeout-minutes: 120 + + steps: + - name: checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + + - uses: actions/download-artifact@master + with: + name: build + path: ./pulsar-client-cpp - name: Run unit tests run: RETRY_FAILED=3 ./run-unit-tests.sh - - name: Build perf tools - run: | - cmake . -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON -DBUILD_PERF_TOOLS=ON - cmake --build . -j8 + loadbalancer-integ-tests: + name: Run load balancer integ tests + needs: build-test + runs-on: ubuntu-22.04 + timeout-minutes: 10 + + steps: + - name: checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + + - uses: actions/download-artifact@master + with: + name: build + path: ./pulsar-client-cpp + + - name: Run unit tests + run: RETRY_FAILED=3 ./run-loadbalancer-integ-tests.sh cpp20-build: name: Build with the C++20 standard @@ -337,7 +393,7 @@ jobs: check-completion: name: Check Completion runs-on: ubuntu-latest - needs: [wireshark-dissector-build, unit-tests, cpp20-build, cpp-build-windows, package, cpp-build-macos] + needs: [wireshark-dissector-build, build, build-test, unit-tests, loadbalancer-integ-tests, cpp20-build, cpp-build-windows, package, cpp-build-macos] steps: - run: true diff --git a/run-loadbalancer-integ-tests.sh b/run-loadbalancer-integ-tests.sh new file mode 100755 index 00000000..49ba87d4 --- /dev/null +++ b/run-loadbalancer-integ-tests.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +set -e + +ROOT_DIR=$(git rev-parse --show-toplevel) +cd $ROOT_DIR + +if [[ ! $CMAKE_BUILD_DIRECTORY ]]; then + CMAKE_BUILD_DIRECTORY=. +fi + +# Run ExtensibleLoadManager tests +docker compose -f tests/extensibleLM/docker-compose.yml up -d +docker compose -f tests/blue-green/docker-compose.yml up -d +until curl http://localhost:8080/metrics > /dev/null 2>&1 ; do sleep 1; done +until curl http://localhost:8081/metrics > /dev/null 2>&1 ; do sleep 1; done +sleep 5 +$CMAKE_BUILD_DIRECTORY/tests/ExtensibleLoadManagerTest +docker compose -f tests/blue-green/docker-compose.yml down +docker compose -f tests/extensibleLM/docker-compose.yml down +exit(1)