Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import io.trino.tests.product.launcher.env.DockerContainer;
import io.trino.tests.product.launcher.env.Environment;
import io.trino.tests.product.launcher.env.EnvironmentProvider;
import io.trino.tests.product.launcher.env.common.Standard;
import io.trino.tests.product.launcher.env.common.StandardMultinode;
import io.trino.tests.product.launcher.env.common.TestsEnvironment;
import io.trino.tests.product.launcher.testcontainers.PortBinder;
import org.testcontainers.containers.startupcheck.IsRunningStartupCheckStrategy;
Expand All @@ -28,24 +28,21 @@
import java.time.Duration;

import static io.trino.tests.product.launcher.docker.ContainerUtil.forSelectedPorts;
import static io.trino.tests.product.launcher.env.common.Standard.CONTAINER_TRINO_ETC;
import static java.util.Objects.requireNonNull;
import static org.testcontainers.utility.MountableFile.forHostPath;

@TestsEnvironment
public final class EnvSinglenodeCassandra
public final class EnvMultinodeCassandra
extends EnvironmentProvider
{
private final DockerFiles dockerFiles;
private final PortBinder portBinder;

public static final String CONTAINER_TRINO_CASSANDRA_PROPERTIES = CONTAINER_TRINO_ETC + "/catalog/cassandra.properties";
public static final int CASSANDRA_PORT = 9042;

@Inject
protected EnvSinglenodeCassandra(DockerFiles dockerFiles, PortBinder portBinder, Standard standard)
protected EnvMultinodeCassandra(DockerFiles dockerFiles, PortBinder portBinder, StandardMultinode standardMultinode)
{
super(ImmutableList.of(standard));
super(ImmutableList.of(standardMultinode));
this.dockerFiles = requireNonNull(dockerFiles, "dockerFiles is null");
this.portBinder = requireNonNull(portBinder, "portBinder is null");
}
Expand All @@ -54,7 +51,7 @@ protected EnvSinglenodeCassandra(DockerFiles dockerFiles, PortBinder portBinder,
public void extendEnvironment(Environment.Builder builder)
{
builder.addContainer(createCassandra());
builder.addConnector("cassandra", forHostPath(dockerFiles.getDockerFilesHostPath("conf/environment/singlenode-cassandra/cassandra.properties")));
builder.addConnector("cassandra", forHostPath(dockerFiles.getDockerFilesHostPath("conf/environment/multinode-cassandra/cassandra.properties")));
}

private DockerContainer createCassandra()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import io.trino.tests.product.launcher.env.DockerContainer;
import io.trino.tests.product.launcher.env.Environment;
import io.trino.tests.product.launcher.env.EnvironmentProvider;
import io.trino.tests.product.launcher.env.common.Standard;
import io.trino.tests.product.launcher.env.common.StandardMultinode;
import io.trino.tests.product.launcher.env.common.TestsEnvironment;
import io.trino.tests.product.launcher.testcontainers.PortBinder;
import org.testcontainers.containers.startupcheck.IsRunningStartupCheckStrategy;
Expand All @@ -30,7 +30,7 @@
import static org.testcontainers.utility.MountableFile.forHostPath;

@TestsEnvironment
public final class EnvSinglenodeMysql
public final class EnvMultinodeMysql
extends EnvironmentProvider
{
// Use non-default MySQL port to avoid conflicts with locally installed MySQL if any.
Expand All @@ -40,17 +40,17 @@ public final class EnvSinglenodeMysql
private final PortBinder portBinder;

@Inject
public EnvSinglenodeMysql(Standard standard, DockerFiles dockerFiles, PortBinder portBinder)
public EnvMultinodeMysql(StandardMultinode standardMultinode, DockerFiles dockerFiles, PortBinder portBinder)
{
super(ImmutableList.of(standard));
super(ImmutableList.of(standardMultinode));
this.dockerFiles = requireNonNull(dockerFiles, "dockerFiles is null");
this.portBinder = requireNonNull(portBinder, "portBinder is null");
}

@Override
public void extendEnvironment(Environment.Builder builder)
{
builder.addConnector("mysql", forHostPath(dockerFiles.getDockerFilesHostPath("conf/environment/singlenode-mysql/mysql.properties")));
builder.addConnector("mysql", forHostPath(dockerFiles.getDockerFilesHostPath("conf/environment/multinode-mysql/mysql.properties")));
builder.addContainer(createMySql());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import io.trino.tests.product.launcher.env.DockerContainer;
import io.trino.tests.product.launcher.env.Environment;
import io.trino.tests.product.launcher.env.EnvironmentProvider;
import io.trino.tests.product.launcher.env.common.Standard;
import io.trino.tests.product.launcher.env.common.StandardMultinode;
import io.trino.tests.product.launcher.env.common.TestsEnvironment;
import io.trino.tests.product.launcher.testcontainers.PortBinder;
import org.testcontainers.containers.startupcheck.IsRunningStartupCheckStrategy;
Expand All @@ -31,7 +31,7 @@
import static org.testcontainers.utility.MountableFile.forHostPath;

@TestsEnvironment
public final class EnvSinglenodePostgresql
public final class EnvMultinodePostgresql
extends EnvironmentProvider
{
// Use non-default PostgreSQL port to avoid conflicts with locally installed PostgreSQL if any.
Expand All @@ -41,9 +41,9 @@ public final class EnvSinglenodePostgresql
private final PortBinder portBinder;

@Inject
public EnvSinglenodePostgresql(Standard standard, DockerFiles dockerFiles, PortBinder portBinder)
public EnvMultinodePostgresql(StandardMultinode standardMultinode, DockerFiles dockerFiles, PortBinder portBinder)
{
super(ImmutableList.of(standard));
super(ImmutableList.of(standardMultinode));
this.dockerFiles = requireNonNull(dockerFiles, "dockerFiles is null");
this.portBinder = requireNonNull(portBinder, "portBinder is null");
}
Expand All @@ -53,7 +53,7 @@ public void extendEnvironment(Environment.Builder builder)
{
builder.addConnector(
"postgresql",
forHostPath(dockerFiles.getDockerFilesHostPath("conf/environment/singlenode-postgresql/postgresql.properties")));
forHostPath(dockerFiles.getDockerFilesHostPath("conf/environment/multinode-postgresql/postgresql.properties")));
builder.addContainer(createPostgreSql());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import io.trino.tests.product.launcher.env.DockerContainer;
import io.trino.tests.product.launcher.env.Environment;
import io.trino.tests.product.launcher.env.EnvironmentProvider;
import io.trino.tests.product.launcher.env.common.Standard;
import io.trino.tests.product.launcher.env.common.StandardMultinode;
import io.trino.tests.product.launcher.env.common.TestsEnvironment;
import io.trino.tests.product.launcher.testcontainers.PortBinder;
import org.testcontainers.containers.startupcheck.IsRunningStartupCheckStrategy;
Expand All @@ -31,7 +31,7 @@
import static org.testcontainers.utility.MountableFile.forHostPath;

@TestsEnvironment
public final class EnvSinglenodeSqlserver
public final class EnvMultinodeSqlserver
extends EnvironmentProvider
{
public static final int SQLSERVER_PORT = 1433;
Expand All @@ -40,17 +40,17 @@ public final class EnvSinglenodeSqlserver
private final PortBinder portBinder;

@Inject
public EnvSinglenodeSqlserver(Standard standard, DockerFiles dockerFiles, PortBinder portBinder)
public EnvMultinodeSqlserver(StandardMultinode standardMultinode, DockerFiles dockerFiles, PortBinder portBinder)
{
super(ImmutableList.of(standard));
super(ImmutableList.of(standardMultinode));
this.dockerFiles = requireNonNull(dockerFiles, "dockerFiles is null");
this.portBinder = requireNonNull(portBinder, "portBinder is null");
}

@Override
public void extendEnvironment(Environment.Builder builder)
{
builder.addConnector("sqlserver", forHostPath(dockerFiles.getDockerFilesHostPath("conf/environment/singlenode-sqlserver/sqlserver.properties")));
builder.addConnector("sqlserver", forHostPath(dockerFiles.getDockerFilesHostPath("conf/environment/multinode-sqlserver/sqlserver.properties")));
builder.addContainer(createSqlServer());
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at product tests README.md if there are no references to this env.

import com.google.common.collect.ImmutableList;
import io.trino.tests.product.launcher.env.EnvironmentConfig;
import io.trino.tests.product.launcher.env.environment.EnvSinglenode;
import io.trino.tests.product.launcher.env.environment.EnvMultinode;
import io.trino.tests.product.launcher.env.environment.EnvSinglenodeHdfsImpersonation;
import io.trino.tests.product.launcher.env.environment.EnvSinglenodeKerberosHdfsImpersonation;
import io.trino.tests.product.launcher.env.environment.EnvSinglenodeKerberosHdfsNoImpersonation;
Expand All @@ -34,7 +34,7 @@ public class Suite2
public List<SuiteTestRun> getTestRuns(EnvironmentConfig config)
{
return ImmutableList.of(
testOnEnvironment(EnvSinglenode.class)
testOnEnvironment(EnvMultinode.class)
.withGroups("configured_features", "hdfs_no_impersonation")
.build(),
testOnEnvironment(EnvSinglenodeKerberosHdfsNoImpersonation.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import io.trino.tests.product.launcher.env.EnvironmentConfig;
import io.trino.tests.product.launcher.env.EnvironmentDefaults;
import io.trino.tests.product.launcher.env.environment.EnvMultinodeKerberosKudu;
import io.trino.tests.product.launcher.env.environment.EnvMultinodePostgresql;
import io.trino.tests.product.launcher.env.environment.EnvMultinodeSqlserver;
import io.trino.tests.product.launcher.env.environment.EnvSinglenodeKerberosHdfsImpersonationCrossRealm;
import io.trino.tests.product.launcher.env.environment.EnvSinglenodePostgresql;
import io.trino.tests.product.launcher.env.environment.EnvSinglenodeSparkHive;
import io.trino.tests.product.launcher.env.environment.EnvSinglenodeSqlserver;
import io.trino.tests.product.launcher.env.environment.EnvTwoKerberosHives;
import io.trino.tests.product.launcher.env.environment.EnvTwoMixedHives;
import io.trino.tests.product.launcher.suite.Suite;
Expand All @@ -40,10 +40,10 @@ public List<SuiteTestRun> getTestRuns(EnvironmentConfig config)
verify(config.getHadoopBaseImage().equals(EnvironmentDefaults.HADOOP_BASE_IMAGE), "The suite should be run with default HADOOP_BASE_IMAGE. Leave HADOOP_BASE_IMAGE unset.");

return ImmutableList.of(
testOnEnvironment(EnvSinglenodePostgresql.class)
testOnEnvironment(EnvMultinodePostgresql.class)
.withGroups("configured_features", "postgresql")
.build(),
testOnEnvironment(EnvSinglenodeSqlserver.class)
testOnEnvironment(EnvMultinodeSqlserver.class)
.withGroups("configured_features", "sqlserver")
.build(),
testOnEnvironment(EnvSinglenodeSparkHive.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import com.google.common.collect.ImmutableList;
import io.trino.tests.product.launcher.env.EnvironmentConfig;
import io.trino.tests.product.launcher.env.environment.EnvSinglenodeCassandra;
import io.trino.tests.product.launcher.env.environment.EnvMultinodeCassandra;
import io.trino.tests.product.launcher.suite.Suite;
import io.trino.tests.product.launcher.suite.SuiteTestRun;

Expand All @@ -30,7 +30,7 @@ public class SuiteCassandra
public List<SuiteTestRun> getTestRuns(EnvironmentConfig config)
{
return ImmutableList.of(
testOnEnvironment(EnvSinglenodeCassandra.class)
testOnEnvironment(EnvMultinodeCassandra.class)
.withGroups("configured_features", "cassandra")
.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import com.google.common.collect.ImmutableList;
import io.trino.tests.product.launcher.env.EnvironmentConfig;
import io.trino.tests.product.launcher.env.environment.EnvSinglenode;
import io.trino.tests.product.launcher.env.environment.EnvMultinode;
import io.trino.tests.product.launcher.suite.Suite;
import io.trino.tests.product.launcher.suite.SuiteTestRun;

Expand All @@ -30,7 +30,7 @@ public class SuiteHmsOnly
public List<SuiteTestRun> getTestRuns(EnvironmentConfig config)
{
return ImmutableList.of(
testOnEnvironment(EnvSinglenode.class)
testOnEnvironment(EnvMultinode.class)
.withGroups("configured_features", "hms_only")
.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.google.common.collect.ImmutableList;
import io.trino.tests.product.launcher.env.EnvironmentConfig;
import io.trino.tests.product.launcher.env.environment.EnvMultinodeMariadb;
import io.trino.tests.product.launcher.env.environment.EnvSinglenodeMysql;
import io.trino.tests.product.launcher.env.environment.EnvMultinodeMysql;
import io.trino.tests.product.launcher.suite.Suite;
import io.trino.tests.product.launcher.suite.SuiteTestRun;

Expand All @@ -31,7 +31,7 @@ public class SuiteMysql
public List<SuiteTestRun> getTestRuns(EnvironmentConfig config)
{
return ImmutableList.of(
testOnEnvironment(EnvSinglenodeMysql.class)
testOnEnvironment(EnvMultinodeMysql.class)
.withGroups("configured_features", "mysql")
.build(),
testOnEnvironment(EnvMultinodeMariadb.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import com.google.common.collect.ImmutableList;
import io.trino.tests.product.launcher.env.EnvironmentConfig;
import io.trino.tests.product.launcher.env.environment.EnvSinglenode;
import io.trino.tests.product.launcher.env.environment.EnvMultinode;
import io.trino.tests.product.launcher.suite.Suite;
import io.trino.tests.product.launcher.suite.SuiteTestRun;

Expand All @@ -30,7 +30,7 @@ public class SuiteStorageFormatsDetailed
public List<SuiteTestRun> getTestRuns(EnvironmentConfig config)
{
return ImmutableList.of(
testOnEnvironment(EnvSinglenode.class)
testOnEnvironment(EnvMultinode.class)
.withGroups("configured_features", "storage_formats_detailed", "hive_compression")
.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.tests.product.launcher.env;

import io.trino.tests.product.launcher.env.environment.EnvSinglenodeSqlserver;
import io.trino.tests.product.launcher.env.environment.EnvMultinodeSqlserver;
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;
Expand All @@ -38,7 +38,7 @@ public void testCanonicalEnvironmentName()
assertThat(canonicalEnvironmentName("DuzaAla")).isEqualTo("duza-ala");
assertThat(canonicalEnvironmentName("EnvDuzaAla")).isEqualTo("duza-ala");
// real life example
assertThat(canonicalEnvironmentName(EnvSinglenodeSqlserver.class.getSimpleName())).isEqualTo("singlenode-sqlserver");
assertThat(canonicalEnvironmentName(EnvMultinodeSqlserver.class.getSimpleName())).isEqualTo("multinode-sqlserver");

// document current state; this behavior is neither intentional or (currently) forbidden
assertThat(canonicalEnvironmentName("duza----Ala")).isEqualTo("duza-ala");
Expand Down
15 changes: 6 additions & 9 deletions testing/trino-product-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ testing/bin/ptl test run --environment <environment> \
connections on the HTTPS port (7778), and both coordinator and worker traffic
is encrypted and kerberized. For multinode-tls-kerberos, the default configuration
is 1 coordinator and 2 workers.
- **singlenode** - pseudo-distributed Hadoop installation running on a
single Docker container and a single node installation of Trino also running
on a single Docker container.
- **singlenode-hdfs-impersonation** - HDFS impersonation enabled on top of the
environment in singlenode profile. Trino impersonates the user
who is running the query when accessing HDFS.
Expand Down Expand Up @@ -169,12 +166,12 @@ Following table describes the profile specific test categories, the correspondin
test group names and the profile(s) which must be used to run tests in those test
groups.

| Tests | Test Group | Profiles |
| ----------------------|---------------------------| -------------------------------------------------------------------------------- |
| Authorization | ``authorization`` | ``singlenode-kerberos-hdfs-impersonation`` |
| HDFS impersonation | ``hdfs_impersonation`` | ``singlenode-hdfs-impersonation``, ``singlenode-kerberos-hdfs-impersonation`` |
| No HDFS impersonation | ``hdfs_no_impersonation`` | ``singlenode``, ``singlenode-kerberos-hdfs-no_impersonation`` |
| LDAP | ``ldap`` | ``singlenode-ldap`` |
| Tests | Test Group | Profiles |
| ----------------------|---------------------------|-------------------------------------------------------------------------------|
| Authorization | ``authorization`` | ``singlenode-kerberos-hdfs-impersonation`` |
| HDFS impersonation | ``hdfs_impersonation`` | ``singlenode-hdfs-impersonation``, ``singlenode-kerberos-hdfs-impersonation`` |
| No HDFS impersonation | ``hdfs_no_impersonation`` | ``multinode``, ``singlenode-kerberos-hdfs-no_impersonation`` |
| LDAP | ``ldap`` | ``singlenode-ldap`` |

Below is a list of commands that explain how to run these profile specific tests
and also the entire test suite:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public void testDynamicFilteringStats()
assertThat(onTrino().executeQuery(format("SELECT COUNT(*) FROM mysql.%s a JOIN tpch.tiny.nation b ON a.nationkey = b.nationkey AND b.name = 'INDIA'", TABLE_NAME)))
.containsOnly(row(1));

assertThat(onTrino().executeQuery("SELECT \"completeddynamicfilters.totalcount\" FROM jmx.current.\"io.trino.plugin.jdbc:name=mysql,type=dynamicfilteringstats\""))
assertThat(onTrino().executeQuery("SELECT \"completeddynamicfilters.totalcount\" FROM jmx.current.\"io.trino.plugin.jdbc:name=mysql,type=dynamicfilteringstats\" WHERE node = 'presto-master'"))
.containsOnly(row(1));
assertThat(onTrino().executeQuery("SELECT \"totaldynamicfilters.totalcount\" FROM jmx.current.\"io.trino.plugin.jdbc:name=mysql,type=dynamicfilteringstats\""))
assertThat(onTrino().executeQuery("SELECT \"totaldynamicfilters.totalcount\" FROM jmx.current.\"io.trino.plugin.jdbc:name=mysql,type=dynamicfilteringstats\" WHERE node = 'presto-master'"))
.containsOnly(row(1));
}
}
Loading