This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 37f367a Stabilize unit test (#3291)
37f367a is described below
commit 37f367a3b7d4d073bed887346fad5e5ff1628546
Author: kezhenxu94 <[email protected]>
AuthorDate: Tue Aug 20 15:04:50 2019 +0800
Stabilize unit test (#3291)
* Stabilize unit test
The FileWriterTest creates files in the source directory(failed to
delete them due to a bug in the `deleteDir` method), making
them being checked by checkstyle plugin and failed to pass.
* Seperate compilation step
---
Jenkinsfile-E2E | 8 +++++++-
.../apm/agent/core/logging/core/FileWriterTest.java | 11 ++++-------
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/Jenkinsfile-E2E b/Jenkinsfile-E2E
index b82dcc6..c2ec97b 100755
--- a/Jenkinsfile-E2E
+++ b/Jenkinsfile-E2E
@@ -53,11 +53,17 @@ pipeline {
}
}
+ stage('Compile Test Codes') {
+ steps {
+ sh './mvnw -f test/e2e/pom.xml clean'
+ }
+ }
+
stage('Run End-to-End Tests') {
parallel {
stage('Run Single Node Tests') {
steps {
- sh './mvnw -DskipSurefire=false -Dbuild.id=${BUILD_ID}
-f test/e2e/pom.xml -pl e2e-single-service -am verify'
+ sh './mvnw -Dbuild.id=${BUILD_ID} -f test/e2e/pom.xml
-pl e2e-single-service -am verify'
}
}
diff --git
a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/logging/core/FileWriterTest.java
b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/logging/core/FileWriterTest.java
old mode 100644
new mode 100755
index 00631ea..3967e7c
---
a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/logging/core/FileWriterTest.java
+++
b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/logging/core/FileWriterTest.java
@@ -36,7 +36,7 @@ public class FileWriterTest {
@BeforeClass
public static void beforeTestFile() throws IOException {
Config.Logging.MAX_FILE_SIZE = 10;
- File directory = new File("");
+ File directory = new File(System.getProperty("java.io.tmpdir",
"/tmp"));
Config.Logging.DIR = directory.getCanonicalPath() +
Constants.PATH_SEPARATOR + "/log-test/";
}
@@ -57,16 +57,13 @@ public class FileWriterTest {
Config.Logging.DIR = "";
}
- private static boolean deleteDir(File dir) {
+ private static void deleteDir(File dir) {
if (dir.isDirectory()) {
String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
- boolean success = deleteDir(new File(dir, children[i]));
- if (!success) {
- return false;
- }
+ deleteDir(new File(dir, children[i]));
}
}
- return dir.delete();
+ dir.delete();
}
}