Skip to content

Conversation

@kirill-stepanishin
Copy link
Contributor

Integrates Java driver examples into CI to ensure they remain functional and catch breaking changes in the driver. Examples now execute automatically during integration tests and fail the build if broken.

Changes Made

  • Moved examples from gremlin-driver/src/main/java/examples to gremlin-server/src/test/java/examples to add example execution into existing integration test infrastucture
  • Added DriverExamplesIntegrateTest to run examples against test server
  • Removed compiler exclusion for examples in gremlin-driver/pom.xml

Root-level Java driver examples remain available in gremlin-examples/gremlin-java

@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.51%. Comparing base (9b46b67) to head (d2d568a).
⚠️ Report is 410 commits behind head on 3.7-dev.

Additional details and impacted files
@@              Coverage Diff              @@
##             3.7-dev    #3297      +/-   ##
=============================================
- Coverage      76.14%   75.51%   -0.64%     
+ Complexity     13152    13143       -9     
=============================================
  Files           1084     1092       +8     
  Lines          65160    67101    +1941     
  Branches        7285     7389     +104     
=============================================
+ Hits           49616    50671    +1055     
- Misses         12839    13808     +969     
+ Partials        2705     2622      -83     

☔ View full report in Codecov by Sentry.
📢 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.

- Move examples from gremlin-driver to gremlin-server test sources
- Add DriverExamplesIntegrateTest to run examples against test server
- Change examples to use System.getProperty for test compatibility
- Update ModernTraversals to use gmodern traversal source
- Remove compiler exclusion for examples in gremlin-driver pom
@kirill-stepanishin kirill-stepanishin force-pushed the java-examples-CI-integration branch from 917f1db to 81d6dc0 Compare January 23, 2026 19:02
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a bit odd to me that this file runs the main function of other classes. I know those classes are there to mimic the ones from gremlin-examples, but seeing as how this is going to be tied to integration test, you might as well just make each of those classes a test in this file instead? Just a thought, doesn't really need to be changed if you feel that it makes more sense this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that making the examples complete tests makes more sense in this isolated context. It's done more to mimic the rest of the GLVs, where currently the examples are also simply executed as part of the integration tests. Perhaps adding output validation and converting examples into proper tests could be a future piece of work.
As of now, I think it makes sense to keep the current approach to stay consistent with the other GLVs, and the main goal of catching the breaking changes that affect examples is still achieved.

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.

3 participants