MNEMONIC-440 & MNEMONIC-441: Skip test cases for Spark&Hadoop integration in run-all script if running on JDK9
diff --git a/bin/runTestCases.py b/bin/runTestCases.py
index e5724e8..1fe64a8 100755
--- a/bin/runTestCases.py
+++ b/bin/runTestCases.py
@@ -36,15 +36,19 @@
for line in fp:
match = tcCmdReg.findall(line)
if match:
- logFilePath = testLogDir + tcNameReg.findall(line)[0] + ".log"
- print("[INFO] Running " + tcNameReg.findall(line)[0] + " test case for \"" + tcModuleReg.findall(line)[0] + "\"...")
- try:
- #maven build
- subprocess.check_call(match[0] + ">" + logFilePath, stderr=subprocess.STDOUT, shell=True)
- subprocess.call(cleanupCmd, stderr=subprocess.STDOUT, shell=True)
- print("[SUCCESS] Test case " + tcNameReg.findall(line)[0] + " for \"" + tcModuleReg.findall(line)[0]+ "\" is completed!")
- except subprocess.CalledProcessError as e:
- print("[ERROR] Please refer to testlog/" + tcNameReg.findall(line)[0] + ".log for detailed information.")
- sys.exit(1)
+ tc_module_target_path = tcModuleReg.findall(line)[0] + "/target"
+ if any(fname.endswith('.jar') for fname in os.listdir(tc_module_target_path)):
+ logFilePath = testLogDir + tcNameReg.findall(line)[0] + ".log"
+ print("[INFO] Running " + tcNameReg.findall(line)[0] + " test case for \"" + tcModuleReg.findall(line)[0] + "\"...")
+ try:
+ #maven build
+ subprocess.check_call(match[0] + ">" + logFilePath, stderr=subprocess.STDOUT, shell=True)
+ subprocess.call(cleanupCmd, stderr=subprocess.STDOUT, shell=True)
+ print("[SUCCESS] Test case " + tcNameReg.findall(line)[0] + " for \"" + tcModuleReg.findall(line)[0]+ "\" is completed!")
+ except subprocess.CalledProcessError as e:
+ print("[ERROR] Please refer to testlog/" + tcNameReg.findall(line)[0] + ".log for detailed information.")
+ sys.exit(1)
+ else:
+ print("[WARN] JAR file not found in " + tcNameReg.findall(line)[0] + " test case for \"" + tcModuleReg.findall(line)[0] + "\".")
print("[DONE] All test cases are completed! Log files are available under folder testlog.")
diff --git a/pom.xml b/pom.xml
index e256bbf..409b2a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -211,29 +211,22 @@
</execution>
</executions-->
</plugin>
- <!--plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
- <executions>
- <execution>
- <id>auto-clean</id>
- <phase>initialize</phase>
- <goals>
- <goal>clean</goal>
- </goals>
- </execution>
- </executions>
+ <version>3.0.0</version>
<configuration>
<filesets>
<fileset>
<directory>.</directory>
<includes>
- <include>*.dat</include>
+ <!-- use to clear all jar files to prevent it from performing test if not built on jdk9 -->
+ <include>**/target/*.jar</include>
</includes>
</fileset>
</filesets>
</configuration>
- </plugin-->
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
@@ -361,7 +354,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.19.1</version>
+ <version>2.20.1</version>
<configuration>
<skipTests>${skipTests}</skipTests>
<enableAssertions>true</enableAssertions>