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-16550: add integration test for LogDirsCommand #16485

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

FrankYang0529
Copy link
Member

Add integration test cases for LogDirsCommand:

  • testLogDirsWithoutBrokers
  • testLogDirsWithBrokers
  • testLogDirsWithNonExistentTopic
  • testLogDirsWithSpecificTopic

Committer Checklist (excluded from commit message)

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

Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@FrankYang0529 thanks for this patch

}

@ClusterTest
public void testLogDirsWithSpecificTopic(ClusterInstance clusterInstance) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add test to verify that it returns only the specific topic will get returned? for example, you can create another topic before testing.

// check all log dirs and topic partitions are present
Map<Integer, Map<String, LogDirDescription>> logDirs = assertDoesNotThrow(() -> admin.describeLogDirs(clusterInstance.brokerIds()).allDescriptions().get());
assertFalse(logDirs.isEmpty());
logDirs.forEach((brokerId, logDirInfo) -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove {}

// check log dir and topic partition are present
Map<Integer, Map<String, LogDirDescription>> logDirs = assertDoesNotThrow(() -> admin.describeLogDirs(Collections.singleton(brokerId)).allDescriptions().get());
assertEquals(1, logDirs.size());
logDirs.forEach((brokerIdValue, logDirInfo) -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove {}

// check log dir is present, but topic partition is not
Map<Integer, Map<String, LogDirDescription>> logDirs = assertDoesNotThrow(() -> admin.describeLogDirs(clusterInstance.brokerIds()).allDescriptions().get());
assertFalse(logDirs.isEmpty());
logDirs.forEach((brokerId, logDirInfo) -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove {}

@FrankYang0529
Copy link
Member Author

Hi @chia7712, I address all comments. Could you take a look again? Thank you.

Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

LGTM

@chia7712 chia7712 merged commit 601659f into apache:trunk Jul 2, 2024
1 check failed
@FrankYang0529 FrankYang0529 deleted the KAFKA-16550 branch July 3, 2024 00:08
chirag-wadhwa5 pushed a commit to chirag-wadhwa5/kafka that referenced this pull request Jul 3, 2024
abhi-ksolves pushed a commit to ksolves/kafka that referenced this pull request Jul 31, 2024
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.

3 participants