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

KAFKA-10447: Migrate tools module to JUnit 5 and mockito #9231

Merged
merged 1 commit into from Sep 10, 2020

Conversation

ijuma
Copy link
Contributor

@ijuma ijuma commented Aug 30, 2020

This change sets the groundwork for migrating other modules incrementally.

Main changes:

  • Replace junit 4.13 with junit-jupiter and junit-vintage 5.7.0-RC1.
  • All modules except for tools depend on junit-vintage.
  • tools depends on junit-jupiter.
  • Convert tools tests to JUnit 5.
  • Update PushHttpMetricsReporterTest to use mockito instead of powermock and easymock
    (powermock doesn't seem to work well with JUnit 5 and we don't need it since mockito can mock
    static methods).
  • Update mockito to 3.5.7.
  • Update TestUtils to use JUnit 5 assertions since tools depends on it.

Unrelated clean-ups:

  • Remove unit from package names in a few core tests.
  • Replace try/catch/fail with assertThrows in a number of places.
  • Tag CoordinatorTest as integration test.
  • Remove unnecessary type parameters when invoking methods and constructors.

Tested with IntelliJ and gradle. Verified that the following commands work as expected:

  • ./gradlew tools:unitTest
  • ./gradlew tools:integrationTest
  • ./gradlew tools:test
  • ./gradlew core:unitTest
  • ./gradlew core:integrationTest
  • ./gradlew clients:test

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@ijuma ijuma changed the title KAFKA-10447: Migrate tools module to JUnit 5 KAFKA-10447: Migrate tools module to JUnit 5 and mockito Aug 30, 2020

@Tag("integration")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is much slower than the rest in tools, so I think it makes sense to mark it as integration.

@ijuma
Copy link
Contributor Author

ijuma commented Sep 8, 2020

Unrelated flaky failures:

Build / JDK 15 / kafka.network.DynamicConnectionQuotaTest.testDynamicListenerConnectionCreationRateQuota
Build / JDK 8 / kafka.api.PlaintextAdminIntegrationTest.testConsumerGroups
Build / JDK 8 / org.apache.kafka.streams.integration.EosBetaUpgradeIntegrationTest.shouldUpgradeFromEosAlphaToEosBeta[true]

Copy link
Contributor

@omkreddy omkreddy left a comment

Choose a reason for hiding this comment

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

@ijuma Thanks for the PR. LGTM.

@ijuma
Copy link
Contributor Author

ijuma commented Sep 10, 2020

Rebased to fix a trivial conflict. JDK 11 and JDK 8 builds passed, JDK 15 failed with 2 unrelated flaky test failures:

kafka.network.DynamicConnectionQuotaTest.testDynamicListenerConnectionCreationRateQuota
kafka.network.DynamicConnectionQuotaTest.testDynamicListenerConnectionCreationRateQuota
kafka.server.DynamicBrokerConfigTest.testPasswordConfigEncoderSecretChange

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