mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
### **User description**
We have recently observed that a lot of times the install protoc action
errors, so this instead removes the dependency on action and uses the
release url directly to download protoc. Technically it still goes
through the same github api, but now we have more precise control on
what is being called.
The next best thing would be vendoring the zip itself in the repo, which
I'm not particularly happy with, but can be tried.
___
### **PR Type**
Bug fix, Enhancement
___
### **Description**
- Add manual protoc installation script
- Replace setup-protoc action in workflows
- Support x86_64 and aarch64 detection
- Error handling for unsupported platforms
___
### Diagram Walkthrough
```mermaid
flowchart LR
CI["CI Workflow"] -- "execute protoc.sh" --> Script["protoc.sh"]
Script -- "download & unzip protoc" --> Setup["Protoc setup steps"]
Setup -- "copy binaries & headers" --> Done["Protoc installed"]
```
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>protoc.sh</strong><dd><code>Add manual protoc
installation script</code>
</dd></summary>
<hr>
.github/protoc.sh
<ul><li>Add shell script for manual protoc install<br> <li> Detect
platform (x86_64, aarch64)<br> <li> Download and unzip specified
release<br> <li> Copy binary and include files system-wide</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9725/files#diff-c91d907e5a707c73726a6c869b8391f8bed703cb1cbe9b54fc81fdef67a3e804">+19/-0</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>api-testing.yml</strong><dd><code>Replace setup-protoc
in API testing CI</code>
</dd></summary>
<hr>
.github/workflows/api-testing.yml
<ul><li>Remove arduino/setup-protoc action<br> <li> Add run step
invoking protoc.sh</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9725/files#diff-bf87f46624aaa9c4f1d9faa033baf531a543f2d4ac188cd64e9ab3febfee8f9e">+2/-3</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>build-pr-image.yml</strong><dd><code>Replace
setup-protoc in build-pr-image CI</code>
</dd></summary>
<hr>
.github/workflows/build-pr-image.yml
- Replace setup-protoc action
- Invoke protoc.sh in build-pr-image CI
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9725/files#diff-ebeabab3ec6b3ad90cc66cb9c0d9f2ad72c7ec6116e30e9801241b46992742d6">+8/-6</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>db-testing.yml</strong><dd><code>Replace setup-protoc
in DB testing CI</code>
</dd></summary>
<hr>
.github/workflows/db-testing.yml
- Remove setup-protoc action
- Invoke protoc.sh in DB testing CI
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9725/files#diff-25d80f07432f01a3a288495d1d29a8457c2897d5ec819137dea15ad239b122f9">+3/-4</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>playwright.yml</strong><dd><code>Replace setup-protoc
in Playwright CI</code>
</dd></summary>
<hr>
.github/workflows/playwright.yml
- Replace setup-protoc action
- Execute protoc.sh in Playwright CI
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9725/files#diff-7afcd2d8f7b49bda74843f209eefb7b2da45f7e7803bf2e4bd636699b76aa2d3">+4/-3</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>unit-tests.yml</strong><dd><code>Replace setup-protoc
in unit tests CI</code>
</dd></summary>
<hr>
.github/workflows/unit-tests.yml
<ul><li>Remove setup-protoc action in unit tests<br> <li> Call protoc.sh
when changes detected</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9725/files#diff-cd0effce06f425599e96952f4d5f684641a683f46d9909e7c74a9f8b2f03ccd3">+3/-3</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___
---------
Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
153 lines
4.3 KiB
YAML
153 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
|
|
run: |
|
|
bash ./.github/protoc.sh
|
|
|
|
- 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
|