Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add tests for KvBackend trait implement #3700

Merged
merged 6 commits into from
Apr 15, 2024

Conversation

poltao
Copy link
Contributor

@poltao poltao commented Apr 12, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

close #2618

What's changed and what's your intention?

For now, KvBackend trait has some implements, such as ChrootKvBackend, MemoryKvBackend, etc. But only RaftEngineBackend, MemoryKvBackend and EtcdStore will directly access the data. PR #2615 has been added some tests for RaftEngineBackend and MemoryKvBackend, this PR for EtcdStore to ensure all implements have the same behaviors.

Other KvBackend trait implements based RaftEngineBackend, MemoryKvBackend and EtcdStore implement,I think it's unnecessary.

Tests mainly for range、put、batch_put、batch_get、compare_and_put、delete_range、batch_delete.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

@poltao poltao requested review from v0y4g3r, MichaelScofield and a team as code owners April 12, 2024 12:18
@github-actions github-actions bot added Invalid PR Title docs-not-required This change does not impact docs. labels Apr 12, 2024
@poltao poltao changed the title Add tests for KvBackend trait implement test: Add tests for KvBackend trait implement Apr 12, 2024
Copy link

codecov bot commented Apr 12, 2024

Codecov Report

Attention: Patch coverage is 99.03846% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 85.23%. Comparing base (db329f6) to head (9644cb3).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3700      +/-   ##
==========================================
- Coverage   85.57%   85.23%   -0.34%     
==========================================
  Files         962      963       +1     
  Lines      160274   160605     +331     
==========================================
- Hits       137155   136898     -257     
- Misses      23119    23707     +588     

@killme2008
Copy link
Contributor

@realtaobo Thank you. There are some TOML format issues and cargo clippy warnings, could you fix them?

src/catalog/Cargo.toml Outdated Show resolved Hide resolved
@killme2008 killme2008 requested a review from WenyXu April 12, 2024 14:52
Copy link
Collaborator

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@realtaobo Please update the PR description for what behavior tests your added.

Reverse engineering and guess from the code is unfriendly for reviewers.

@poltao
Copy link
Contributor Author

poltao commented Apr 14, 2024

Reverse engineering and guess from the code is unfriendly for reviewers.

Got it. Finished.

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
Copy link
Collaborator

cc @MichaelScofield PTAL.

@tisonkun tisonkun enabled auto-merge April 15, 2024 09:30
@tisonkun tisonkun added this pull request to the merge queue Apr 15, 2024
Merged via the queue into GreptimeTeam:main with commit d5a948a Apr 15, 2024
20 checks passed
@poltao poltao deleted the addTests branch April 15, 2024 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests for KvBackend trait implements
4 participants