greptimedb
greptimedb copied to clipboard
refactor: add tests-integration module
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
While cleanup residual code review suggestions in #474 , I just realized this http_test
is no longer suitable to sit in datanode
module:
- it uses an integration test methodology that calls http api directly, which is not a unit test
- the functionality is no longer full contained in
datanode
, it covers logic fromservers
,datanode
tofrontend
- it prevents us from further decoupling
datanode
andfrontend
in terms of dependency
This PR creates a dedicated tests-integration module to hold tests like http_test
. It will depend on datanode
, frontend
and meta
in future. if this idea sounds good to you, I'm going to move forward:
- [x] ~~move
test_util
fromdatanode
intotests-integration
~~ still in use for datanode's tests - [x] move
grpc_test
, which is similar to currenthttp_test
, intotests-integration
. And note thatdatanode
still needs its owngrpc_test
as unit test to test our internaldatanode
-frontend
communication. - [ ] please add in comment if there are more tests to be moved into
tests-integration
- [x] ~~tests for mysql handler in
datanode
is to be removed as in #556~~ - [x] resolve residual test issues in #474
Checklist
- [x] I have written the necessary rustdoc comments.
- [x] I have added the necessary unit tests and integration tests.
Refer to a related PR or issue link (optional)
N/A
Codecov Report
Merging #590 (07b3178) into develop (30940e6) will decrease coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## develop #590 +/- ##
===========================================
- Coverage 86.35% 86.35% -0.01%
===========================================
Files 404 406 +2
Lines 51238 51307 +69
===========================================
+ Hits 44249 44305 +56
- Misses 6989 7002 +13
Flag | Coverage Δ | |
---|---|---|
rust | 86.35% <100.00%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
src/datanode/src/lib.rs | 100.00% <ø> (ø) |
|
src/servers/src/http.rs | 77.91% <100.00%> (-4.18%) |
:arrow_down: |
tests-integration/src/lib.rs | 100.00% <100.00%> (ø) |
|
tests-integration/src/test_util.rs | 100.00% <100.00%> (ø) |
|
src/storage/src/engine.rs | 82.38% <0.00%> (+0.47%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
I just found that tests inside src/datanode/src/tests/instance_test.rs
should also be moved to test-integration module.
@v0y4g3r I checked that module and it seems for testing datanode only? Correct me if I'm wrong.
@v0y4g3r I checked that module and it seems for testing datanode only? Correct me if I'm wrong.
That's right.