Skip to content

Switch ensureTestNamingConvention to run in JUnit to reduce test setups#19329

Merged
findepi merged 1 commit intotrinodb:masterfrom
findepi:findepi/switch-ensuretestnamingconvention-to-run-in-junit-to-reduce-test-setups-40a721
Oct 10, 2023
Merged

Switch ensureTestNamingConvention to run in JUnit to reduce test setups#19329
findepi merged 1 commit intotrinodb:masterfrom
findepi:findepi/switch-ensuretestnamingconvention-to-run-in-junit-to-reduce-test-setups-40a721

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Oct 10, 2023

For many test classes, this it the last method that is not converted. For example, running TestInformationSchemaConnector with TestNG will run only this method. Moving this will make tests like TestInformationSchemaConnector JUnit-only and improve test overall time (fewer createQueryRunner invocations).

Obviously, it can be the first JUnit test method for some other classes, but

  • the train cannot be stopped. We do this sooner or later.
  • AbstractTestQueries are already JUnit; BaseConnectorTest extends from AbstractTestQueries and BaseConnectorTest are most likely to most expensive setups, because they create dependant services.

For many test classes, this it the last method that is not converted.
For example, running `TestInformationSchemaConnector` with TestNG will
run only this method. Moving this will make tests like
`TestInformationSchemaConnector` JUnit-only and improve test overall
time (fewer `createQueryRunner` invocations).

Obviously, it can be the first JUnit test method for some other classes,
but

- the train cannot be stopped. We do this sooner or later.
- `AbstractTestQueries` are already JUnit; `BaseConnectorTest` extends
  from `AbstractTestQueries` and `BaseConnectorTest` are most likely to
most expensive setups, because they create dependant services.
Copy link
Copy Markdown
Contributor

@findinpath findinpath left a comment

Choose a reason for hiding this comment

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

Tested with

./mvnw -Dtest=io.trino.plugin.deltalake.TestDeltaLakeCreateTableInternalRetry test -pl :trino-delta-lake

and indeed there are no more testng tests (neither the setup overhead) now executed.

@findepi findepi merged commit 6858091 into trinodb:master Oct 10, 2023
@findepi findepi deleted the findepi/switch-ensuretestnamingconvention-to-run-in-junit-to-reduce-test-setups-40a721 branch October 10, 2023 12:27
@github-actions github-actions bot added this to the 429 milestone Oct 10, 2023
@findepi
Copy link
Copy Markdown
Member Author

findepi commented Oct 13, 2023

This had to be reverted, so here it comes again -- #19400

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.

5 participants