Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge DistributedQueries and Smoke test class in MySQL connector #7011

Merged
merged 5 commits into from
Feb 25, 2021

Conversation

losipiuk
Copy link
Member

TestMySqlDistributedQueries is merged in into
BaseMySqlIntegrationSmokeTest which is renamed to BaseMySqlConnectorTest.
The subclasses are renamed to match new naming pattern.

@cla-bot cla-bot bot added the cla-signed label Feb 23, 2021
@losipiuk losipiuk requested a review from findepi February 23, 2021 21:01
@findepi findepi changed the title Merge DistributedQueries and Smoke test class in MySql connector Merge DistributedQueries and Smoke test class in MySQL connector Feb 24, 2021
@losipiuk
Copy link
Member Author

ac

@losipiuk
Copy link
Member Author

Needed to fix testShowTables*

MaterializedResult result = computeActual("SHOW TABLES");
assertThat(result.getOnlyColumnAsSet()).containsAll(expectedTables);
assertThat(result.getOnlyColumnAsSet()).containsAll(createdTpchTables());
Copy link
Member

Choose a reason for hiding this comment

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

Don't expose this. Simpliy enumerat those tables, which are required by other test methods. this is sufficient from this test perspective

{
protected static final List<TpchTable<?>> TPCH_TABLES = ImmutableList.of(CUSTOMER, NATION, ORDERS, REGION, LINE_ITEM);
Copy link
Member

Choose a reason for hiding this comment

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

This can be defined on BaseConnectorTest level and named like REQUIRED_TPCH_TABLES

Copy link
Member Author

Choose a reason for hiding this comment

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

I defined it in AbstractTestQueries.java . Can be moved to BaseConnectorTest when we will be removing ATQ

@losipiuk losipiuk force-pushed the lo/mysql-base-test branch 2 times, most recently from 6189a98 to 601e35c Compare February 24, 2021 13:43
@losipiuk
Copy link
Member Author

@findepi PTAL

Comment on lines 66 to 68
if (createTpchTables) {
tables = TpchTable.getTables();
}
Copy link
Member

Choose a reason for hiding this comment

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

same here -- one should pass in empty list of tables instead.

Copy link
Member

Choose a reason for hiding this comment

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

if many places to update -- just add a TODO note in the code

@@ -49,6 +50,12 @@ private PhoenixQueryRunner()

public static DistributedQueryRunner createPhoenixQueryRunner(TestingPhoenixServer server, Map<String, String> extraProperties)
throws Exception
{
Copy link
Member

Choose a reason for hiding this comment

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

can we remove this overload? how many places?

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

@losipiuk losipiuk force-pushed the lo/mysql-base-test branch 2 times, most recently from e92d2d9 to 573e9ab Compare February 24, 2021 14:05
public static DistributedQueryRunner createRaptorQueryRunner(
Map<String, String> extraProperties,
boolean loadTpch,
Copy link
Member

Choose a reason for hiding this comment

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

❤️

}

public static DistributedQueryRunner createIcebergQueryRunner(Map<String, String> extraProperties, FileFormat format, boolean createTpchTables)
Copy link
Member

Choose a reason for hiding this comment

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

thank you!

Copy link
Member

@kokosing kokosing left a comment

Choose a reason for hiding this comment

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

Skimmed. ACK.

// TODO extend BaseConnectorTest
extends AbstractTestIntegrationSmokeTest
abstract class BaseMySqlConnectorTest
// TODO(https://github.com/trinodb/trino/issues/7019) define shorter tests set that exercises various read and write scenarios (a.k.a. "a smoke test")
Copy link
Member

Choose a reason for hiding this comment

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

TODO is in the wrong place. You need one full test suite and one smoke test for TestGlobalTransactionMySqlConnectorTest.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh - I guess I read the intention wrongly, and assumed we want both smoke and full tests, so we can run this or this depending on the situation.

TestMySqlDistributedQueries is merged in into
BaseMySqlIntegrationSmokeTest which is renamed to BaseMySqlConnectorTest.
The subclasses are renamed to match new naming pattern.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants