mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
### **PR Type**
Tests, Bug fix
___
### **Description**
Fix streaming tests' total aggregation logic
Track latest total instead of summing
Update debug logs to reflect final total
Adjust combined metadata to use final total
___
### Diagram Walkthrough
```mermaid
flowchart LR
Parse["Parse streaming metadata"] -- "extract results.total" --> Track["Track latest total"]
Track -- "set final_total" --> Combine["Combine first metadata with final_total"]
Hits["Collect hits events"] -- "aggregate all hits" --> Combine
```
<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_streaming.py</strong><dd><code>Use latest total
for streaming metadata</code>
</dd></summary>
<hr>
tests/api-testing/tests/test_streaming.py
<ul><li>Replace summed <code>total_sum</code> with
<code>final_total</code><br> <li> Update debug prints to reference final
total<br> <li> Set combined metadata <code>results.total</code> to
latest total<br> <li> Clarify comments for streaming semantics</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8037/files#diff-f15e9b733130f72112380fda658264545435fbf956b08869b0ad5a9435d222f7">+8/-8</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.