Skip to content

Commit

Permalink
MINOR: Default test name added to core (apache#15667)
Browse files Browse the repository at this point in the history
Reviewers: Chia-Ping Tsai <[email protected]>
  • Loading branch information
nizhikov authored Apr 7, 2024
1 parent 31e8a7f commit 4b2278f
Show file tree
Hide file tree
Showing 73 changed files with 549 additions and 546 deletions.
15 changes: 15 additions & 0 deletions core/src/test/resources/junit-platform.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
junit.jupiter.params.displayname.default = "{displayName}.{argumentsWithNames}"
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package kafka.admin

import kafka.integration.KafkaServerTestHarness
import kafka.server.KafkaConfig
import kafka.utils.{TestInfoUtils, TestUtils}
import kafka.utils.TestUtils
import org.apache.kafka.clients.NodeApiVersions
import org.apache.kafka.common.message.ApiMessageType
import org.apache.kafka.common.protocol.ApiKeys
Expand Down Expand Up @@ -59,7 +59,7 @@ class BrokerApiVersionsCommandTest extends KafkaServerTestHarness {
}

@Timeout(120)
@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def checkBrokerApiVersionCommandOutput(quorum: String): Unit = {
val byteArrayOutputStream = new ByteArrayOutputStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package kafka.admin
import kafka.admin.ConfigCommand.ConfigCommandOptions
import kafka.cluster.{Broker, EndPoint}
import kafka.server.{KafkaConfig, QuorumTestHarness}
import kafka.utils.{Exit, Logging, TestInfoUtils}
import kafka.utils.{Exit, Logging}
import kafka.zk.{AdminZkClient, BrokerInfo}
import org.apache.kafka.common.config.ConfigException
import org.apache.kafka.common.network.ListenerName
Expand All @@ -35,7 +35,7 @@ import scala.jdk.CollectionConverters._

class ConfigCommandIntegrationTest extends QuorumTestHarness with Logging {

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk"))
def shouldExitWithNonZeroStatusOnUpdatingUnallowedConfigViaZk(quorum: String): Unit = {
assertNonZeroStatusExit(Array(
Expand All @@ -46,7 +46,7 @@ class ConfigCommandIntegrationTest extends QuorumTestHarness with Logging {
"--add-config", "security.inter.broker.protocol=PLAINTEXT"))
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk"))
def shouldExitWithNonZeroStatusOnZkCommandAlterUserQuota(quorum: String): Unit = {
assertNonZeroStatusExit(Array(
Expand Down Expand Up @@ -74,7 +74,7 @@ class ConfigCommandIntegrationTest extends QuorumTestHarness with Logging {
assertEquals(Some(1), exitStatus)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk"))
def testDynamicBrokerConfigUpdateUsingZooKeeper(quorum: String): Unit = {
val brokerId = "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package kafka.admin
import kafka.integration.KafkaServerTestHarness
import kafka.server.KafkaConfig
import kafka.utils.TestUtils.{createProducer, plaintextBootstrapServers}
import kafka.utils.{TestInfoUtils, TestUtils}
import kafka.utils.TestUtils
import org.apache.kafka.clients.admin._
import org.apache.kafka.clients.producer.ProducerRecord
import org.apache.kafka.common.TopicPartition
Expand Down Expand Up @@ -61,7 +61,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
super.tearDown()
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testThreeCompressedRecordsInOneBatch(quorum: String): Unit = {
produceMessagesInOneBatch("gzip")
Expand All @@ -75,7 +75,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
verifyListOffsets(topic = topicNameWithCustomConfigs, 0)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testThreeNonCompressedRecordsInOneBatch(quorum: String): Unit = {
produceMessagesInOneBatch()
Expand All @@ -90,7 +90,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
verifyListOffsets(topic = topicNameWithCustomConfigs, 0)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testThreeNonCompressedRecordsInSeparateBatch(quorum: String): Unit = {
produceMessagesInSeparateBatch()
Expand All @@ -104,7 +104,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
}

// The message conversion test only run in ZK mode because KRaft mode doesn't support "inter.broker.protocol.version" < 3.0
@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk"))
def testThreeRecordsInOneBatchWithMessageConversion(quorum: String): Unit = {
createOldMessageFormatBrokers()
Expand All @@ -120,7 +120,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
}

// The message conversion test only run in ZK mode because KRaft mode doesn't support "inter.broker.protocol.version" < 3.0
@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk"))
def testThreeRecordsInSeparateBatchWithMessageConversion(quorum: String): Unit = {
createOldMessageFormatBrokers()
Expand All @@ -135,7 +135,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
verifyListOffsets(topic = topicNameWithCustomConfigs, 2)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testThreeRecordsInOneBatchHavingDifferentCompressionTypeWithServer(quorum: String): Unit = {
val props: Properties = new Properties()
Expand All @@ -145,7 +145,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
verifyListOffsets(topic = topicNameWithCustomConfigs)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testThreeRecordsInSeparateBatchHavingDifferentCompressionTypeWithServer(quorum: String): Unit = {
val props: Properties = new Properties()
Expand All @@ -155,7 +155,7 @@ class ListOffsetsIntegrationTest extends KafkaServerTestHarness {
verifyListOffsets(topic = topicNameWithCustomConfigs)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testThreeCompressedRecordsInSeparateBatch(quorum: String): Unit = {
produceMessagesInSeparateBatch("gzip")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package kafka.admin

import kafka.api.IntegrationTestHarness
import kafka.server.KafkaConfig
import kafka.utils.{TestInfoUtils, TestUtils}
import kafka.utils.TestUtils
import org.apache.kafka.clients.admin.{AlterConfigOp, ConfigEntry}
import org.apache.kafka.common.{TopicIdPartition, TopicPartition, Uuid}
import org.apache.kafka.common.config.{ConfigException, ConfigResource, TopicConfig}
Expand Down Expand Up @@ -72,7 +72,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
testTopicName = s"${info.getTestMethod.get().getName}-${Random.alphanumeric.take(10).mkString}"
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testCreateRemoteTopicWithValidRetentionTime(quorum: String): Unit = {
val topicConfig = new Properties()
Expand All @@ -84,7 +84,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
verifyRemoteLogTopicConfigs(topicConfig)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testCreateRemoteTopicWithValidRetentionSize(quorum: String): Unit = {
val topicConfig = new Properties()
Expand All @@ -96,7 +96,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
verifyRemoteLogTopicConfigs(topicConfig)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testCreateRemoteTopicWithInheritedLocalRetentionTime(quorum: String): Unit = {
// inherited local retention ms is 1000
Expand All @@ -108,7 +108,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
verifyRemoteLogTopicConfigs(topicConfig)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testCreateRemoteTopicWithInheritedLocalRetentionSize(quorum: String): Unit = {
// inherited local retention bytes is 1024
Expand All @@ -120,7 +120,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
verifyRemoteLogTopicConfigs(topicConfig)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testCreateRemoteTopicWithInvalidRetentionTime(quorum: String): Unit = {
// inherited local retention ms is 1000
Expand All @@ -132,7 +132,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
topicConfig = topicConfig))
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testCreateRemoteTopicWithInvalidRetentionSize(quorum: String): Unit = {
// inherited local retention bytes is 1024
Expand All @@ -144,7 +144,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
topicConfig = topicConfig))
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testCreateCompactedRemoteStorage(quorum: String): Unit = {
val topicConfig = new Properties()
Expand All @@ -155,7 +155,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
topicConfig = topicConfig))
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testEnableRemoteLogOnExistingTopicTest(quorum: String): Unit = {
val admin = createAdminClient()
Expand All @@ -173,7 +173,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
verifyRemoteLogTopicConfigs(topicConfig)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testEnableRemoteLogWhenSystemRemoteStorageIsDisabled(quorum: String): Unit = {
val admin = createAdminClient()
Expand All @@ -197,7 +197,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
assertTrue(errorMessage.getMessage.contains("Tiered Storage functionality is disabled in the broker"))
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testUpdateTopicConfigWithValidRetentionTimeTest(quorum: String): Unit = {
val admin = createAdminClient()
Expand All @@ -218,7 +218,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
verifyRemoteLogTopicConfigs(topicConfig)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testUpdateTopicConfigWithValidRetentionSizeTest(quorum: String): Unit = {
val admin = createAdminClient()
Expand All @@ -239,7 +239,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
verifyRemoteLogTopicConfigs(topicConfig)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testUpdateTopicConfigWithInheritedLocalRetentionTime(quorum: String): Unit = {
val admin = createAdminClient()
Expand All @@ -259,7 +259,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
() => admin.incrementalAlterConfigs(configs).all().get())
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testUpdateTopicConfigWithInheritedLocalRetentionSize(quorum: String): Unit = {
val admin = createAdminClient()
Expand All @@ -279,7 +279,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
() => admin.incrementalAlterConfigs(configs).all().get(), "Invalid local retention size")
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testTopicDeletion(quorum: String): Unit = {
MyRemoteStorageManager.deleteSegmentEventCounter.set(0)
Expand All @@ -298,7 +298,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
"Remote log segments should be deleted only once by the leader")
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testClusterWideDisablementOfTieredStorageWithEnabledTieredTopic(quorum: String): Unit = {
val topicConfig = new Properties()
Expand All @@ -320,7 +320,7 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
}
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testClusterWithoutTieredStorageStartsSuccessfullyIfTopicWithTieringDisabled(quorum: String): Unit = {
val topicConfig = new Properties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import java.util.Properties
import kafka.integration.KafkaServerTestHarness
import kafka.server.KafkaConfig
import kafka.utils.TestUtils.assertFutureExceptionTypeEquals
import kafka.utils.{Logging, TestInfoUtils, TestUtils}
import kafka.utils.{Logging, TestUtils}
import org.apache.kafka.clients.admin.AlterConfigOp.OpType
import org.apache.kafka.clients.admin.{Admin, AdminClientConfig, AlterConfigOp, AlterConfigsOptions, Config, ConfigEntry}
import org.apache.kafka.common.config.{ConfigResource, TopicConfig}
Expand Down Expand Up @@ -78,7 +78,7 @@ class AdminClientWithPoliciesIntegrationTest extends KafkaServerTestHarness with
props.put(KafkaConfig.AlterConfigPolicyClassNameProp, classOf[Policy])
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testValidAlterConfigs(quorum: String): Unit = {
client = Admin.create(createConfig)
Expand All @@ -97,15 +97,15 @@ class AdminClientWithPoliciesIntegrationTest extends KafkaServerTestHarness with
PlaintextAdminIntegrationTest.checkValidAlterConfigs(client, this, topicResource1, topicResource2)
}

@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testInvalidAlterConfigs(quorum: String): Unit = {
client = Admin.create(createConfig)
PlaintextAdminIntegrationTest.checkInvalidAlterConfigs(this, client)
}

@nowarn("cat=deprecation")
@ParameterizedTest(name = TestInfoUtils.TestWithParameterizedQuorumName)
@ParameterizedTest
@ValueSource(strings = Array("zk", "kraft"))
def testInvalidAlterConfigsDueToPolicy(quorum: String): Unit = {
client = Admin.create(createConfig)
Expand Down
Loading

0 comments on commit 4b2278f

Please sign in to comment.