mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +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>
82 lines
2.3 KiB
JavaScript
82 lines
2.3 KiB
JavaScript
// @ts-check
|
|
const { defineConfig, devices } = require('@playwright/test');
|
|
import dotenv from 'dotenv';
|
|
dotenv.config();
|
|
|
|
/**
|
|
* Read environment variables from file.
|
|
* https://github.com/motdotla/dotenv
|
|
*/
|
|
// require('dotenv').config();
|
|
|
|
/**
|
|
* @see https://playwright.dev/docs/test-configuration
|
|
*/
|
|
module.exports = defineConfig({
|
|
testDir: './playwright-tests',
|
|
/* Run tests in files in parallel */
|
|
fullyParallel: true,
|
|
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
forbidOnly: !!process.env.CI,
|
|
/* Retry on CI only */
|
|
retries: process.env.CI ? 2 : 0,
|
|
/* Opt out of parallel tests on CI. */
|
|
workers: process.env.CI ? 2 : undefined,
|
|
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
reporter: 'html',
|
|
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
use: {
|
|
/* Base URL to use in actions like `await page.goto('/')`. */
|
|
baseURL: process.env["ZO_BASE_URL"],
|
|
|
|
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
trace: 'on-first-retry',
|
|
},
|
|
timeout: 5 * 60 * 1000,
|
|
|
|
/* Configure projects for major browsers */
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { ...devices['Desktop Chrome'], viewport: { width: 1500, height: 1024 }, },
|
|
},
|
|
// {
|
|
// name: 'webkit', // Safari/WebKit configuration
|
|
// use: {
|
|
// ...devices['Desktop Safari'], // Uses Playwright's pre-defined device settings for Safari
|
|
// viewport: { width: 1500, height: 1024 },
|
|
// },
|
|
// },
|
|
// }
|
|
|
|
/* Test against mobile viewports. */
|
|
// {
|
|
// name: 'Mobile Chrome',
|
|
// use: { ...devices['Pixel 5'] },
|
|
// },
|
|
// {
|
|
// name: 'Mobile Safari',
|
|
// use: { ...devices['iPhone 12'] },
|
|
// },
|
|
|
|
/* Test against branded browsers. */
|
|
// {
|
|
// name: 'Microsoft Edge',
|
|
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
|
|
// },
|
|
// {
|
|
// name: 'Google Chrome',
|
|
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
|
|
// }
|
|
|
|
],
|
|
|
|
/* Run your local dev server before starting the tests */
|
|
// webServer: {
|
|
// command: 'npm run start',
|
|
// url: 'http://127.0.0.1:3000',
|
|
// reuseExistingServer: !process.env.CI,
|
|
// },
|
|
});
|
|
|