You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by "kirill-stepanishin (via GitHub)" <gi...@apache.org> on 2026/01/23 00:09:37 UTC

[PR] Integrate Java driver examples into automated build process [tinkerpop]

kirill-stepanishin opened a new pull request, #3297:
URL: https://github.com/apache/tinkerpop/pull/3297

   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`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Integrate Java driver examples into automated build process [tinkerpop]

Posted by "kenhuuu (via GitHub)" <gi...@apache.org>.
kenhuuu commented on code in PR #3297:
URL: https://github.com/apache/tinkerpop/pull/3297#discussion_r2729407315


##########
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/DriverExamplesIntegrateTest.java:
##########


Review Comment:
   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.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Integrate Java driver examples into automated build process [tinkerpop]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3297:
URL: https://github.com/apache/tinkerpop/pull/3297#issuecomment-3787537699

   ## [Codecov](https://app.codecov.io/gh/apache/tinkerpop/pull/3297?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 76.83%. Comparing base ([`9b46b67`](https://app.codecov.io/gh/apache/tinkerpop/commit/9b46b6777d2fa250e41daacf2fa4554605aff53a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`917f1db`](https://app.codecov.io/gh/apache/tinkerpop/commit/917f1dbf6e6be66a2664168a1e34931c8e42769b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 408 commits behind head on 3.7-dev.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             3.7-dev    #3297      +/-   ##
   =============================================
   + Coverage      76.14%   76.83%   +0.69%     
   =============================================
     Files           1084       28    -1056     
     Lines          65160     5302   -59858     
     Branches        7285        0    -7285     
   =============================================
   - Hits           49616     4074   -45542     
   + Misses         12839     1026   -11813     
   + Partials        2705      202    -2503     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/tinkerpop/pull/3297?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Integrate Java driver examples into automated build process [tinkerpop]

Posted by "kirill-stepanishin (via GitHub)" <gi...@apache.org>.
kirill-stepanishin commented on code in PR #3297:
URL: https://github.com/apache/tinkerpop/pull/3297#discussion_r2733265233


##########
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/DriverExamplesIntegrateTest.java:
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.driver;
+
+import examples.BasicGremlin;
+import examples.Connections;
+import examples.ModernTraversals;
+import org.apache.tinkerpop.gremlin.server.AbstractGremlinServerIntegrationTest;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ * Integration tests for driver examples to ensure they work with the current driver.
+ * These tests catch breaking changes that would affect example code.
+ */
+public class DriverExamplesIntegrateTest extends AbstractGremlinServerIntegrationTest {
+
+    @BeforeClass
+    public static void setUpEnvironment() {
+        // Set environment variables for examples to connect to test server
+        System.setProperty("GREMLIN_SERVER_HOST", "localhost");
+        System.setProperty("GREMLIN_SERVER_PORT", "45940");
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() {

Review Comment:
   Renamed to tearDownEnvironment to match the setup method. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Integrate Java driver examples into automated build process [tinkerpop]

Posted by "kenhuuu (via GitHub)" <gi...@apache.org>.
kenhuuu commented on PR #3297:
URL: https://github.com/apache/tinkerpop/pull/3297#issuecomment-3836865825

   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Integrate Java driver examples into automated build process [tinkerpop]

Posted by "Cole-Greer (via GitHub)" <gi...@apache.org>.
Cole-Greer merged PR #3297:
URL: https://github.com/apache/tinkerpop/pull/3297


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Integrate Java driver examples into automated build process [tinkerpop]

Posted by "kenhuuu (via GitHub)" <gi...@apache.org>.
kenhuuu commented on code in PR #3297:
URL: https://github.com/apache/tinkerpop/pull/3297#discussion_r2729400002


##########
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/DriverExamplesIntegrateTest.java:
##########
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.driver;
+
+import examples.BasicGremlin;
+import examples.Connections;
+import examples.ModernTraversals;
+import org.apache.tinkerpop.gremlin.server.AbstractGremlinServerIntegrationTest;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+/**
+ * Integration tests for driver examples to ensure they work with the current driver.
+ * These tests catch breaking changes that would affect example code.
+ */
+public class DriverExamplesIntegrateTest extends AbstractGremlinServerIntegrationTest {
+
+    @BeforeClass
+    public static void setUpEnvironment() {
+        // Set environment variables for examples to connect to test server
+        System.setProperty("GREMLIN_SERVER_HOST", "localhost");
+        System.setProperty("GREMLIN_SERVER_PORT", "45940");
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() {

Review Comment:
   Nit: This static method's name doesn't match the setup method's name.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Integrate Java driver examples into automated build process [tinkerpop]

Posted by "kirill-stepanishin (via GitHub)" <gi...@apache.org>.
kirill-stepanishin commented on code in PR #3297:
URL: https://github.com/apache/tinkerpop/pull/3297#discussion_r2733294816


##########
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/DriverExamplesIntegrateTest.java:
##########


Review Comment:
   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.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Integrate Java driver examples into automated build process [tinkerpop]

Posted by "Cole-Greer (via GitHub)" <gi...@apache.org>.
Cole-Greer commented on PR #3297:
URL: https://github.com/apache/tinkerpop/pull/3297#issuecomment-3814658370

   VOTE +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org