bitflicker64 commented on PR #2944:
URL:
https://github.com/apache/incubator-hugegraph/pull/2944#issuecomment-3817131730
> > I noticed that my tests currently use a duplicated `UrlOptions` class
instead of the actual `ServerOptions`. Because of this, if config keys change
in `ServerOptions`, the tests will not fail, since they rely on hardcoded
duplicates.
> > ```java
> > // Test duplicate
> > public static class UrlOptions extends OptionHolder {
> > public static final ConfigOption<String> restUrl =
> > new ConfigOption<>("restserver.url",
...).withUrlNormalization("http://");
> > }
> >
> > // Production (ServerOptions.java)
> > public static final ConfigOption<String> GREMLIN_SERVER_URL =
> > new ConfigOption<>("gremlinserver.url",
...).withUrlNormalization("http://");
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Would you prefer that I: Refactor tests to use ServerOptions directly or
Keep the duplicated UrlOptions (more isolated, but requires manual syncing)?
Let me know your preference and I’ll refactor accordingly.
>
> @bitflicker64 Apologize for the delay, prefer PlanA (Refactor tests to
keep DRY rule)
Hi, I tried refactoring HugeConfigTest to use ServerOptions directly as
suggested. However, this test is in the hugegraph-common module, while
ServerOptions is in hugegraph-server. When I add the dependency, it creates a
circular dependency and the build fails with this error:
```
The projects in the reactor contain a cyclic reference:
org.apache.hugegraph:hugegraph-api
-> org.apache.hugegraph:hugegraph-core
-> org.apache.hugegraph:hugegraph-common
-> org.apache.hugegraph:hugegraph-api
```
Because of this, ServerOptions cannot be used in hugegraph-common tests
without breaking the module structure.
--
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]