mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
### **PR Type**
Tests
___
### **Description**
- Add end-to-end dashboard API tests
- Cover CRUD flows and edge cases
- Validate SSE search stream responses
- Include auth, pagination, and folders
___
### Diagram Walkthrough
```mermaid
flowchart LR
list["List dashboards"] -- "200 with/without auth" --> validateList["Validate structure"]
create["Create dashboard"] -- "returns v1.dashboardId" --> read["Get by ID"]
read -- "assert fields" --> delete["Delete dashboard"]
updateNE["Update nonexistent"] -- "expect 400/404" --> done1["Handled"]
missingReq["Missing required fields"] -- "expect 400/422" --> done2["Handled"]
dupTitle["Duplicate title create"] -- "allowed" --> cleanup["Cleanup created dashboards"]
pagination["List with limit"] -- "verify dashboards key" --> cleanup2["Cleanup"]
sse["Search stream (SSE)"] -- "parse events/data" --> validateSSE["Validate results/hits"]
```
<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_dashboards.py</strong><dd><code>End-to-end pytest
for dashboard APIs</code>
</dd></summary>
<hr>
tests/api-testing/tests/test_dashboards.py
<ul><li>Add pytest suite for dashboard APIs<br> <li> Test list, create,
get, delete flows<br> <li> Validate SSE search stream parsing<br> <li>
Cover pagination, auth, errors, duplicate titles</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8698/files#diff-936c6e8532b2f4ad8ebd0d5d2bd43638e278ce0880498ccf0c446f9e01a20901">+404/-0</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___
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.