From 47c391370234d5746d9aca94c23ed62e0d8611b0 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Fri, 15 Dec 2023 16:55:21 +0100 Subject: [PATCH 1/3] Remove TestNG from test classpath Remove TestNG from classpath of modules that do not use it anymore. --- client/trino-cli/pom.xml | 6 ------ client/trino-client/pom.xml | 6 ------ lib/trino-hdfs/pom.xml | 6 ------ lib/trino-plugin-toolkit/pom.xml | 6 ------ plugin/trino-accumulo/pom.xml | 6 ------ plugin/trino-base-jdbc/pom.xml | 6 ------ plugin/trino-bigquery/pom.xml | 6 ------ plugin/trino-cassandra/pom.xml | 6 ------ plugin/trino-clickhouse/pom.xml | 6 ------ plugin/trino-kudu/pom.xml | 6 ------ plugin/trino-password-authenticators/pom.xml | 6 ------ plugin/trino-pinot/pom.xml | 6 ------ plugin/trino-raptor-legacy/pom.xml | 6 ------ plugin/trino-resource-group-managers/pom.xml | 6 ------ plugin/trino-thrift-api/pom.xml | 6 ------ plugin/trino-thrift/pom.xml | 6 ------ 16 files changed, 96 deletions(-) diff --git a/client/trino-cli/pom.xml b/client/trino-cli/pom.xml index 80fc251f557e..03ca229a1e53 100644 --- a/client/trino-cli/pom.xml +++ b/client/trino-cli/pom.xml @@ -147,12 +147,6 @@ junit-jupiter-engine test - - - org.testng - testng - test - diff --git a/client/trino-client/pom.xml b/client/trino-client/pom.xml index 074194851396..875d625530ff 100644 --- a/client/trino-client/pom.xml +++ b/client/trino-client/pom.xml @@ -122,11 +122,5 @@ junit-jupiter-api test - - - org.testng - testng - test - diff --git a/lib/trino-hdfs/pom.xml b/lib/trino-hdfs/pom.xml index d36fa826048b..02167d3ce260 100644 --- a/lib/trino-hdfs/pom.xml +++ b/lib/trino-hdfs/pom.xml @@ -261,12 +261,6 @@ testcontainers test - - - org.testng - testng - test - diff --git a/lib/trino-plugin-toolkit/pom.xml b/lib/trino-plugin-toolkit/pom.xml index bffe213e0084..01cd65a8fe6c 100644 --- a/lib/trino-plugin-toolkit/pom.xml +++ b/lib/trino-plugin-toolkit/pom.xml @@ -187,12 +187,6 @@ junit-jupiter-engine test - - - org.testng - testng - test - diff --git a/plugin/trino-accumulo/pom.xml b/plugin/trino-accumulo/pom.xml index 02347a6284bb..1f1c1697b4f7 100644 --- a/plugin/trino-accumulo/pom.xml +++ b/plugin/trino-accumulo/pom.xml @@ -314,12 +314,6 @@ testcontainers test - - - org.testng - testng - test - diff --git a/plugin/trino-base-jdbc/pom.xml b/plugin/trino-base-jdbc/pom.xml index bae0cfc8b9cc..295297634251 100644 --- a/plugin/trino-base-jdbc/pom.xml +++ b/plugin/trino-base-jdbc/pom.xml @@ -275,12 +275,6 @@ junit-jupiter-engine test - - - org.testng - testng - test - diff --git a/plugin/trino-bigquery/pom.xml b/plugin/trino-bigquery/pom.xml index dab8f20a180c..23cc8463db78 100644 --- a/plugin/trino-bigquery/pom.xml +++ b/plugin/trino-bigquery/pom.xml @@ -484,12 +484,6 @@ 5.6.0 test - - - org.testng - testng - test - diff --git a/plugin/trino-cassandra/pom.xml b/plugin/trino-cassandra/pom.xml index f8eaf4fc7c59..5da45d4abc3c 100644 --- a/plugin/trino-cassandra/pom.xml +++ b/plugin/trino-cassandra/pom.xml @@ -251,12 +251,6 @@ testcontainers test - - - org.testng - testng - test - diff --git a/plugin/trino-clickhouse/pom.xml b/plugin/trino-clickhouse/pom.xml index 1f7861124ddf..b36e0422613b 100644 --- a/plugin/trino-clickhouse/pom.xml +++ b/plugin/trino-clickhouse/pom.xml @@ -199,11 +199,5 @@ testcontainers test - - - org.testng - testng - test - diff --git a/plugin/trino-kudu/pom.xml b/plugin/trino-kudu/pom.xml index 3b755040c959..61874946a4fc 100644 --- a/plugin/trino-kudu/pom.xml +++ b/plugin/trino-kudu/pom.xml @@ -228,12 +228,6 @@ toxiproxy test - - - org.testng - testng - test - diff --git a/plugin/trino-password-authenticators/pom.xml b/plugin/trino-password-authenticators/pom.xml index a401dd4ebfc8..3d0e2cbd98b7 100644 --- a/plugin/trino-password-authenticators/pom.xml +++ b/plugin/trino-password-authenticators/pom.xml @@ -164,11 +164,5 @@ toxiproxy test - - - org.testng - testng - test - diff --git a/plugin/trino-pinot/pom.xml b/plugin/trino-pinot/pom.xml index b6ddeb113152..7ba6ff80a783 100755 --- a/plugin/trino-pinot/pom.xml +++ b/plugin/trino-pinot/pom.xml @@ -658,12 +658,6 @@ testcontainers test - - - org.testng - testng - test - diff --git a/plugin/trino-raptor-legacy/pom.xml b/plugin/trino-raptor-legacy/pom.xml index c827073f709e..eeff307695e7 100644 --- a/plugin/trino-raptor-legacy/pom.xml +++ b/plugin/trino-raptor-legacy/pom.xml @@ -313,11 +313,5 @@ testcontainers test - - - org.testng - testng - test - diff --git a/plugin/trino-resource-group-managers/pom.xml b/plugin/trino-resource-group-managers/pom.xml index ec9819c0a4c6..730877fe81ce 100644 --- a/plugin/trino-resource-group-managers/pom.xml +++ b/plugin/trino-resource-group-managers/pom.xml @@ -257,11 +257,5 @@ testcontainers test - - - org.testng - testng - test - diff --git a/plugin/trino-thrift-api/pom.xml b/plugin/trino-thrift-api/pom.xml index 116a381208a9..fec2de008562 100644 --- a/plugin/trino-thrift-api/pom.xml +++ b/plugin/trino-thrift-api/pom.xml @@ -83,12 +83,6 @@ junit-jupiter-engine test - - - org.testng - testng - test - diff --git a/plugin/trino-thrift/pom.xml b/plugin/trino-thrift/pom.xml index 4456743199a8..0284ae57d8de 100644 --- a/plugin/trino-thrift/pom.xml +++ b/plugin/trino-thrift/pom.xml @@ -241,12 +241,6 @@ junit-jupiter-engine test - - - org.testng - testng - test - From 48a3e065238ac9a0b8bca3e2089099bf737edd5f Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Fri, 15 Dec 2023 17:27:45 +0100 Subject: [PATCH 2/3] Migrate trino-record-decoder off TestNG assertions --- lib/trino-record-decoder/pom.xml | 6 ------ .../test/java/io/trino/decoder/util/DecoderTestUtil.java | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/trino-record-decoder/pom.xml b/lib/trino-record-decoder/pom.xml index 3ce83c8ff4b5..8c838108c22c 100644 --- a/lib/trino-record-decoder/pom.xml +++ b/lib/trino-record-decoder/pom.xml @@ -165,12 +165,6 @@ junit-jupiter-engine test - - - org.testng - testng - test - diff --git a/lib/trino-record-decoder/src/test/java/io/trino/decoder/util/DecoderTestUtil.java b/lib/trino-record-decoder/src/test/java/io/trino/decoder/util/DecoderTestUtil.java index 31b3a13dedea..61d5d190b74a 100644 --- a/lib/trino-record-decoder/src/test/java/io/trino/decoder/util/DecoderTestUtil.java +++ b/lib/trino-record-decoder/src/test/java/io/trino/decoder/util/DecoderTestUtil.java @@ -22,7 +22,7 @@ import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; -import static org.testng.Assert.assertEquals; +import static org.assertj.core.data.Offset.offset; public final class DecoderTestUtil { @@ -55,7 +55,7 @@ public static void checkValue(Map decod { FieldValueProvider provider = decodedRow.get(handle); assertThat(provider).isNotNull(); - assertEquals(provider.getDouble(), value, 0.0001); + assertThat(provider.getDouble()).isCloseTo(value, offset(0.0001)); } public static void checkValue(Map decodedRow, DecoderColumnHandle handle, boolean value) From c50904a244eaf4866fef6d566763482172297a7b Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Fri, 15 Dec 2023 17:33:02 +0100 Subject: [PATCH 3/3] Migrate trino-prometheus off TestNG assertions --- plugin/trino-prometheus/pom.xml | 6 ------ .../trino/plugin/prometheus/TestPrometheusIntegration.java | 4 +--- .../io/trino/plugin/prometheus/TestPrometheusSplit.java | 4 ++-- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/plugin/trino-prometheus/pom.xml b/plugin/trino-prometheus/pom.xml index 4e5a7ccd6a31..2b33f26c168d 100644 --- a/plugin/trino-prometheus/pom.xml +++ b/plugin/trino-prometheus/pom.xml @@ -257,11 +257,5 @@ testcontainers test - - - org.testng - testng - test - diff --git a/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusIntegration.java b/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusIntegration.java index 9e771bb78791..0fae916c36e5 100644 --- a/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusIntegration.java +++ b/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusIntegration.java @@ -30,7 +30,6 @@ import static java.util.concurrent.TimeUnit.DAYS; import static java.util.concurrent.TimeUnit.SECONDS; import static org.assertj.core.api.Assertions.assertThat; -import static org.testng.Assert.assertEquals; public class TestPrometheusIntegration extends AbstractTestQueryFramework @@ -129,7 +128,6 @@ public void testCorrectNumberOfSplitsCreated() (DynamicFilter) null, Constraint.alwaysTrue()); int numSplits = splits.getNextBatch(NUMBER_MORE_THAN_EXPECTED_NUMBER_SPLITS).getNow(null).getSplits().size(); - assertEquals(numSplits, config.getMaxQueryRangeDuration().getValue(TimeUnit.SECONDS) / config.getQueryChunkSizeDuration().getValue(TimeUnit.SECONDS), - 0.001); + assertThat((double) numSplits).isEqualTo(config.getMaxQueryRangeDuration().getValue(TimeUnit.SECONDS) / config.getQueryChunkSizeDuration().getValue(TimeUnit.SECONDS)); } } diff --git a/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusSplit.java b/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusSplit.java index dc156c3fe056..4ac86b8a344e 100644 --- a/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusSplit.java +++ b/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/TestPrometheusSplit.java @@ -62,9 +62,9 @@ import static java.util.concurrent.TimeUnit.SECONDS; import static org.apache.http.client.utils.URLEncodedUtils.parse; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.data.Offset.offset; import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; import static org.junit.jupiter.api.parallel.ExecutionMode.CONCURRENT; -import static org.testng.Assert.assertEquals; @TestInstance(PER_CLASS) @Execution(CONCURRENT) @@ -210,7 +210,7 @@ public void testQueryDividedIntoSplitsShouldHaveCorrectSpacingBetweenTimes() assertThat(paramsMap1).containsEntry("query", "up[1d]"); assertThat(paramsMap2).containsEntry("query", "up[1d]"); long diff = Double.valueOf(paramsMap2.get("time")).longValue() - Double.valueOf(paramsMap1.get("time")).longValue(); - assertEquals(config.getQueryChunkSizeDuration().getValue(TimeUnit.SECONDS), diff, 0.0001); + assertThat(config.getQueryChunkSizeDuration().getValue(TimeUnit.SECONDS)).isCloseTo(diff, offset(0.0001)); } @Test