mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
In case the before commit is not found in the history (in case of force push) inside the api testing ci job, it compares with the base branch commit.
154 lines
4.3 KiB
YAML
154 lines
4.3 KiB
YAML
name: API Integration Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
# paths-ignore:
|
|
# - "**.md"
|
|
# - "**.yml"
|
|
# - "**.yaml"
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
# paths-ignore:
|
|
# - "**.md"
|
|
# - "**.yml"
|
|
# - "**.yaml"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
COLUMNS: 150
|
|
ZO_ROOT_USER_EMAIL: root@example.com
|
|
ZO_ROOT_USER_PASSWORD: Complexpass#123
|
|
ZO_BASE_URL: http://localhost:5080/
|
|
ZO_BASE_URL_SC: http://localhost:5080/
|
|
WS_ZO_BASE_URL: ws://localhost:5080/
|
|
ZO_USAGE_REPORTING_ENABLED: true
|
|
ZO_USAGE_PUBLISH_INTERVAL: 5
|
|
ZO_ALERT_SCHEDULE_INTERVAL: 3
|
|
ZO_SMTP_ENABLED: true
|
|
ZO_CREATE_ORG_THROUGH_INGESTION: true
|
|
|
|
jobs:
|
|
api_integration_tests:
|
|
name: api_integration_tests
|
|
runs-on: ubicloud-standard-8
|
|
steps:
|
|
- name: Remove unused tools
|
|
run: |
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf "/usr/local/share/boost"
|
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
|
|
- name: Checkout git repo
|
|
uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Rust Toolchain
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-11-11
|
|
|
|
- name: Setup Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-on-failure: true
|
|
prefix-key: api-testing
|
|
|
|
- name: Install Protoc
|
|
uses: arduino/setup-protoc@v3
|
|
with:
|
|
version: "21.12"
|
|
|
|
- name: Build OpenObserve debug binary
|
|
run: cargo build --features mimalloc
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11.6"
|
|
|
|
- name: Setup rye
|
|
uses: eifinger/setup-rye@v4
|
|
with:
|
|
enable-cache: true
|
|
working-directory: "tests/api-testing/"
|
|
version: "0.27.0"
|
|
|
|
- name: Start OpenObserve
|
|
run: target/debug/openobserve &
|
|
|
|
- name: Wait for start
|
|
run: sleep 15
|
|
|
|
- name: Pin cpython
|
|
run: rye pin cpython@3.11.6
|
|
working-directory: tests/api-testing/
|
|
|
|
- name: Rye sync
|
|
run: rye sync
|
|
working-directory: tests/api-testing/
|
|
|
|
- name: Run tests
|
|
run: |
|
|
echo "=== Running regression tests with ZO_UTF8_VIEW_ENABLED=false ==="
|
|
ZO_FEATURE_JOIN_MATCH_ONE_ENABLED=true ZO_UTF8_VIEW_ENABLED=false target/debug/openobserve > o2_utf8_false.log 2>&1 &
|
|
SERVER_PID_FALSE=$!
|
|
echo "OpenObserve PID for UTF8_VIEW=false: $SERVER_PID_FALSE"
|
|
sleep 15
|
|
|
|
# Run regression tests with UTF8_VIEW=false
|
|
rye run pytest tests/test_subquery_join_match.py --force-sugar -v
|
|
|
|
# Kill the server
|
|
kill $SERVER_PID_FALSE || true
|
|
sleep 5
|
|
|
|
echo "=== Running regression tests with ZO_UTF8_VIEW_ENABLED=true ==="
|
|
ZO_FEATURE_JOIN_MATCH_ONE_ENABLED=true ZO_UTF8_VIEW_ENABLED=true target/debug/openobserve > o2_utf8_true.log 2>&1 &
|
|
SERVER_PID_TRUE=$!
|
|
echo "OpenObserve PID for UTF8_VIEW=true: $SERVER_PID_TRUE"
|
|
sleep 15
|
|
|
|
# Run regression tests with UTF8_VIEW=true
|
|
rye run pytest tests/test_subquery_join_match.py --force-sugar -v
|
|
|
|
# Kill the server
|
|
kill $SERVER_PID_TRUE || true
|
|
sleep 5
|
|
|
|
echo "=== Running all other API tests with default settings ==="
|
|
target/debug/openobserve > o2_default.log 2>&1 &
|
|
SERVER_PID_DEFAULT=$!
|
|
echo "OpenObserve PID for other tests: $SERVER_PID_DEFAULT"
|
|
sleep 15
|
|
|
|
# Run all other tests (excluding regression tests)
|
|
rye run pytest --ignore=tests/test_subquery_join_match.py --force-sugar
|
|
|
|
# Kill the server
|
|
kill $SERVER_PID_DEFAULT || true
|
|
working-directory: tests/api-testing/
|
|
|
|
api_tests_summary:
|
|
runs-on: ubuntu-latest
|
|
permissions: {}
|
|
needs: [api_integration_tests]
|
|
if: always()
|
|
steps:
|
|
- name: Check test results
|
|
run: |
|
|
if [ "${{ needs.api_integration_tests.result }}" == "success" ] || [ "${{ needs.api_integration_tests.result }}" == "skipped" ]; then
|
|
echo "API tests passed or skipped"
|
|
exit 0
|
|
else
|
|
echo "API tests failed"
|
|
exit 1
|
|
fi
|