Repository navigation
test(client): run SameNeighborsBatchApiTest in the API suite - #851
Conversation
SameNeighborsBatchApiTest was never part of ApiTestSuite, because the Server had no /traversers/sameneighborsbatch endpoint. apache/hugegraph #2825 added it, and the candidate Server that client CI starts includes it, while 1.7.0 still answers 404. Register the class in the suite. After its setup it posts one batch request; a 404 skips the class through a JUnit assumption, and any other error still fails it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #851 +/- ##
============================================
+ Coverage 51.79% 55.21% +3.41%
- Complexity 5309 5960 +651
============================================
Files 619 619
Lines 31606 32582 +976
Branches 3945 4217 +272
============================================
+ Hits 16370 17989 +1619
+ Misses 13750 13021 -729
- Partials 1486 1572 +86 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
imbajin
left a comment
There was a problem hiding this comment.
Blocking: no. Summary: The API suite now includes the batch same-neighbor tests, and the capability probe skips only an unavailable endpoint while preserving other failures and class cleanup. Evidence: Independent source review of the suite, client exception path and JUnit lifecycle; current-head client CI reports 387 API tests with 0 failures and 3 skips. Score: 8.6/10.
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: no. Summary: The suite entry and the 404 probe work: candidate CI runs the five batch tests, and a 1.7 Server's unmatched path maps to a 404 ServerException; testSameNeighborsWithLimit, which this line brings into CI, never sends its limit.
| CountApiTest.class, | ||
| RingsRaysApiTest.class, | ||
| SameNeighborsApiTest.class, | ||
| SameNeighborsBatchApiTest.class, |
There was a problem hiding this comment.
Minor: this line brings SameNeighborsBatchApiTest.testSameNeighborsWithLimit into CI, but its second and third blocks discard builder.build() and post the first request again, so limit(2L) and limit(1L) never reach the Server and the limit(1L) block asserts two neighbors per pair. Post the rebuilt requests and assert the limited sizes.
There was a problem hiding this comment.
Fixed in 804f031. The limit(2) and limit(1) blocks now set their options and then post builder.build(), instead of reposting the first request. With limit(1) the first two pairs return one neighbor each, so the check asserts sizes 1, 1 and 0, and that the kept neighbor is one of the two the pair shares ({3, 4} and {1, 2}), since the API does not specify which one is kept. limit(2) still returns both shared neighbors.
Checked against a Server built from apache/hugegraph master at e497efd99, started with start-hugegraph-servers.sh: SameNeighborsBatchApiTest passes, 5 tests, 0 failures.
testSameNeighborsWithLimit built its limit(2) and limit(1) requests but posted the first request again, so the limits never reached the Server and the limit(1) block asserted two neighbors per pair. Post the rebuilt requests, and expect one neighbor per pair for limit(1), from the two the pair shares.
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: no. Score: 9/10. Summary: Candidate CI runs the five SameNeighborsBatchApiTest tests at this head (387 API tests, up from 382, same 3 skips), and a release-1.7 Server's unmatched sameneighborsbatch path returns a 404 ServerException, so the probe skips only there. testSameNeighborsWithLimit now sends its limit, matching the Server's per-pair limit.
imbajin
left a comment
There was a problem hiding this comment.
Blocking: no. Summary: The suite includes the batch same-neighbor tests, the capability probe preserves non-404 failures and class cleanup, and the limit cases now submit the intended requests with order-independent assertions. Evidence: Independent source checks of request construction, exception status handling and class cleanup; current-head client CI reports 387 API tests with 0 failures, 0 errors and 3 skips. Score: 8.7/10.
Purpose of the PR
SameNeighborsBatchApiTestexists but is not listed inApiTestSuite, so CI never runs it. #673 tried to add it and was blocked because the Server that CI used then had no/traversers/sameneighborsbatchendpoint. apache/hugegraph#2825 has since added the endpoint. The candidate Server that client CI starts from the locked candidate SDK (apache/hugegraph86c05ef9) includes it. Therelease-1.7baseline (b12425c) does not, and answers 404.This picks up the change from #673 by @sadwitdastreetz and handles the version gap.
Main Changes
ApiTestSuitelistsSameNeighborsBatchApiTestafterSameNeighborsApiTest.@BeforeClass, once the test vertices exist, it posts one batch request. A 404 skips the whole class throughAssume, so therelease-1.7job reports it as skipped instead of failing. Any other error is rethrown.BaseApiTest's@AfterClassstill clears the data when the class is skipped.Verifying these changes
969bb1420, started it withhugegraph-client/assembly/travis/start-hugegraph-servers.shas client CI does, and ranmvn test -Dtest=SameNeighborsBatchApiTest: 5 tests, 0 failures.ApiTestSuite. On this machine the Server started with a 512 MB heap and began answering 503 ("available memory ... below than threshold 64(MB)") across many classes, before and independent of this test, so those runs say nothing about this change. CI's candidate andrelease-1.7jobs run the full suite.release-1.7CI job covers the skip path.Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need