This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new d8e310e1c6 Test reporter will never fail due to path (#7418)
d8e310e1c6 is described below
commit d8e310e1c6d59e0a6b911314d04ee20cded79c16
Author: BaiJian <[email protected]>
AuthorDate: Fri Sep 23 17:09:39 2022 +0800
Test reporter will never fail due to path (#7418)
---
.../apache/iotdb/it/framework/IoTDBTestReporter.java | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git
a/integration-test/src/main/java/org/apache/iotdb/it/framework/IoTDBTestReporter.java
b/integration-test/src/main/java/org/apache/iotdb/it/framework/IoTDBTestReporter.java
index 11adafacaf..200f382806 100644
---
a/integration-test/src/main/java/org/apache/iotdb/it/framework/IoTDBTestReporter.java
+++
b/integration-test/src/main/java/org/apache/iotdb/it/framework/IoTDBTestReporter.java
@@ -18,6 +18,7 @@
*/
package org.apache.iotdb.it.framework;
+import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -31,12 +32,17 @@ public class IoTDBTestReporter {
public static void main(String[] args) throws IOException {
List<IoTDBTestStat> stats = new ArrayList<>();
- try (Stream<Path> s =
- Files.walk(
- Paths.get(
- System.getProperty("user.dir"),
- "integration-test",
- IoTDBTestListener.statOutputDir))) {
+ Path outputDirPath =
+ Paths.get(
+ System.getProperty("user.dir"), "integration-test",
IoTDBTestListener.statOutputDir);
+ File outputDir = outputDirPath.toFile();
+ if (!outputDir.exists() || !outputDir.isDirectory()) {
+ IoTDBTestLogger.logger.error(
+ "the output dir {} is not a valid directory, the reporter will be
aborted",
+ outputDirPath);
+ return;
+ }
+ try (Stream<Path> s = Files.walk(outputDirPath)) {
s.forEach(
source -> {
if (source.toString().endsWith(IoTDBTestListener.statExt)) {