This is an automated email from the ASF dual-hosted git repository.
feiwang pushed a commit to branch branch-0.6
in repository https://gitbox.apache.org/repos/asf/celeborn.git
The following commit(s) were added to refs/heads/branch-0.6 by this push:
new 04f6c2827 [CELEBORN-1056][FOLLOWUP] Support testing of dynamic
configuration management cli
04f6c2827 is described below
commit 04f6c2827bc8cc6daa6ae5eea2b50976241d50e3
Author: SteNicholas <[email protected]>
AuthorDate: Sun Jun 22 21:25:09 2025 -0700
[CELEBORN-1056][FOLLOWUP] Support testing of dynamic configuration
management cli
### What changes were proposed in this pull request?
Support testing of dynamic configuration management cli.
### Why are the changes needed?
The tests of dynamic configuration management cli are disabled since
dynamic conf is not enabled in unit tests, which should support testing dynamic
configuration management cli.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
`TestCelebornCliCommands`.
Closes #3340 from SteNicholas/CELEBORN-1056.
Authored-by: SteNicholas <[email protected]>
Signed-off-by: Wang, Fei <[email protected]>
(cherry picked from commit dac0f56e9477c774625fb88731c55efcb7189691)
Signed-off-by: Wang, Fei <[email protected]>
---
cli/pom.xml | 5 +++++
.../apache/celeborn/cli/TestCelebornCliCommands.scala | 16 ++++++++--------
service/pom.xml | 5 +++++
.../celeborn/server/common/service/utils/JsonUtils.java | 2 ++
4 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/cli/pom.xml b/cli/pom.xml
index b2bebee05..c02ba1800 100644
--- a/cli/pom.xml
+++ b/cli/pom.xml
@@ -77,6 +77,11 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git
a/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala
b/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala
index 6775818eb..aa8a60151 100644
--- a/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala
+++ b/cli/src/test/scala/org/apache/celeborn/cli/TestCelebornCliCommands.scala
@@ -45,6 +45,12 @@ class TestCelebornCliCommands extends CelebornFunSuite with
MiniClusterFeature {
classOf[UserDefinePasswordAuthenticationProviderImpl].getName)
.set(CelebornConf.MASTER_HTTP_AUTH_ADMINISTERS, Seq(CELEBORN_ADMINISTER))
.set(CelebornConf.WORKER_HTTP_AUTH_ADMINISTERS, Seq(CELEBORN_ADMINISTER))
+ .set(CelebornConf.DYNAMIC_CONFIG_STORE_BACKEND, "DB")
+ .set(
+ CelebornConf.DYNAMIC_CONFIG_STORE_DB_HIKARI_JDBC_URL,
+ "jdbc:h2:mem:test;MODE=MYSQL;INIT=RUNSCRIPT FROM
'classpath:celeborn-0.6.0-h2.sql';DB_CLOSE_DELAY=-1;")
+ .set(CelebornConf.DYNAMIC_CONFIG_STORE_DB_HIKARI_DRIVER_CLASS_NAME,
"org.h2.Driver")
+ .set(CelebornConf.DYNAMIC_CONFIG_STORE_DB_HIKARI_MAXIMUM_POOL_SIZE, 1)
private val BASIC_AUTH_HEADER = HttpAuthSchemes.BASIC + " " + new String(
Base64.getEncoder.encode(
@@ -143,13 +149,11 @@ class TestCelebornCliCommands extends CelebornFunSuite
with MiniClusterFeature {
}
test("worker --show-dynamic-conf") {
- cancel("This test is temporarily disabled since dynamic conf is not
enabled in unit tests.")
val args = prepareWorkerArgs() :+ "--show-dynamic-conf"
- captureOutputAndValidateResponse(args, "")
+ captureOutputAndValidateResponse(args, "DynamicConfigResponse")
}
test("worker --upsert-dynamic-conf") {
- cancel("This test is temporarily disabled since dynamic conf is not
enabled in unit tests.")
val args = prepareWorkerArgs() ++ Array(
"--upsert-dynamic-conf",
"--config-level",
@@ -160,7 +164,6 @@ class TestCelebornCliCommands extends CelebornFunSuite with
MiniClusterFeature {
}
test("worker --delete-dynamic-conf") {
- cancel("This test is temporarily disabled since dynamic conf is not
enabled in unit tests.")
val args = prepareWorkerArgs() ++ Array(
"--delete-dynamic-conf",
"--config-level",
@@ -247,13 +250,11 @@ class TestCelebornCliCommands extends CelebornFunSuite
with MiniClusterFeature {
}
test("master --show-dynamic-conf") {
- cancel("This test is temporarily disabled since dynamic conf is not
enabled in unit tests.")
val args = prepareMasterArgs() :+ "--show-dynamic-conf"
- captureOutputAndValidateResponse(args, "")
+ captureOutputAndValidateResponse(args, "DynamicConfigResponse")
}
test("master --upsert-dynamic-conf") {
- cancel("This test is temporarily disabled since dynamic conf is not
enabled in unit tests.")
val args = prepareMasterArgs() ++ Array(
"--upsert-dynamic-conf",
"--config-level",
@@ -264,7 +265,6 @@ class TestCelebornCliCommands extends CelebornFunSuite with
MiniClusterFeature {
}
test("master --delete-dynamic-conf") {
- cancel("This test is temporarily disabled since dynamic conf is not
enabled in unit tests.")
val args = prepareMasterArgs() ++ Array(
"--delete-dynamic-conf",
"--config-level",
diff --git a/service/pom.xml b/service/pom.xml
index bc1c69547..b656f1154 100644
--- a/service/pom.xml
+++ b/service/pom.xml
@@ -196,6 +196,11 @@
<artifactId>log4j-core</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.datatype</groupId>
+ <artifactId>jackson-datatype-jsr310</artifactId>
+ </dependency>
+
<!-- Test dependencies -->
<dependency>
<groupId>org.mockito</groupId>
diff --git
a/service/src/main/java/org/apache/celeborn/server/common/service/utils/JsonUtils.java
b/service/src/main/java/org/apache/celeborn/server/common/service/utils/JsonUtils.java
index 77e99e5f5..ede7fc81e 100644
---
a/service/src/main/java/org/apache/celeborn/server/common/service/utils/JsonUtils.java
+++
b/service/src/main/java/org/apache/celeborn/server/common/service/utils/JsonUtils.java
@@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.apache.commons.lang3.StringUtils;
public class JsonUtils {
@@ -30,6 +31,7 @@ public class JsonUtils {
static {
MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
MAPPER.setVisibility(PropertyAccessor.FIELD,
JsonAutoDetect.Visibility.ANY);
+ MAPPER.registerModule(new JavaTimeModule());
}
public static String toJson(Object obj) {