mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 08:09:27 +00:00
### **PR Type** Tests, Enhancement ___ ### **Description** - Introduce core pipeline Playwright test suite - Skip redundant pipeline tests in pipelines.spec.js - Increase CI workers count in config - Add helper functions for login and ingestion ___ ### **Changes diagram** ```mermaid flowchart LR CT["pipeline-core.spec.js"] PT["pipelines.spec.js"] PC["playwright.config.js"] CI["CI pipeline"] CT -- "adds core tests" --> CI PT -- "skip redundant tests" --> CI PC -- "increase CI workers" --> CI ``` ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>pipeline-core.spec.js</strong><dd><code>Add core pipeline UI tests</code> </dd></summary> <hr> tests/ui-testing/playwright-tests/pipeline-core.spec.js <li>Add new Playwright tests for core pipeline flows<br> <li> Implement helper functions: login, ingestion, exploration<br> <li> Test source-destination, function, and condition nodes<br> <li> Configure tests to run in parallel mode </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7404/files#diff-e6249b045437e7f087b825dc0ee2d8ccebed0894d10c84b7bc9b12dca7a25754">+269/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>pipelines.spec.js</strong><dd><code>Skip redundant pipeline tests</code> </dd></summary> <hr> tests/ui-testing/playwright-tests/pipelines.spec.js <li>Mark three pipeline tests as skipped<br> <li> Update tests: source & destination, function, condition flows<br> <li> Retain old tests but disable execution </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7404/files#diff-9b48f5edc53f2413789549b189d4a80f134a320dd5beebf96d738069eb43033a">+3/-3</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>playwright.config.js</strong><dd><code>Increase CI workers count</code> </dd></summary> <hr> tests/ui-testing/playwright.config.js - Increase CI `workers` from 1 to 2 for parallel runs </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7404/files#diff-91cb9615068914b2e4f5d66fcbed50d3e9771ea2d882f8e8048bbe54eab3c414">+1/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
254 lines
7.9 KiB
YAML
254 lines
7.9 KiB
YAML
name: Playwright UI Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
# paths:
|
|
# - "web/**"
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
# paths:
|
|
# - "web/**"
|
|
|
|
env:
|
|
COLUMNS: 150
|
|
ZO_ROOT_USER_EMAIL: root@example.com
|
|
ZO_ROOT_USER_PASSWORD: Complexpass#123
|
|
ZO_BASE_URL: http://localhost:5080
|
|
WS_ZO_BASE_URL: ws://localhost:5080
|
|
ZO_BASE_URL_SC: http://localhost:5080
|
|
ZO_BASE_URL_SC_UI: http://localhost:5080
|
|
INGESTION_URL: http://localhost:5080
|
|
ORGNAME: default
|
|
ZO_QUICK_MODE_NUM_FIELDS: 100
|
|
ZO_QUICK_MODE_STRATEGY: first
|
|
ZO_ALLOW_USER_DEFINED_SCHEMAS: true
|
|
ZO_INGEST_ALLOWED_UPTO: 5
|
|
ZO_FEATURE_QUERY_EXCLUDE_ALL: false
|
|
ZO_USAGE_BATCH_SIZE: 200
|
|
ZO_USAGE_PUBLISH_INTERVAL: 2
|
|
ZO_USAGE_REPORTING_ENABLED: true
|
|
ZO_MIN_AUTO_REFRESH_INTERVAL: 5
|
|
ZO_WEBSOCKET_ENABLED: true
|
|
ZO_STREAMING_ENABLED: true
|
|
ZO_COLS_PER_RECORD_LIMIT: "80000"
|
|
ZO_SMTP_ENABLED: true
|
|
ZO_FORMAT_STREAM_NAME_TO_LOWERCASE: false
|
|
ZO_CREATE_ORG_THROUGH_INGESTION: true
|
|
|
|
jobs:
|
|
build_binary:
|
|
name: build_binary
|
|
runs-on:
|
|
labels: ubicloud-standard-16
|
|
|
|
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: Clone the current repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust Toolchain
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: nightly-2025-03-02
|
|
targets: x86_64-unknown-linux-gnu
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-on-failure: true
|
|
- name: Install Protoc
|
|
uses: arduino/setup-protoc@v3
|
|
with:
|
|
version: "21.12"
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Build frontend code
|
|
env:
|
|
NODE_OPTIONS: "--max-old-space-size=8192"
|
|
VITE_COVERAGE: "true"
|
|
COVERAGE: "true"
|
|
run: cd web && npm install && npm run build
|
|
|
|
- name: Build and run binary
|
|
run: cargo build --release --target x86_64-unknown-linux-gnu
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: debug-binary
|
|
path: target/x86_64-unknown-linux-gnu/release/openobserve
|
|
retention-days: 1
|
|
|
|
ui_integration_tests:
|
|
name: playwright_ui_integration_tests
|
|
needs: [build_binary]
|
|
runs-on:
|
|
labels: ubicloud-standard-8
|
|
container:
|
|
image: mcr.microsoft.com/playwright:v1.50.0-jammy
|
|
options: --user root
|
|
strategy:
|
|
matrix:
|
|
browser: [chrome]
|
|
testfilename: [
|
|
"alerts/alerts-e2e-flow.spec.js",
|
|
"alerts/alerts-ui-operations.spec.js",
|
|
"alerts/alerts-import.spec.js",
|
|
"changeOrg.spec.js",
|
|
"dashboards/custom-charts.spec.js",
|
|
"dashboards/dashboard.spec.js",
|
|
"dashboards/dashboard-filter.spec.js",
|
|
"dashboards/dashboard-folder.spec.js",
|
|
"dashboards/dashboard-geoMap.spec.js",
|
|
"dashboards/dashboard-general-setting.spec.js",
|
|
"dashboards/dashboard-import.spec.js",
|
|
"dashboards/dashboard-maps.spec.js",
|
|
"dashboards/dashboard-multi-y-axis.spec.js",
|
|
"dashboards/dashboard-tabs-setting.spec.js",
|
|
"dashboards/dashboard-transpose.spec.js",
|
|
"dashboards/dashboard-variables-setting.spec.js",
|
|
"dashboards/dashboard2.spec.js",
|
|
"dashboards/dashboardtype.spec.js",
|
|
"dashboards/visualize.spec.js",
|
|
"dashboards/visualization-vrl.spec.js",
|
|
"enrichment.spec.js",
|
|
"join.spec.js",
|
|
"logshistogram.spec.js",
|
|
"logspage.spec.js",
|
|
"logsqueries.spec.js",
|
|
"logsquickmode.spec.js",
|
|
"multiselect-stream.spec.js",
|
|
"pagination.spec.js",
|
|
"pipelines.spec.js",
|
|
"reportsUpdated.spec.js",
|
|
"reportsUpdated2.spec.js",
|
|
"sanity.spec.js",
|
|
"sanity2.spec.js",
|
|
"schema.spec.js",
|
|
"schemaload.spec.js",
|
|
"secondsPrecisionAdded.spec.js",
|
|
"serviceAccount.spec.js",
|
|
"streamname.spec.js",
|
|
"streaming.spec.js",
|
|
"unflattened.spec.js",
|
|
"usersOrg.spec.js",
|
|
"websocket.spec.js",
|
|
"pipeline-dynamic.spec.js",
|
|
"searchpartition.spec.js",
|
|
"pipeline-core.spec.js"
|
|
# "remotepipeline.spec.js",
|
|
|
|
]
|
|
|
|
steps:
|
|
- name: Clone the current repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
|
|
- name: Start OpenObserve
|
|
run: chmod +x ./debug-binary/openobserve && ./debug-binary/openobserve > o2.log 2>&1 &
|
|
|
|
- name: Wait for start
|
|
run: sleep 15
|
|
|
|
- name: Ensure we are getting a reply from the server
|
|
run: curl http://localhost:5080/web/login
|
|
|
|
- name: Create coverage json folder
|
|
run: mkdir -p tests/ui-testing/.nyc_output
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
- name: Install dependencies and run ui-tests
|
|
run: |
|
|
touch .env
|
|
echo "ZO_ROOT_USER_EMAIL=${ZO_ROOT_USER_EMAIL}" >> .env
|
|
echo "ZO_ROOT_USER_PASSWORD=${ZO_ROOT_USER_PASSWORD}" >> .env
|
|
echo "ZO_BASE_URL=${ZO_BASE_URL}" >> .env
|
|
echo "WS_ZO_BASE_URL=${WS_ZO_BASE_URL}" >> .env
|
|
echo "ZO_BASE_URL_SC=${ZO_BASE_URL_SC}" >> .env
|
|
echo "ZO_BASE_URL_SC_UI=${ZO_BASE_URL_SC_UI}" >> .env
|
|
echo "INGESTION_URL=${INGESTION_URL}" >> .env
|
|
echo "ORGNAME=${ORGNAME}" >> .env
|
|
echo "ZO_SMTP_ENABLED=${ZO_SMTP_ENABLED}" >> .env
|
|
mv .env tests/ui-testing
|
|
cd tests/ui-testing && npm ci && npx playwright test ./playwright-tests/${{ matrix.testfilename }}
|
|
|
|
# - name: Check OpenObserve logs
|
|
# if: always()
|
|
# run: cat o2.log
|
|
|
|
- name: Sanitize Test Filename
|
|
shell: bash
|
|
run: |
|
|
# Assign the matrix variable to a Bash variable
|
|
SANITIZED_FILENAME="${{ matrix.testfilename }}"
|
|
# Replace all '/' characters with '_'
|
|
SANITIZED_FILENAME="${SANITIZED_FILENAME//\//_}"
|
|
# Export as a GitHub Actions environment variable
|
|
echo "SANITIZED_FILENAME=$SANITIZED_FILENAME" >> $GITHUB_ENV
|
|
|
|
- name: Upload Coverage Data
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: playwright-coverage-${{ env.SANITIZED_FILENAME }}
|
|
path: tests/ui-testing/.nyc_output
|
|
include-hidden-files: true
|
|
|
|
- name: Generate Coverage Report
|
|
run: cd tests/ui-testing && npx nyc report
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report/
|
|
retention-days: 30
|
|
|
|
generate_coverage_report:
|
|
name: Generate Coverage Report
|
|
needs: [build_binary, ui_integration_tests]
|
|
runs-on: ubicloud-standard-8
|
|
if: always()
|
|
|
|
steps:
|
|
- name: Clone the current repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download Playwright Coverage Data
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
pattern: playwright-coverage-* # Match all artifacts with this prefix
|
|
path: merged-coverage
|
|
merge-multiple: true
|
|
|
|
- name: Verify Downloaded Files
|
|
run: ls -R merged-coverage # Check the structure and contents
|
|
|
|
- name: Move Coverage Files to .nyc_output
|
|
run: |
|
|
mkdir -p tests/ui-testing/.nyc_output
|
|
mv merged-coverage/* tests/ui-testing/.nyc_output/ || echo "No files to move"
|
|
|
|
- name: Generate Coverage Report
|
|
run: cd tests/ui-testing && npm ci && npx nyc report
|
|
|
|
- name: Upload Coverage Report
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: coverage-report
|
|
path: tests/ui-testing/coverage-report
|
|
retention-days: 7
|