Skip to content

Commit

Permalink
[tests] Allow configure integration test suite file using system prop…
Browse files Browse the repository at this point in the history
…erty (apache#3558)

*Motivation*

Sometimes users would like to only execute a set of test suite in command line.

*Modifications*

Make the suite file name configurable in the pom file.
So people can run a specific test suite using
```
mvn -pl tests/integration -DredirectTestOutputToFile=false -DintegrationTestSuiteFile=pulsar-thread-suite.xml clean test -PintegrationTests
```

Also categorize the tests info a few test suites. This would allow us break down
the integration test job into multiple smaller test jobs.
  • Loading branch information
sijie authored Feb 9, 2019
1 parent 634994e commit 9140e3f
Show file tree
Hide file tree
Showing 10 changed files with 207 additions and 7 deletions.
6 changes: 5 additions & 1 deletion tests/integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<packaging>jar</packaging>
<name>Apache Pulsar :: Tests :: Integration</name>

<properties>
<integrationTestSuiteFile>pulsar.xml</integrationTestSuiteFile>
</properties>

<dependencies>
<dependency>
<groupId>org.testng</groupId>
Expand Down Expand Up @@ -187,7 +191,7 @@
</argLine>
<skipTests>false</skipTests>
<suiteXmlFiles>
<file>src/test/resources/pulsar.xml</file>
<file>src/test/resources/${integrationTestSuiteFile}</file>
</suiteXmlFiles>
<forkCount>1</forkCount>
</configuration>
Expand Down
28 changes: 28 additions & 0 deletions tests/integration/src/test/resources/pulsar-cli-suite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!-- TODO: we have to put suite files in one file to avoid executing TESTNG test suites multiple times.
see {@link https://github.com/cbeust/testng/issues/508} -->
<suite name="Pulsar Test Suite" parallel="instances" thread-count="1">
<suite-files>
<suite-file path="./pulsar-cli.xml" />
</suite-files>
</suite>
30 changes: 30 additions & 0 deletions tests/integration/src/test/resources/pulsar-cli.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Pulsar CLI Integration Tests" verbose="2" annotations="JDK">
<test name="pulsar-cli-test-suite" preserve-order="true" >
<classes>
<class name="org.apache.pulsar.tests.integration.cli.CLITest" />
<class name="org.apache.pulsar.tests.integration.cli.HealthcheckTest" />
<class name="org.apache.pulsar.tests.integration.compaction.TestCompaction" />
</classes>
</test>
</suite>
28 changes: 28 additions & 0 deletions tests/integration/src/test/resources/pulsar-process-suite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!-- TODO: we have to put suite files in one file to avoid executing TESTNG test suites multiple times.
see {@link https://github.com/cbeust/testng/issues/508} -->
<suite name="Pulsar Test Suite" parallel="instances" thread-count="1">
<suite-files>
<suite-file path="./pulsar-process.xml" />
</suite-files>
</suite>
8 changes: 2 additions & 6 deletions tests/integration/src/test/resources/pulsar-process.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Pulsar (Process Function Worker) Integration Tests" verbose="2" annotations="JDK">
<test name="pulsar-test-suite" preserve-order="true" >
<suite name="Pulsar Function Process Integration Tests" verbose="2" annotations="JDK">
<test name="pulsar-function-process-test-suite" preserve-order="true" >
<classes>
<class name="org.apache.pulsar.tests.integration.cli.CLITest" />
<class name="org.apache.pulsar.tests.integration.compaction.TestCompaction" />
<class name="org.apache.pulsar.tests.integration.functions.PulsarFunctionsProcessTest" />
<class name="org.apache.pulsar.tests.integration.presto.TestBasicPresto" />
<class name="org.apache.pulsar.tests.integration.cli.HealthcheckTest" />
</classes>
</test>
</suite>
28 changes: 28 additions & 0 deletions tests/integration/src/test/resources/pulsar-sql-suite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!-- TODO: we have to put suite files in one file to avoid executing TESTNG test suites multiple times.
see {@link https://github.com/cbeust/testng/issues/508} -->
<suite name="Pulsar Test Suite" parallel="instances" thread-count="1">
<suite-files>
<suite-file path="./pulsar-sql.xml" />
</suite-files>
</suite>
28 changes: 28 additions & 0 deletions tests/integration/src/test/resources/pulsar-sql.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Pulsar SQL Integration Tests" verbose="2" annotations="JDK">
<test name="pulsar-sql-test-suite" preserve-order="true" >
<classes>
<class name="org.apache.pulsar.tests.integration.presto.TestBasicPresto" />
</classes>
</test>
</suite>
28 changes: 28 additions & 0 deletions tests/integration/src/test/resources/pulsar-thread-suite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!-- TODO: we have to put suite files in one file to avoid executing TESTNG test suites multiple times.
see {@link https://github.com/cbeust/testng/issues/508} -->
<suite name="Pulsar Test Suite" parallel="instances" thread-count="1">
<suite-files>
<suite-file path="./pulsar-thread.xml" />
</suite-files>
</suite>
2 changes: 2 additions & 0 deletions tests/integration/src/test/resources/pulsar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
see {@link https://github.com/cbeust/testng/issues/508} -->
<suite name="Pulsar Test Suite" parallel="instances" thread-count="1">
<suite-files>
<suite-file path="./pulsar-cli.xml" />
<suite-file path="./pulsar-process.xml" />
<suite-file path="./pulsar-sql.xml" />
<suite-file path="./pulsar-thread.xml" />
<suite-file path="./tiered-storage.xml" />
</suite-files>
Expand Down
28 changes: 28 additions & 0 deletions tests/integration/src/test/resources/tiered-storage-suite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!-- TODO: we have to put suite files in one file to avoid executing TESTNG test suites multiple times.
see {@link https://github.com/cbeust/testng/issues/508} -->
<suite name="Pulsar Test Suite" parallel="instances" thread-count="1">
<suite-files>
<suite-file path="./tiered-storage.xml" />
</suite-files>
</suite>

0 comments on commit 9140e3f

Please sign in to comment.