Skip to content

Commit

Permalink
creaetd a separate ci for load balancer
Browse files Browse the repository at this point in the history
  • Loading branch information
heesung-sn committed Mar 4, 2024
1 parent 51e310c commit 781877e
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 10 deletions.
76 changes: 66 additions & 10 deletions .github/workflows/ci-pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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: ./build

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: ./build

- 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: ./build

- name: Run unit tests
run: RETRY_FAILED=3 ./run-loadbalancer-integ-tests.sh

cpp20-build:
name: Build with the C++20 standard
Expand Down Expand Up @@ -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
39 changes: 39 additions & 0 deletions run-loadbalancer-integ-tests.sh
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 781877e

Please sign in to comment.