imbajin commented on code in PR #2966:
URL: https://github.com/apache/hugegraph/pull/2966#discussion_r2936778089


##########
hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/api/BaseApiTest.java:
##########
@@ -748,6 +739,28 @@ public static RestClient analystClient(String graphSpace, 
String username) {
         return analystClient;
     }
 
+    /**
+     * Skips the current test if the server is running in hstore / PD mode.
+     * Treats both {@code "hstore"} and {@code null} (i.e. the property is not
+     * set, which is the default in hstore CI runs) as PD mode.
+     * Call this from a {@code @Before} method in standalone-only test classes.
+     */
+    public static void assumeStandaloneMode() {
+        String backend = System.getProperty("backend");
+        Assume.assumeTrue(
+                "skip standalone tests: backend is '" + backend + "' 
(hstore/PD mode)",
+                backend != null && !backend.equals("hstore"));

Review Comment:
   ⚠️ `assumeStandaloneMode()` uses a double-negative condition (`backend != 
null && !backend.equals("hstore")`), which reduces readability. Prefer an 
explicit boolean variable and `Assume.assumeFalse(...)` for clarity and 
null-safety:
   
   ```java
   boolean isPdMode = "hstore".equals(backend);
   Assume.assumeFalse("Skip in PD/distributed mode", isPdMode);
   ```
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to