mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 00:08:55 +00:00
### **PR Type**
Tests
___
### **Description**
- Add pytest for dynamic namespace routing
- Create and enable pipelines via API
- Ingest logs post-creation and verify routing
- Optional cleanup to delete created pipelines
___
### Diagram Walkthrough
```mermaid
flowchart LR
A["Parametrized test inputs"] -- "build payload" --> B["Create pipeline via API"]
B -- "enable pipeline" --> C["Ingest logs to source"]
C -- "wait and verify" --> D["Search destination stream count"]
C -- "verify source matches" --> E["Search source for condition"]
D -- "report counts" --> F["Keep pipeline for monitoring"]
G["Cleanup test"] -- "find by name" --> H["Delete pipeline via API"]
```
<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><table>
<tr>
<td>
<details>
<summary><strong>test_pipeline_dynamic.py</strong><dd><code>Add tests
for pipeline dynamic namespace routing</code>
</dd></summary>
<hr>
tests/api-testing/tests/test_pipeline_dynamic.py
<ul><li>Add parametrized test creating dynamic routing pipelines<br>
<li> Enable pipeline, ingest logs, verify counts via SQL search<br> <li>
Include optional cleanup test to delete created pipelines<br> <li> Use
unique node IDs and names; wait for processing</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8874/files#diff-0bbefbbf7a34e3414a0aadd1963ffe6a2af8b5df4d619076207e361b2a42bcb1">+243/-0</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___
---------
Co-authored-by: Subhradeep Chakraborty <chakrabortysubhradeep556@gmail.com>
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
pytest-openobserve
This is a repo to test openobserve API endpoints.
Introduction:
The tests are running using pytest against alpha1 for now.
Idea is to parametrize it for the other endpoints like production as well.
Getting Started
- We use
ryeto manage the python version and environment - https://github.com/mitsuhiko/rye - Once installed, simply run the following steps:
rye syncrye run pytest
TODOS:
- Parametrize tests to run against different environments
- Run the tests as cron-job every few hours or daily etc. for different environments
- Send slack-notification ( use github-actions ) in case something fails on
alpha1orproductionendpoints.