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

Use tracing for testing ConnectorMetadata invocations #18587

Conversation

findepi
Copy link
Member

@findepi findepi commented Aug 8, 2023

This refactors TestInformationSchemaConnector.testMetadataCalls to
leverage TracingConnectorMetadata instead of manually performed counts
within CountingMockConnector. Among other things this exposes listViews` calls which were previously not counted.

The differences in expected counts in the test come from the fact how
the counting was done previously. For example
MockConnectorMetadata.listTables calls listSchemaNames before
listTables, so this single metadata call was being recorded as both
listSchemaNames and listTables (zero or more times).

Extracted from #18586

@cla-bot cla-bot bot added the cla-signed label Aug 8, 2023
@findepi findepi force-pushed the findepi/use-tracing-for-testing-connectormetadata-invocations-d26020 branch 3 times, most recently from e307447 to 8b6f7fd Compare August 8, 2023 15:16
@findepi findepi added test no-release-notes This pull request does not require release notes entry labels Aug 8, 2023
@findepi findepi force-pushed the findepi/use-tracing-for-testing-connectormetadata-invocations-d26020 branch from 8b6f7fd to 2d2c9e7 Compare August 8, 2023 15:41
findepi added 2 commits August 8, 2023 17:56
It was returning success for things that were not supposed to exist
according to schema/table listing.
This refactors `TestInformationSchemaConnector.testMetadataCalls` to
leverage `TracingConnectorMetadata` instead of manually performed counts
within `CountingMockConnector. Among other things this exposes
`listViews` calls which were previously not counted.

The differences in expected counts in the test come from the fact how
the counting was done previously. For example
`MockConnectorMetadata.listTables` calls `listSchemaNames` before
`listTables`, so this single metadata call was being recorded as both
`listSchemaNames` and `listTables` (zero or more times).
@findepi findepi force-pushed the findepi/use-tracing-for-testing-connectormetadata-invocations-d26020 branch from 2d2c9e7 to 0c117f5 Compare August 8, 2023 15:59
@github-actions github-actions bot added the jdbc Relates to Trino JDBC driver label Aug 8, 2023
@findepi findepi merged commit bdc2799 into trinodb:master Aug 9, 2023
@findepi findepi deleted the findepi/use-tracing-for-testing-connectormetadata-invocations-d26020 branch August 9, 2023 05:15
@github-actions github-actions bot added this to the 423 milestone Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed jdbc Relates to Trino JDBC driver no-release-notes This pull request does not require release notes entry test
Development

Successfully merging this pull request may close these issues.

5 participants