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


##########
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");

Review Comment:
   ⚠️ 
Suggestion: 
clarify and 
simplify 
assumeStandaloneMode()
   
   The current 
condition 
`Assume.assumeTrue(backend != null && 
!backend.equals("hstore"))` 
is a 
double-negative 
and can 
be hard 
to 
read. 
Consider expressing 
the skip 
condition 
explicitly with 
`assumeFalse` 
and avoiding[39
 m NPEs. 
For example:
   
   public static 
void 
assumeStandaloneMode()
 {
       String 
backend = 
System.getProperty("backend");
       boolean 
isPdMode = 
backend == 
null || 
"hstore".equals(backend);
       
Assume.assumeFalse("skip
 standalone tests: backend='" 
+ backend 
+ "' (hstore/PD 
mode)", 
isPdMode);
   }
   
   This makes 
the intent 
clearer and 
avoids null 
checks in 
the boolean 
expression.



-- 
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