Skip to content

Commit

Permalink
Update deps, allow to run tests with forkCount=1 (apache#8465)
Browse files Browse the repository at this point in the history
# Motivation
In current master you cannot run the tests with "forkCount=1", this is very annoying as by default we are running all of the tests in parallel.
This change upgrades a few testing dependencies and fixes a problem with PowerMock + Testng + Log4j2 + forkCount=1

# Modifications
Upgrade TestNG
Upgrade PowerMock
Upgrade Mockito
Verifying this change
All tests should pass

This change is a trivial rework / code cleanup without any test coverage.


* Update deps, allow to run tests with forkCount=1

* revert log4j2

* fix build

* revert javaassist

* revert surefire

* use https for TestNG DTDs

* remove SnakeYAML

Co-authored-by: Enrico Olivelli <[email protected]>
  • Loading branch information
eolivelli and eolivelli authored Nov 9, 2020
1 parent c989661 commit 3d6377b
Show file tree
Hide file tree
Showing 25 changed files with 40 additions and 32 deletions.
12 changes: 9 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ flexible messaging model and an intuitive client API.</description>
<disruptor.version>3.4.0</disruptor.version>
<testcontainers.version>1.14.3</testcontainers.version>
<kerby.version>1.1.1</kerby.version>
<testng.version>6.14.3</testng.version>
<mockito.version>2.28.2</mockito.version>
<powermock.version>2.0.2</powermock.version>
<testng.version>7.3.0</testng.version>
<mockito.version>3.0.0</mockito.version>
<powermock.version>2.0.9</powermock.version>
<javassist.version>3.25.0-GA</javassist.version>
<failsafe.version>2.3.1</failsafe.version>
<skyscreamer.version>1.5.0</skyscreamer.version>
Expand Down Expand Up @@ -241,6 +241,12 @@ flexible messaging model and an intuitive client API.</description>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<exclusions>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@
import org.apache.zookeeper.MockZooKeeper;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.data.ACL;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Base class for all tests that need a Pulsar instance without a ZK and BK cluster
*/
@PowerMockIgnore(value = {"org.slf4j.*", "com.sun.org.apache.xerces.*" })
public abstract class MockedPulsarServiceBaseTest {

protected ServiceConfiguration conf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ public void testCreateFunctionWithCpu() throws Exception {
assertEquals(FN_NAME, creater.getFunctionName());
assertEquals(INPUT_TOPIC_NAME, creater.getInputs());
assertEquals(OUTPUT_TOPIC_NAME, creater.getOutput());
assertEquals(creater.getFunctionConfig().getResources().getCpu(), 5.0);
assertEquals(creater.getFunctionConfig().getResources().getCpu(), 5.0, 0);
// Disk/Ram should be default
assertEquals(creater.getFunctionConfig().getResources().getRam(), Long.valueOf(1073741824L));
assertEquals(creater.getFunctionConfig().getResources().getDisk(), Long.valueOf(10737418240L));
Expand Down Expand Up @@ -582,7 +582,7 @@ public void testCreateFunctionWithRam() throws Exception {
assertEquals(OUTPUT_TOPIC_NAME, creater.getOutput());
assertEquals(creater.getFunctionConfig().getResources().getRam(), Long.valueOf(5656565656L));
// cpu/disk should be default
assertEquals(creater.getFunctionConfig().getResources().getCpu(), 1.0);
assertEquals(creater.getFunctionConfig().getResources().getCpu(), 1.0, 0);
assertEquals(creater.getFunctionConfig().getResources().getDisk(), Long.valueOf(10737418240L));
verify(functions, times(1)).createFunctionWithUrl(any(FunctionConfig.class), anyString());
}
Expand All @@ -609,7 +609,7 @@ public void testCreateFunctionWithDisk() throws Exception {
assertEquals(creater.getFunctionConfig().getResources().getDisk(), Long.valueOf(8080808080808080L));
// cpu/Ram should be default
assertEquals(creater.getFunctionConfig().getResources().getRam(), Long.valueOf(1073741824L));
assertEquals(creater.getFunctionConfig().getResources().getCpu(), 1.0);
assertEquals(creater.getFunctionConfig().getResources().getCpu(), 1.0, 0);
verify(functions, times(1)).createFunctionWithUrl(any(FunctionConfig.class), anyString());
}

Expand All @@ -633,7 +633,7 @@ public void testUpdateFunctionWithCpu() throws Exception {
assertEquals(FN_NAME, updater.getFunctionName());
assertEquals(INPUT_TOPIC_NAME, updater.getInputs());
assertEquals(OUTPUT_TOPIC_NAME, updater.getOutput());
assertEquals(updater.getFunctionConfig().getResources().getCpu(), 5.0);
assertEquals(updater.getFunctionConfig().getResources().getCpu(), 5.0, 0);
// Disk/Ram should be default
assertEquals(updater.getFunctionConfig().getResources().getRam(), Long.valueOf(1073741824L));
assertEquals(updater.getFunctionConfig().getResources().getDisk(), Long.valueOf(10737418240L));
Expand Down Expand Up @@ -661,7 +661,7 @@ public void testUpdateFunctionWithRam() throws Exception {
assertEquals(OUTPUT_TOPIC_NAME, updater.getOutput());
assertEquals(updater.getFunctionConfig().getResources().getRam(), Long.valueOf(5656565656L));
// cpu/disk should be default
assertEquals(updater.getFunctionConfig().getResources().getCpu(), 1.0);
assertEquals(updater.getFunctionConfig().getResources().getCpu(), 1.0, 0);
assertEquals(updater.getFunctionConfig().getResources().getDisk(), Long.valueOf(10737418240L));
verify(functions, times(1)).updateFunctionWithUrl(any(FunctionConfig.class), anyString(), eq(new UpdateOptions()));
}
Expand All @@ -688,7 +688,7 @@ public void testUpdateFunctionWithDisk() throws Exception {
assertEquals(updater.getFunctionConfig().getResources().getDisk(), Long.valueOf(8080808080808080L));
// cpu/Ram should be default
assertEquals(updater.getFunctionConfig().getResources().getRam(), Long.valueOf(1073741824L));
assertEquals(updater.getFunctionConfig().getResources().getCpu(), 1.0);
assertEquals(updater.getFunctionConfig().getResources().getCpu(), 1.0, 0);
verify(functions, times(1)).updateFunctionWithUrl(any(FunctionConfig.class), anyString(), eq(new UpdateOptions()));
}

Expand All @@ -715,7 +715,7 @@ public void testUpdateAuthData() throws Exception {
assertEquals(updater.getFunctionConfig().getResources().getDisk(), Long.valueOf(8080808080808080L));
// cpu/Ram should be default
assertEquals(updater.getFunctionConfig().getResources().getRam(), Long.valueOf(1073741824L));
assertEquals(updater.getFunctionConfig().getResources().getCpu(), 1.0);
assertEquals(updater.getFunctionConfig().getResources().getCpu(), 1.0, 0);
UpdateOptions updateOptions = new UpdateOptions();
updateOptions.setUpdateAuthData(true);
verify(functions, times(1)).updateFunctionWithUrl(any(FunctionConfig.class), anyString(), eq(updateOptions));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ public void testFunctionConfigConvertFromDetails() {
assertEquals(functionConfig.getName(), name);
assertEquals(functionConfig.getClassName(), classname);
assertEquals(functionConfig.getLogTopic(), logTopic);
assertEquals(functionConfig.getResources().getCpu(), resources.getCpu());
assertEquals((Object) functionConfig.getResources().getCpu(), resources.getCpu());
assertEquals(functionConfig.getResources().getDisk().longValue(), resources.getDisk());
assertEquals(functionConfig.getResources().getRam().longValue(), resources.getRam());
assertEquals(functionConfig.getOutput(), sinkSpec.getTopic());
Expand Down
2 changes: 1 addition & 1 deletion tests/bc_2_0_0/src/test/resources/pulsar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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 Standalone Tests" verbose="2" annotations="JDK">
Expand Down
2 changes: 1 addition & 1 deletion tests/bc_2_0_1/src/test/resources/pulsar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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 Standalone Tests" verbose="2" annotations="JDK">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Pulsar Messaging Backwards Compatibility Tests" verbose="2" annotations="JDK">
<test name="messaging-backwards-compatibility-suite" preserve-order="true">
<classes>
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/test/resources/pulsar-cli-suite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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">
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/test/resources/pulsar-cli.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Pulsar Function State Integration Tests" verbose="2" annotations="JDK">
<test name="pulsar-function-state-test-suite" preserve-order="true" >
<classes>
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/test/resources/pulsar-messaging.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Pulsar (Messaging) Integration Tests" verbose="2" annotations="JDK">
<test name="messaging-test-suite" preserve-order="true">
<classes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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">
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/test/resources/pulsar-process.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Pulsar Function Process Integration Tests" verbose="2" annotations="JDK">
<test name="pulsar-function-process-test-suite" preserve-order="true" >
<classes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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">
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/test/resources/pulsar-schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Pulsar Schema Integration Tests" verbose="2" annotations="JDK">
<test name="pulsar-schema-test-suite" preserve-order="true" >
<classes>
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/test/resources/pulsar-sql-suite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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">
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/test/resources/pulsar-sql.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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>
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/test/resources/pulsar-standalone.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Pulsar Standalone Tests" verbose="2" annotations="JDK">
<test name="pulsar-standalone-suite" preserve-order="true" >
<classes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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">
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/test/resources/pulsar-thread.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Pulsar (Thread Function Worker) Integration Tests" verbose="2" annotations="JDK">
<test name="pulsar-thread-test-suite" preserve-order="true">
<classes>
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/src/test/resources/pulsar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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 (Jcloud Tiered Storage)Test Suite" parallel="instances" thread-count="1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Pulsar (Filesystem Tiered Storage) Integration Tests" verbose="2" annotations="JDK">
<test name="tiered-storage-filesystem-test-suite" preserve-order="true">
<classes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Pulsar (Jcloud Tiered Storage) Integration Tests" verbose="2" annotations="JDK">
<test name="tiered-storage-jcloud-test-suite" preserve-order="true">
<classes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<!DOCTYPE suite SYSTEM "https://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">
Expand Down

0 comments on commit 3d6377b

Please sign in to comment.