mirror of
https://github.com/apache/sqoop.git
synced 2025-05-04 01:00:46 +08:00
SQOOP-1991: Sqoop2: Define slow category in integration tests
(Abraham Elmahrek via Jarek Jarcec Cecho)
This commit is contained in:
parent
c8dbec4813
commit
21a44fc15b
@ -255,18 +255,26 @@ def find_all_files(top):
|
|||||||
for f in files:
|
for f in files:
|
||||||
yield os.path.join(root, f)
|
yield os.path.join(root, f)
|
||||||
|
|
||||||
def mvn_test(result, output_dir):
|
def mvn_test(result, output_dir, slow):
|
||||||
run_mvn_test("test", "unit", result, output_dir)
|
run_mvn_test("test", "unit", result, output_dir, slow)
|
||||||
|
|
||||||
def mvn_integration(result, output_dir):
|
def mvn_integration(result, output_dir, slow):
|
||||||
run_mvn_test("integration-test -pl test", "integration", result, output_dir)
|
run_mvn_test("integration-test -pl test", "integration", result, output_dir, slow)
|
||||||
|
|
||||||
def run_mvn_test(command, test_type, result, output_dir):
|
def run_mvn_test(command, test_type, result, output_dir, slow):
|
||||||
rc = execute("mvn %s 1>%s/test_%s.txt 2>&1" % (command, output_dir, test_type))
|
if slow:
|
||||||
|
command += " -Pslow,hadoop200"
|
||||||
|
test_file_name = "%s_slow" % test_type
|
||||||
|
test_type = "slow %s" % test_type
|
||||||
|
else:
|
||||||
|
test_file_name = "%s_fast" % test_type
|
||||||
|
test_type = "fast %s" % test_type
|
||||||
|
|
||||||
|
rc = execute("mvn %s 1>%s/test_%s.txt 2>&1" % (command, output_dir, test_file_name))
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
result.success("All %s tests passed" % test_type)
|
result.success("All %s tests passed" % test_type)
|
||||||
else:
|
else:
|
||||||
result.error("Some %s tests failed (%s)" % (test_type, jenkins_file_link_for_jira("report", "test_%s.txt" % test_type)))
|
result.error("Some %s tests failed (%s)" % (test_type, jenkins_file_link_for_jira("report", "test_%s.txt" % test_file_name)))
|
||||||
failed_tests = []
|
failed_tests = []
|
||||||
for path in list(find_all_files(".")):
|
for path in list(find_all_files(".")):
|
||||||
file_name = os.path.basename(path)
|
file_name = os.path.basename(path)
|
||||||
@ -449,8 +457,10 @@ def post_jira_comment_and_exit():
|
|||||||
mvn_rat(result, output_dir)
|
mvn_rat(result, output_dir)
|
||||||
mvn_install(result, output_dir)
|
mvn_install(result, output_dir)
|
||||||
if run_tests:
|
if run_tests:
|
||||||
mvn_test(result, output_dir)
|
mvn_test(result, output_dir, slow=False)
|
||||||
mvn_integration(result, output_dir)
|
mvn_test(result, output_dir, slow=True)
|
||||||
|
mvn_integration(result, output_dir, slow=False)
|
||||||
|
mvn_integration(result, output_dir, slow=True)
|
||||||
else:
|
else:
|
||||||
result.info("patch applied and built but tests did not execute")
|
result.info("patch applied and built but tests did not execute")
|
||||||
|
|
||||||
|
32
pom.xml
32
pom.xml
@ -138,6 +138,10 @@ limitations under the License.
|
|||||||
<profile>
|
<profile>
|
||||||
<id>fast</id>
|
<id>fast</id>
|
||||||
|
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -147,6 +151,14 @@ limitations under the License.
|
|||||||
<excludedGroups>slow</excludedGroups>
|
<excludedGroups>slow</excludedGroups>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<excludedGroups>slow</excludedGroups>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
@ -154,6 +166,12 @@ limitations under the License.
|
|||||||
<profile>
|
<profile>
|
||||||
<id>slow</id>
|
<id>slow</id>
|
||||||
|
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>slow</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -163,6 +181,14 @@ limitations under the License.
|
|||||||
<groups>slow</groups>
|
<groups>slow</groups>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<groups>slow</groups>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
@ -687,6 +713,12 @@ limitations under the License.
|
|||||||
</properties>
|
</properties>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<version>2.18.1</version>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user