Skip to content

Commit

Permalink
Change latest connector test to smoke test in MariaDB
Browse files Browse the repository at this point in the history
Also, update the docker image versions.
  • Loading branch information
ebyhr committed Nov 22, 2023
1 parent 98f82c2 commit c2fb0c6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 40 deletions.
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/connector/mariadb.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ database.

To connect to MariaDB, you need:

- MariaDB version 10.2 or higher.
- MariaDB version 10.10 or higher.
- Network access from the Trino coordinator and workers to MariaDB. Port
3306 is the default port.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
import com.google.common.collect.ImmutableMap;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.SqlExecutor;
import org.junit.jupiter.api.Test;

import static io.trino.plugin.mariadb.MariaDbQueryRunner.createMariaDbQueryRunner;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

public class TestMariaDbConnectorTest
extends BaseMariaDbConnectorTest
Expand All @@ -37,30 +35,4 @@ protected SqlExecutor onRemoteDatabase()
{
return server::execute;
}

@Test
@Override
public void testRenameColumn()
{
assertThatThrownBy(super::testRenameColumn)
.hasMessageContaining("Rename column not supported for the MariaDB server version");
}

@Test
@Override
public void testRenameColumnName()
{
for (String columnName : testColumnNameDataProvider()) {
assertThatThrownBy(() -> testRenameColumnName(columnName, requiresDelimiting(columnName)))
.hasMessageContaining("Rename column not supported for the MariaDB server version");
}
}

@Test
@Override
public void testAlterTableRenameColumnToLongName()
{
assertThatThrownBy(super::testAlterTableRenameColumnToLongName)
.hasMessageContaining("Rename column not supported for the MariaDB server version");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,30 @@
package io.trino.plugin.mariadb;

import com.google.common.collect.ImmutableMap;
import io.trino.plugin.jdbc.BaseJdbcConnectorSmokeTest;
import io.trino.testing.QueryRunner;
import io.trino.testing.sql.SqlExecutor;
import io.trino.testing.TestingConnectorBehavior;

import static io.trino.plugin.mariadb.MariaDbQueryRunner.createMariaDbQueryRunner;
import static io.trino.plugin.mariadb.TestingMariaDbServer.LATEST_VERSION;

public class TestMariaDbLatestConnectorTest
extends BaseMariaDbConnectorTest
public class TestMariaDbLatestConnectorSmokeTest
extends BaseJdbcConnectorSmokeTest
{
@Override
protected QueryRunner createQueryRunner()
throws Exception
protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)
{
server = closeAfterClass(new TestingMariaDbServer(LATEST_VERSION));
return createMariaDbQueryRunner(server, ImmutableMap.of(), ImmutableMap.of(), REQUIRED_TPCH_TABLES);
return switch (connectorBehavior) {
case SUPPORTS_RENAME_SCHEMA -> false;
default -> super.hasBehavior(connectorBehavior);
};
}

@Override
protected SqlExecutor onRemoteDatabase()
protected QueryRunner createQueryRunner()
throws Exception
{
return server::execute;
TestingMariaDbServer server = closeAfterClass(new TestingMariaDbServer(LATEST_VERSION));
return createMariaDbQueryRunner(server, ImmutableMap.of(), ImmutableMap.of(), REQUIRED_TPCH_TABLES);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
public class TestingMariaDbServer
implements AutoCloseable
{
public static final String LATEST_VERSION = "10.7.1";
public static final String DEFAULT_VERSION = "10.2";
public static final String LATEST_VERSION = "11.1.3";
public static final String DEFAULT_VERSION = "10.10";
private static final int MARIADB_PORT = 3306;

private final MariaDBContainer<?> container;
Expand Down

0 comments on commit c2fb0c6

Please sign in to comment.