Commit Graph
44 Commits
Author SHA1 Message Date
ByteBaker 8ed584521f chore: increase minimum coverage threshold for API 2025-10-08 15:24:45 +05:30
Hengfei Yang 75597802d8 ci: rollback coverage by mistake (#8344) 2025-09-10 10:41:24 +08:00
sktrpathi a8a723ae15 chore: increase minimum coverage threshold for API (#8270)
### **PR Type**
Enhancement, Tests


___

### **Description**
- Raise default coverage thresholds

- Functions: 64%, Lines: 64%, Regions: 63%

- Update coverage gate in shell script
2025-09-03 17:16:42 +05:30
sktrpathi 05d0c67704 chore: add UTs, run fmt and clippy (#8153)
### **User description**
- also increase minimum coverage threshold


___

### **PR Type**
Tests, Enhancement


___

### **Description**
- Add extensive unit tests for metrics

- Add comprehensive tests for logs bulk API

- Add tests for traces response and helpers

- Increase minimum coverage thresholds
2025-08-26 18:51:25 +05:30
sktrpathi bc24d16918 chore: increase minimum coverage threshold for API (#7762)
### **PR Type**
Tests


___

### **Description**
- Bump default COVERAGE_FUNCTIONS threshold to 57

- Bump default COVERAGE_LINES threshold to 54

- Bump default COVERAGE_REGIONS threshold to 52
2025-07-31 10:36:51 +05:30
sktrpathi b0e81f8973 chore: increase required coverage limit (#7747) 2025-07-29 17:56:45 +08:00
sktrpathi 3638378d29 chore: Increase required line coverage to 52% (#7699)
### **PR Type**
Enhancement


___

### **Description**
- Increase required function coverage to 55%

- Increase required line coverage to 52%

- Increase required region coverage to 50%


___



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>coverage.sh</strong><dd><code>Update coverage
percentage thresholds</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

coverage.sh

<ul><li>functions threshold: 52% → 55%<br> <li> lines threshold: 48% →
52%<br> <li> regions threshold: 47% → 50%</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7699/files#diff-2033e8e6b7ebfb5c3fe4039f2613d92e65315436b1fdcd3bbe27708370081383">+3/-3</a>&nbsp;
&nbsp; &nbsp; </td>

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

</details>

___
2025-07-24 18:55:11 +08:00
Hengfei Yang 4ac160dadf ci: add more unit tests for tantivy (#7467)
✅ Functions coverage: 52.63%
✅ Lines coverage: 48.61%
✅ Regions coverage: 47.92%
2025-07-04 23:39:57 +08:00
Hengfei Yang 3102168008 ci: unit test (#7461)
### **PR Type**
Tests, Enhancement


___

### **Description**
- Enable `ZO_RESULT_CACHE_ENABLED` by default

- Add helper functions and tests for `generate_tantivy_index`

- Add comprehensive Puffin module unit tests

- Update coverage script to install `cargo nextest`


___

### **Changes diagram**

```mermaid
flowchart LR
  Config["Change default ZO_RESULT_CACHE_ENABLED"]
  TantivyMod["Add generate_tantivy_index tests"]
  PuffinMod["Add Puffin module tests"]
  Coverage["Update coverage.sh script"]
  Config --> TantivyMod
  TantivyMod --> PuffinMod
  PuffinMod --> Coverage
```


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>config.rs</strong><dd><code>Default result cache
enabled</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&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/config/src/config.rs

- Changed default of `ZO_RESULT_CACHE_ENABLED` from false to true


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7461/files#diff-9aeee4a74c0520daa40f9b81c7016f5b6b3254375b968dd7598e745630980d62">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>coverage.sh</strong><dd><code>Update coverage
script</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

coverage.sh

- Added check/install for `cargo nextest` in coverage task


</details>


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

</tr>
</table></td></tr><tr><td><strong>Tests</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>mod.rs</strong><dd><code>Add generate_tantivy_index
tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &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/tantivy/mod.rs

<li>Added <code>create_test_batch</code> and
<code>create_test_stream</code> helpers<br> <li> Added multiple async
tests for <code>generate_tantivy_index</code> and
<br><code>create_tantivy_index</code>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7461/files#diff-68837d2f393b453002ec2d95f6882cfcaf70d9ef6547be2c9a890e8b0fc3c559">+471/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>mod.rs</strong><dd><code>Fix footer size and add puffin
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/tantivy/puffin/mod.rs

<li>Updated <code>FOOTER_SIZE</code> to include trailing magic<br> <li>
Added unit tests for constants and serialization


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7461/files#diff-2f7f0bac01afc6e37908521d1d33d05fcd650b7a08792062976e1e7465b4a1f9">+278/-1</a>&nbsp;
</td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>reader.rs</strong><dd><code>Add puffin reader
tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &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/tantivy/puffin/reader.rs

<li>Added tests for <code>PuffinBytesReader</code> and
<code>PuffinFooterBytesReader</code><br> <li> Covered parsing,
validation, and error scenarios


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7461/files#diff-93d025368ac2b94462df57eb597f345d59967f0dbfb7745a5a7c60b008b85c16">+383/-0</a>&nbsp;
</td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>writer.rs</strong><dd><code>Add puffin writer
tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &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/tantivy/puffin/writer.rs

<li>Added tests for <code>PuffinBytesWriter</code> and
<code>PuffinFooterWriter</code><br> <li> Verified blob writing, footer
structure, and JSON serialization


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7461/files#diff-af51d55696b4d2b7e5f4c0ccd8af73e0b464db0c83114c3882548bee6ada5e1d">+306/-0</a>&nbsp;
</td>

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

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-07-04 17:40:29 +05:30
Yashodhan JoshiandYashodhan Joshi 1785b2b256 test: use multiple dbs (#7084)
This PR adds support for running unit tests with all three - sqlite,
postgres and mysql. This way we cover their code as well.

---------

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
Co-authored-by: Yashodhan Joshi <yjdoc2@gmail.com>
2025-06-10 10:32:00 +05:30
Hengfei Yang 94a0241e3f ci: improve unit test coverage (#7068)
Now the coverage is:

✅ Functions coverage: 46.83%
✅ Lines coverage: 46.35%
✅ Regions coverage: 34.09%
2025-06-06 20:37:41 +08:00
udevandloaki07 3f7582e0db fix: increase test case coverage (#7054)
Co-authored-by: loaki07 <rustyloaki@gmail.com>
2025-06-06 13:19:24 +05:30
Ashish Kolhe 36c71ee30b chore: Update coverage.sh (#7006) 2025-06-03 09:31:37 +05:30
Taiming Liu 4dc5a27cec ci: add workspace unit tests to coverage tests (#5170) 2024-11-27 17:13:28 -08:00
Subhra264 51e32f4b35 chore: don't ignore cargo test failure in unit tests ci (#4951)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved error handling during coverage testing to ensure failures are
no longer ignored.

- **New Features**
- Streamlined command execution flow with a default command set to
`cmd_check` when no arguments are provided.

- **Documentation**
	- Enhanced user feedback for unrecognized commands.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-10-30 16:11:27 +05:30
Taiming Liu 7f75a4d6db feat: use FST for inverted indexing (#4270) 2024-09-02 22:39:44 +08:00
Hengfei Yang 8a0dbe2cf4 feat: remove sql_mode, query_context and aggs from search API (#4089) 2024-07-31 11:23:11 +08:00
Hengfei Yang e33ae00ea1 feat: merge dev into main (#3016) 2024-03-17 22:38:07 +08:00
Ashish Kolhe 67aeec6d5b fix: unit test issue (#2761) 2024-02-23 12:30:33 +05:30
Hengfei Yang 79682120f0 feat: search queue management (#2621) 2024-02-01 11:54:01 +08:00
Hengfei Yang 325aa4b3f2 fix: unit tests (#2542)
- [x] change sqlite backend to a Mutex
- [x] fix unit tests
2024-01-24 22:42:20 +08:00
Ankur Srivastava 9519e2a34c feat: run unit tests on github actions (#2394) 2024-01-16 15:23:18 +01:00
Hengfei Yang c6a46ac315 feat: upgrade datafusion to 31 (#1506) 2023-09-19 17:43:17 +08:00
Hengfei Yang 019c4ccc53 fix: swagger under sub directory (#1476) 2023-09-09 12:36:23 +08:00
Hengfei Yang 5a3173c689 feat: implement sqlite for metadata (#1449) 2023-09-04 11:00:28 +08:00
Hengfei Yang a506782fa5 fix: query fast mode with order by and distinct (#1396) 2023-08-18 16:21:57 +08:00
Hengfei Yang 2abbcc8af2 fix: unit test (#1160) 2023-07-12 17:19:01 +08:00
Hengfei Yang 4fb16a863f ci: add debug image for production version (#1036) 2023-06-26 18:23:59 +08:00
Hengfei Yang 23f4dd48c7 perf: improve query when no enough memory cache (#847) 2023-05-30 16:11:07 +08:00
Hengfei Yang ca2f55a57e feat: support skip tls verify when create alert destination (#819) 2023-05-26 17:58:38 +08:00
Valeriy V. Vorotyntsev 26448a9820 chore: don't let unmet coverage targets fail the CI
```
❌ Functions coverage is below threshold: 62.95% < 63.0%
✅ Lines coverage: 55.87%
✅ Regions coverage: 43.13%

[Container] 2023/05/09 09:07:40 Command did not exit successfully ./coverage.sh exit status 1
[Container] 2023/05/09 09:07:40 Phase complete: BUILD State: FAILED
[Container] 2023/05/09 09:07:40 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: ./coverage.sh. Reason: exit status 1
```

As I wrote on Slack:

> ❓ How useful is coverage.sh, particularly ‘Functions coverage’?
>
> I don't know how `cargo llvm-cov` calculates this ratio. Probably it divides the number of tested functions by the total number of functions.
>
> Splitting big functions into smaller pieces improves code readability. It also increases the total number of functions. If my assumption about `cargo llvm-cov` algorithm is correct, splitting code into smaller functions decreases the ‘Functions coverage’ ratio.
>
> If you look at [the patch] that fails the CI due to insufficient ‘Functions coverage’, you'll see that the new code there is accompanied with just-about-right amount of unit tests. I mean, apart from `MetricType`-to-string conversion, what else is there to be tested? How useful would those tests be?
>
> IMO, ‘Functions coverage’ target of `coverage.sh` adds more friction than benefit.
>
> I propose that we don't let `coverage.sh` fail the CI.

[the patch]: https://github.com/zinclabs/zincobserve/pull/695/files
2023-05-09 16:49:13 +03:00
Ashish Kolheandhengfeiyang 4ee2776719 feat: mlua with luau as sandbox (#597)
* feat: lua with sandbox

* add lua to query

* feat: enable feature zo_functions for CI

* update coverage

---------

Co-authored-by: hengfeiyang <hengfei.yang@gmail.com>
2023-04-19 16:15:15 +05:30
Valeriy V. Vorotyntsev 409e37fd53 test: reduce function coverage by 1% :-/ 2023-04-15 16:41:12 +03:00
Hengfei Yang 81375d3e82 feat: rewrite tmpfs (#544) 2023-04-12 12:41:13 +08:00
Valeriy V. Vorotyntsev 0722d456fa chore: revamp coverage.sh
- Generate coverage report in JSON format --- it used to be a raw text
  file (non-JSON) with `.json` extension.
- Parse JSON data with Python instead of counting and `cut`ting fields.
  The resulting code is more readable.
- Allow specifying of coverage thresholds via environment variables.
- Generate HTML report and open it in the default browser with
  `./coverage.sh html`.
- Implement CLI.
2023-04-07 21:26:05 +03:00
Ashish Kolhe 22fa7e51af feat: added support for vpc flow logs (#516)
* Added support for vpc flowlogs

* fixed UT

* updated cov.sh
2023-04-07 13:36:29 +05:30
d57c57c432 feat: Accept cloud watch logs through amazon kinesis firehose and VRL functions (#512)
* added vrl functions

* vrl functions

* incorporated comments

* Added kinesis changes

* fixes

* Apply suggestions from code review

Co-authored-by: Valeriy V. Vorotyntsev <valery.vv@gmail.com>

* Revert "Apply suggestions from code review"

This reverts commit b25690802d.

* Latest Changes

* access key changes

* clippy fixes

* fix: router support aws API

* fix: format code

* fix: test coverage

---------

Co-authored-by: Valeriy V. Vorotyntsev <valery.vv@gmail.com>
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2023-04-07 08:24:14 +05:30
e289762604 fix: typed dashboard structs (#466)
* WIP: introduce `DashboardXxx`; use it for `save_dashboard`

* service::db::dashboard::list: handle errors, don't unwrap

* [WIP] Update `service::db::dashboard::list`

* XXX The code compiles, but the Dashboards page shows nothing

* web: repair 'dashboards' page

Don't `JSON.parse` backend's response, it's JSON already.

* [WIP] Repair the "view dashboard" page

Saving panel(s) is still broken.

* meta::dashboards.rs: define `Panel` struct

* Fix `Panel` struct definition

* Use `crate::common::json` instead of `serde_json`

* remove json stringify for the dashboard

* Fixed dashboards

* WIP: introduce `DashboardXxx`; use it for `save_dashboard`

* service::db::dashboard::list: handle errors, don't unwrap

* [WIP] Update `service::db::dashboard::list`

* XXX The code compiles, but the Dashboards page shows nothing

* web: repair 'dashboards' page

Don't `JSON.parse` backend's response, it's JSON already.

* [WIP] Repair the "view dashboard" page

Saving panel(s) is still broken.

* meta::dashboards.rs: define `Panel` struct

* Fix `Panel` struct definition

* Use `crate::common::json` instead of `serde_json`

* remove json stringify for the dashboard

* Fixed dashboards

* Added all aggregate functions

* FIXED TESTS

* fixed integration tests

* Updated coverage threshold

---------

Co-authored-by: ktx-keshavi <keshavi.bhalani@kiara.tech>
Co-authored-by: oasisk <ashish.j.kolhe@gmail.com>
2023-03-31 17:03:34 +05:30
Hengfei Yang cab41742a2 fix: unit test (#272) 2023-03-13 15:51:20 +08:00
Hengfei Yang 7b2ad6a2db feat: support encode SQL (#223)
* feat: support encode SQL

* fix: add more unit tests

* perf: improve inline
2023-03-09 11:49:23 +08:00
Hengfei Yang 3cca9ad12b feat: stream delete (#193)
* feat: update datafusion to 19

* feat: add stream deleting

* feat: data delete

* feat: stream delete done for local mode

* feat: data delete work on s3

* feat: data delete works with gcs

* feat: improve data delete

* feat: improve data delete

* feat: data delete done with merge file list

* fix: comment some unused code

* test: change coverage

* docs: update readme
2023-03-06 18:44:42 +08:00
Ashish Kolhe fb49c29415 added limit on number of fields in record (#166) 2023-02-27 13:58:31 +05:30
Ashish KolheandHengfei Yang 4108197943 fix: added UT (#158)
Co-authored-by: Hengfei Yang <hengfei.yang@gmail.com>
2023-02-27 10:51:04 +08:00
oasisk 147362cb40 zinc-observe initial commit 2023-02-02 09:03:11 +05:30