Skip to content

Commit

Permalink
Migrate TestSystemConnector to integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Oct 7, 2024
1 parent 012cd02 commit f770c9b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 124 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import static io.trino.testing.MultisetAssertions.assertMultisetsEqual;
import static io.trino.testing.TestingSession.testSessionBuilder;
import static java.util.stream.Collectors.joining;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;

@Execution(SAME_THREAD) // CountingMockConnector is shared mutable state
Expand Down Expand Up @@ -72,6 +73,17 @@ protected QueryRunner createQueryRunner()
}
}

@Test
void testMetadataCatalogs()
{
assertThat(query("SELECT catalog_name, connector_id, connector_name FROM system.metadata.catalogs"))
.matches("VALUES " +
"(CAST('system' AS VARCHAR), CAST('system' AS VARCHAR), CAST('system' AS VARCHAR))," +
"(CAST('test_catalog' AS VARCHAR), CAST('test_catalog' AS VARCHAR), CAST('mock' AS VARCHAR))," +
"(CAST('broken_catalog' AS VARCHAR), CAST('broken_catalog' AS VARCHAR), CAST('failing_mock' AS VARCHAR))," +
"(CAST('tpch' AS VARCHAR), CAST('tpch' AS VARCHAR), CAST('tpch' AS VARCHAR))");
}

@Test
public void testTableCommentsMetadataCalls()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ public void testRuntimeNodes()
"('testversion', false, 'active')");
}

@Test
void testOptimizerRuleStats()
{
assertThat(query("SELECT rule_name, invocations, matches, failures FROM system.runtime.optimizer_rule_stats"))
.result().hasTypes(ImmutableList.of(VARCHAR, BIGINT, BIGINT, BIGINT));
}

@Test
public void testRuntimeQueriesTimestamps()
{
Expand Down

0 comments on commit f770c9b

Please sign in to comment.