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: use testFixtures sourceset instead of depending on all the test classes #5975

Merged
merged 1 commit into from Jun 8, 2023

Conversation

vlsi
Copy link
Collaborator

@vlsi vlsi commented Jun 8, 2023

Motivation and Context

This change enables cleaner separation between "actual tests" and "support classes for the tests".

For instance, :src:core might provide dummy samplers like ThreadSleep for testing purposes.
ThreadSleep would depend on src/test/main (since it would extend AbstractSampler), and other modules (e.g. tests in :src:protocols:http) might need that ThreadSleep sampler.

It won't be practical to create core-testkit modules for every module, so we move those reusable test classes to testFixtures/... source set.

See https://docs.gradle.org/current/userguide/java_testing.html#sec:java_test_fixtures

@vlsi vlsi added the chore label Jun 8, 2023
@vlsi vlsi added this to the 5.6 milestone Jun 8, 2023
@vlsi vlsi force-pushed the testfixtures branch 2 times, most recently from 5a692dd to 15c8bc2 Compare June 8, 2023 10:13
…t classes

This change enables cleaner separation between "actual tests" and "support classes for the tests".

For instance, `:src:core` might provide dummy samplers like `ThreadSleep` for testing purposes.
`ThreadSleep` would depend on `src/test/main` (since it would `extend AbstractSampler`),
 and other modules (e.g. tests in `:src:protocols:http`) might need that `ThreadSleep` sampler.

It won't be practical to create `core-testkit` modules for every module,
so we move those reusable test classes to `testFixtures/...` source set.

See https://docs.gradle.org/current/userguide/java_testing.html#sec:java_test_fixtures
@vlsi vlsi force-pushed the testfixtures branch 3 times, most recently from eb60144 to cabc3fb Compare June 8, 2023 12:03
@vlsi vlsi merged commit cabc3fb into apache:master Jun 8, 2023
9 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant