This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-e2e.git
The following commit(s) were added to refs/heads/master by this push:
new c5e55e9 Modify the way to obtain environment variables (#30)
c5e55e9 is described below
commit c5e55e9b88dae59c3a2a98a47eacacc4b77ed711
Author: yueya <[email protected]>
AuthorDate: Tue May 23 10:10:11 2023 +0800
Modify the way to obtain environment variables (#30)
* Modify the way to obtain environment variables
* Update go client
---
golang/bin/run.sh | 4 ++--
.../e2e-v4/src/main/java/org/apache/rocketmq/frame/ResourceInit.java | 4 ++--
java/e2e/src/main/java/org/apache/rocketmq/frame/ResourceInit.java | 5 +++--
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/golang/bin/run.sh b/golang/bin/run.sh
index a1b2200..c0d37d0 100644
--- a/golang/bin/run.sh
+++ b/golang/bin/run.sh
@@ -20,5 +20,5 @@
cd ../common && mvn -Prelease -DskipTests clean package -U
# set env for mqadmin (use source to set linux env variables in current shell)
cd ../rocketmq-admintools && source bin/env.sh
-# run go e2e test case
-cd ../golang && go test ./mqgotest/... -timeout 2m -v
+# run go e2e test case with latest client version
+cd ../golang && go get -u github.com/apache/rocketmq-clients/golang && go test
./mqgotest/... -timeout 2m -v
diff --git
a/java/e2e-v4/src/main/java/org/apache/rocketmq/frame/ResourceInit.java
b/java/e2e-v4/src/main/java/org/apache/rocketmq/frame/ResourceInit.java
index 59e8c0d..d0839e8 100644
--- a/java/e2e-v4/src/main/java/org/apache/rocketmq/frame/ResourceInit.java
+++ b/java/e2e-v4/src/main/java/org/apache/rocketmq/frame/ResourceInit.java
@@ -98,7 +98,7 @@ public class ResourceInit {
}
private static void initConnectionInfo() {
- allIp = System.getProperty("ALL_IP", properties.getProperty("ALL_IP"));
+ allIp = System.getenv("ALL_IP");
if (allIp != null) {
String[] allPodInfos = allIp.split(",");
for (String podInfo : allPodInfos) {
@@ -118,7 +118,7 @@ public class ResourceInit {
log.info("INIT- Get ALL_IP is null, use local info");
namesrvAddr = System.getProperty("namesrvAddr",
properties.getProperty("namesrvAddr"));
}
- cluster = System.getProperty("cluster",
properties.getProperty("cluster"));
+ cluster = System.getenv("cluster") != null ? System.getenv("cluster")
: properties.getProperty("cluster");
if (cluster == null) {
log.error("INIT- cluster is null, system exit");
System.exit(-1);
diff --git a/java/e2e/src/main/java/org/apache/rocketmq/frame/ResourceInit.java
b/java/e2e/src/main/java/org/apache/rocketmq/frame/ResourceInit.java
index 2a8b237..cbc86a3 100644
--- a/java/e2e/src/main/java/org/apache/rocketmq/frame/ResourceInit.java
+++ b/java/e2e/src/main/java/org/apache/rocketmq/frame/ResourceInit.java
@@ -26,6 +26,7 @@ import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
+
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.rocketmq.account.Account;
import org.apache.rocketmq.util.MQAdmin;
@@ -101,7 +102,7 @@ public class ResourceInit {
}
private static void initConnectionInfo() {
- ALL_IP = System.getProperty("ALL_IP",
properties.getProperty("ALL_IP"));
+ ALL_IP = System.getenv("ALL_IP");
if (ALL_IP != null) {
String[] allPodInfos = ALL_IP.split(",");
for (String podInfo : allPodInfos) {
@@ -135,7 +136,7 @@ public class ResourceInit {
endPoint = System.getProperty("endPoint",
properties.getProperty("endPoint"));
namesrvAddr = System.getProperty("namesrvAddr",
properties.getProperty("namesrvAddr"));
}
- cluster = System.getProperty("cluster",
properties.getProperty("cluster"));
+ cluster = System.getenv("cluster") != null ? System.getenv("cluster")
: properties.getProperty("cluster");
if (cluster == null) {
log.error("INIT- cluster is null, system exit");
System.exit(-1);