### **PR Type** Tests, Enhancement ___ ### **Description** - Add extensive unit tests across modules - Expose internal methods for testability - Extend props for query component metadata - Minor query and ingestion component updates ___ ### Diagram Walkthrough ```mermaid flowchart LR ImportPipelineSpec["ImportPipeline.spec.ts (new tests)"] RunningQueriesSpec["RunningQueries.spec.ts (new tests)"] RunningQueriesListSpec["RunningQueriesList.spec.ts (new tests)"] PlansSpec["Billing plans.spec.ts (new tests)"] OtelLogsSpec["Logs OtelConfig.spec.ts (new tests)"] ImportPipelineVue["ImportPipeline.vue (expose internals)"] QueryListVue["QueryList.vue (add metaData prop)"] ImportPipelineSpec -- tests --> ImportPipelineVue RunningQueriesSpec -- tests --> RunningQueriesVue["RunningQueries.vue (updated)"] RunningQueriesListSpec -- tests --> RunningQueriesListVue["RunningQueriesList.vue"] PlansSpec -- tests --> BillingServices["Billing services"] OtelLogsSpec -- tests --> OtelLogsVue["OtelConfig.vue (logs)"] QueryListSpec["QueryList.spec.ts (new tests)"] -- tests --> QueryListVue ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><details><summary>11 files</summary><table> <tr> <td><strong>ImportPipeline.spec.ts</strong><dd><code>Add thorough unit tests for ImportPipeline</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-228ad64e4e9ffc0096add762a2619f4531b1fdd638a18b02d031f98bda0f76fd">+1083/-0</a></td> </tr> <tr> <td><strong>RunningQueries.spec.ts</strong><dd><code>Add comprehensive tests for RunningQueries view</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-b73fab81a4d70291bca59d1f0f408f872705829fadad6b8b6fe1165d8f022490">+680/-0</a> </td> </tr> <tr> <td><strong>RunningQueriesList.spec.ts</strong><dd><code>Add unit tests for RunningQueriesList table</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-b80dbf8f275c5bbdae8c5b1b336a67d3dbc6aa8e6f27dd4b8be548c1e6eafae3">+664/-0</a> </td> </tr> <tr> <td><strong>plans.spec.ts</strong><dd><code>Add unit tests for billing plans component</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-4398fd7c1bd0322c6a964f63b59dd79a190c2f089792460ec43dfa1cd9a8063f">+664/-0</a> </td> </tr> <tr> <td><strong>OtelConfig.spec.ts</strong><dd><code>Add unit tests for logs OtelConfig generator</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-46fbf1ab0a2ead705ff5593e115166853ebdfc66e463f893b7e8934bb50bacde">+340/-0</a> </td> </tr> <tr> <td><strong>invoiceTable.spec.ts</strong><dd><code>Add unit tests for invoice table</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-a95d419747ed8c8f054d4633d524261b34d709e091af3b0ee656f1bb0c01599c">+655/-0</a> </td> </tr> <tr> <td><strong>OtelConfig.spec.ts</strong><dd><code>Add tests for recommended OtelConfig</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-f6c9086bfb3685c0483782e995b01687f40fc0d68d752fe70222512c735c79be">+529/-0</a> </td> </tr> <tr> <td><strong>SummaryList.spec.ts</strong><dd><code>Add tests for queries summary list</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-b29217e2817d222ee871ba8a205c2e89a832e59a02f0964a85a118c321f41772">+392/-0</a> </td> </tr> <tr> <td><strong>invoiceHistory.spec.ts</strong><dd><code>Add tests for invoice history component</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-0a63edfe6e4c010c3f80c7afe0f22a394e666591702c376d89e4cc3d0f1f499b">+381/-0</a> </td> </tr> <tr> <td><strong>QueryList.spec.ts</strong><dd><code>Add tests for QueryList component</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-e08f882439ac0d15ee00d96205df02345821408ab81bade0267f780b66b956e2">+345/-0</a> </td> </tr> <tr> <td><strong>enterprisePlan.spec.ts</strong><dd><code>Add tests for enterprise plan component</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-afe194ebfc98f24482cc388a5e8482174dd48e74c302d24c00b2c9b309b0a2d1">+271/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Enhancement</strong></td><td><details><summary>4 files</summary><table> <tr> <td><strong>ImportPipeline.vue</strong><dd><code>Expose internal methods via setup return</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-d57fa41169daa44551a181f21ca33882004b29ab74e3040e4c56a8c849078670">+16/-0</a> </td> </tr> <tr> <td><strong>QueryList.vue</strong><dd><code>Support additional metaData prop</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-3daa87342834ae1e5bc6d74cb6dbd640b5b5fbb8df15c3cfe43b74c84f872d5d">+1/-0</a> </td> </tr> <tr> <td><strong>RunningQueries.vue</strong><dd><code>Update logic to align with new tests</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-6f0e18626a986d934c08c368ac383179c56bfcd914a27619ba748f43629c926b">+14/-0</a> </td> </tr> <tr> <td><strong>OtelConfig.vue</strong><dd><code>Minor updates to support tested behavior</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8133/files#diff-f5f5b0e070bcd827d74339487f2dd8353be1e9095fc4edf6c8c59b6b4dd56ea2">+8/-0</a> </td> </tr> </table></details></td></tr></tr></tbody></table> </details> ___
web
This template should help get you started developing with Vue 3 in Vite.
Recommended IDE Setup
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Type Support for .vue Imports in TS
TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensionsfrom VSCode's command palette - Find
TypeScript and JavaScript Language Features, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Windowfrom the command palette.
Customize configuration
See Vite Configuration Reference.
Project Setup
npm install
Compile and Hot-Reload for Development
For stand-alone UI development environment, create .env file and which contains below environment variable
VITE_OPENOBSERVE_ENDPOINT=http://localhost:5080/
npm run dev
Type-Check, Compile and Minify for Production
npm run build
Run Unit Tests with Vitest
npm run test:unit
Run End-to-End Tests with Cypress
npm run test:e2e:dev
This runs the end-to-end tests against the Vite development server. It is much faster than the production build.
But it's still recommended to test the production build with test:e2e before deploying (e.g. in CI environments):
npm run build
npm run test:e2e
Lint with ESLint
npm run lint