mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 08:09:27 +00:00
### **PR Type**
Tests
___
### **Description**
- Add end-to-end SQL query validation tests
- Verify WHERE, match_all, ORDER BY semantics
- Enforce LIMIT and result consistency checks
- Validate CTE filtering and fields presence
___
### Diagram Walkthrough
```mermaid
flowchart LR
A["New E2E tests"] -- "WHERE filter" --> B["Validate field equality"]
A -- "match_all" --> C["Check term presence"]
A -- "ORDER BY" --> D["Assert timestamp DESC"]
A -- "LIMIT" --> E["Enforce max hits"]
A -- "CTE" --> F["Validate filtered fields"]
```
<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_search.py</strong><dd><code>Add comprehensive E2E
SQL query tests</code>
</dd></summary>
<hr>
tests/api-testing/tests/test_search.py
<ul><li>Add test for WHERE condition equality<br> <li> Add test for
match_all term presence<br> <li> Add test for ORDER BY timestamp
DESC<br> <li> Add tests for LIMIT and CTE behavior</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8241/files#diff-f3776a5bc02e67c163ed707f86b2192f47b73c641dde04b83523b95a74518141">+252/-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.