Skip to content

Commit

Permalink
Convert PTL tests to JUnit
Browse files Browse the repository at this point in the history
Convert product tests launcher's test to JUnit. This does not change
product tests themselves.
  • Loading branch information
findepi committed Dec 18, 2023
1 parent 5912370 commit df3a63a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 14 deletions.
16 changes: 14 additions & 2 deletions testing/trino-product-tests-launcher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@
</exclusions>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>junit-extensions</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-jdbc</artifactId>
Expand All @@ -212,8 +218,14 @@
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
package io.trino.tests.product.launcher.cli;

import com.google.common.base.Splitter;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
Expand All @@ -24,8 +25,9 @@
import static io.trino.tests.product.launcher.cli.Launcher.execute;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;

@Test(singleThreaded = true)
@Execution(SAME_THREAD)
public class TestInvocations
{
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package io.trino.tests.product.launcher.cli;

import com.google.common.collect.ImmutableList;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;
import picocli.CommandLine.Option;
import picocli.CommandLine.Parameters;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import io.trino.tests.product.launcher.suite.suites.Suite1;
import io.trino.tests.product.launcher.suite.suites.Suite6NonGeneric;
import io.trino.tests.product.launcher.suite.suites.SuiteTpcds;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import static io.trino.tests.product.launcher.Configurations.canonicalEnvironmentName;
import static io.trino.tests.product.launcher.Configurations.nameForSuiteClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/
package io.trino.tests.product.launcher.local;

import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.net.InetAddress;
import java.net.Socket;
Expand All @@ -23,7 +23,6 @@
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Properties;

import static java.lang.String.format;
Expand All @@ -32,8 +31,7 @@

public class TestManuallyJdbcOauth2
{
@BeforeClass(alwaysRun = true)
public void verifyEtcHostsEntries()
private static void verifyEtcHostsEntries()
throws UnknownHostException
{
assertThat(InetAddress.getByName("presto-master").isLoopbackAddress()).isTrue();
Expand All @@ -53,10 +51,13 @@ public void verifyEtcHostsEntries()
* 127.0.0.1 hydra
* 127.0.0.1 hydra-consent
*/
@Test(enabled = false)
@Test
@Disabled
public void shouldAuthenticateAndExecuteQuery()
throws SQLException
throws Exception
{
verifyEtcHostsEntries();

Properties properties = new Properties();
String jdbcUrl = format("jdbc:trino://presto-master:7778?"
+ "SSL=true&"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.tests.product.launcher.util;

import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down

0 comments on commit df3a63a

Please sign in to comment.