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

chore: add new integration tests to ensure topology query doesn't change #910

Open
wants to merge 43 commits into
base: main
Choose a base branch
from

Conversation

jasonli-improving
Copy link
Contributor

Summary

Add integration tests to check for timestamp and types in the return values of topology queries

Description

  • Add function to update cluster certification
  • Add integration tests to test Aurora topology query types/timestamps
  • Add RdsMultiAz type test (disabled due to not being supported yet)

Additional Reviewers

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

LOGGER.finest("Connecting to " + url);

String query = null;
if (TestEnvironment.getCurrent().getCurrentDriver() == TestDriver.PG) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What's about MariaDb? Is it supported by the test?

Copy link
Contributor

@jasonlamz jasonlamz Mar 13, 2024

Choose a reason for hiding this comment

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

Supported

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean I don't see a branch of the code that handle the case with mariaDb. I see AuroraMysql and AuroraPG.

Comment on lines +189 to +192
final Connection conn = DriverManager.getConnection(url, props);
assertTrue(conn.isValid(5));
Statement stmt = conn.createStatement();
stmt.executeQuery(query);
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment for the other locations.

DriverHelper.setConnectTimeout(testDriver, props, 10, TimeUnit.SECONDS);
DriverHelper.setSocketTimeout(testDriver, props, 10, TimeUnit.SECONDS);

String url =
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please add the final keyword to all your constant local variables?
Also you can just call ConnectionStringHelper.getWrapperUrl() here.

Comment on lines +99 to +102
if (TestEnvironment.getCurrent().getCurrentDriver() == TestDriver.MARIADB
&& TestEnvironment.getCurrent().getInfo().getRequest().getDatabaseEngine() == DatabaseEngine.MYSQL) {
props.setProperty("permitMysqlScheme", "1");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

getWrapperUrl should already be appending permitMysqlScheme to the wrapper url, why is this if-clause required?

LOGGER.finest("Connecting to " + url);

if (TestEnvironment.getCurrent().getCurrentDriver() == TestDriver.PG) {
AuroraPgDialect dialect = new AuroraPgDialect();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could move this if-else to the beginning of the test after List<String> expectedTypes;, before establishing a connection, since you don't need any connections here and you are just setting up for the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants