Skip to content

test(client): run SameNeighborsBatchApiTest in the API suite - #851

Merged
imbajin merged 2 commits into
apache:masterfrom
arshilkxwork:test/same-neighbors-batch-suite
Oct 27, 2026
Merged

imbajin merged 2 commits into
apache:masterfrom
arshilkxwork:test/same-neighbors-batch-suite

Conversation

@arshilkxwork

Copy link
Copy Markdown
Contributor

Purpose of the PR

SameNeighborsBatchApiTest exists but is not listed in ApiTestSuite, so CI never runs it. #673 tried to add it and was blocked because the Server that CI used then had no /traversers/sameneighborsbatch endpoint. apache/hugegraph#2825 has since added the endpoint. The candidate Server that client CI starts from the locked candidate SDK (apache/hugegraph 86c05ef9) includes it. The release-1.7 baseline (b12425c) does not, and answers 404.

This picks up the change from #673 by @sadwitdastreetz and handles the version gap.

Main Changes

  • ApiTestSuite lists SameNeighborsBatchApiTest after SameNeighborsApiTest.
  • At the end of the class's @BeforeClass, once the test vertices exist, it posts one batch request. A 404 skips the whole class through Assume, so the release-1.7 job reports it as skipped instead of failing. Any other error is rethrown. BaseApiTest's @AfterClass still clears the data when the class is skipped.
  • The test methods are unchanged.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
    • Built Server from apache/hugegraph master at 969bb1420, started it with hugegraph-client/assembly/travis/start-hugegraph-servers.sh as client CI does, and ran mvn test -Dtest=SameNeighborsBatchApiTest: 5 tests, 0 failures.
    • Against the same Server, with the client's batch path temporarily pointed at a missing endpoint so the Server answered 404: the class was reported as skipped, with no failures. The client change was reverted afterwards.
    • Not verified locally: the full 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 and release-1.7 jobs run the full suite.
    • Not run against a real 1.7.0 Server; the release-1.7 CI job covers the skip path.

Does this PR potentially affect the following parts?

  • Nope
  • Dependencies (add/update license info)
  • Modify configurations
  • The public API
  • Other affects (typed here)

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

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

codecov Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.21%. Comparing base (411aca3) to head (804f031).
⚠️ Report is 25 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

imbajin
imbajin previously approved these changes Oct 26, 2026

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 bitflicker64 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 bitflicker64 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 imbajin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@imbajin
imbajin merged commit 823c890 into apache:master Oct 27, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] SameNeighborsBatchApiTest dosenot exist in test suite

3 participants