Files
openobserve/tests/api-testing
Neha P ed11cd1af3 test: add pytest for queries and assert hits (#8241)
### **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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </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>&nbsp;
</td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___
2025-09-01 22:30:56 +05:30
..
2025-07-31 14:31:33 +08:00
2025-07-31 14:31:33 +08:00

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 rye to manage the python version and environment - https://github.com/mitsuhiko/rye
  • Once installed, simply run the following steps:
    • rye sync
    • rye 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 alpha1 or production endpoints.