Files
openobserve/src/report_server
Ashish Kolhe 1ddf812acd chore: add unit tests (#8061)
### **PR Type**
Tests


___

### **Description**
- Add comprehensive unit tests for quantile

- Expand tests for trend and regression

- Add exhaustive resets function tests

- Add string_to_array_v2 implementation tests


___

### Diagram Walkthrough


```mermaid
flowchart LR
  promql_common_tests["Add tests: quantile, trend, regression, kahan"] -- "strengthen coverage" --> promql_common_module["promql/common.rs"]
  resets_tests["Add extensive resets tests"] -- "validate edge cases" --> resets_module["promql/functions/resets.rs"]
  udf_tests["Add string_to_array_v2 tests"] -- "validate parsing, args" --> udf_module["search/datafusion/udf/string_to_array_v2_udf.rs"]
```



<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>common.rs</strong><dd><code>Comprehensive statistical
utilities test suite</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/service/promql/common.rs

<ul><li>Add comprehensive tests for quantile function.<br> <li> Add
tests for calculate_trend logic and edge cases.<br> <li> Add
linear_regression tests including negatives/infinities.<br> <li> Add
kahan_sum_increment precision and usage tests.</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8061/files#diff-0661c489ae1b0457aa7b182590eed83315a682f4836fff734cfcb8c1afae86bc">+160/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>resets.rs</strong><dd><code>Extensive resets exec
behavior tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/service/promql/functions/resets.rs

<ul><li>Add unit tests covering no, single, multiple resets.<br> <li>
Test edge cases: empty, single, negatives, NaN/Infinity.<br> <li> Add
helper to build RangeValue for tests.<br> <li> Validate counter overflow
scenarios.</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8061/files#diff-96d475ef838ab215c6b259c32d7591ed5e64fb142d79d3f8647adbd57072a3eb">+143/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>string_to_array_v2_udf.rs</strong><dd><code>Broad tests
for string_to_array_v2 implementation</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

src/service/search/datafusion/udf/string_to_array_v2_udf.rs

<ul><li>Add tests for basic splitting and batch processing.<br> <li>
Cover edge cases: empty/null delimiter, unicode.<br> <li> Validate
multiple delimiters and empty parts handling.<br> <li> Test wrong arg
count error messaging.</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8061/files#diff-1fa623e7d0c4c8485c1a16de78ad4f28e44818b66cf32553525ea189d717ba0d">+182/-0</a>&nbsp;
</td>

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

</details>

___
2025-08-20 15:03:33 +05:30
..
2025-08-20 15:03:33 +05:30
2024-09-22 17:57:47 +08:00