evans-ye commented on a change in pull request #537: BIGTOP-3168: Kafka smoke 
tests implementation
URL: https://github.com/apache/bigtop/pull/537#discussion_r306930753
 
 

 ##########
 File path: bigtop-tests/smoke-tests/kafka/TestKafkaSmoke.groovy
 ##########
 @@ -0,0 +1,70 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+
+package org.apache.bigtop.itest.kafka
+
+import org.junit.BeforeClass
+import org.junit.AfterClass
+import org.apache.bigtop.itest.shell.Shell
+import static org.junit.Assert.assertNotNull
+import static org.junit.Assert.assertTrue
+import org.junit.Test
+import org.apache.bigtop.itest.JarContent
+import org.apache.bigtop.itest.TestUtils
+import org.junit.runner.RunWith
+
+class TestKafkaSmoke {
+  static Shell sh = new Shell("/bin/bash -s");
+
+  static final String KAFKA_HOME = "/usr/lib/kafka"
+  static final String KAFKA_CONFIG = KAFKA_HOME + "/config/server.properties "
+  static final String KAFKA_TOPICS = KAFKA_HOME + "/bin/kafka-topics.sh "
+  static final String KAFKA_SERVER_START = KAFKA_HOME + 
"/bin/kafka-server-start.sh "
+  static final String KAFKA_SERVER_STOP = KAFKA_HOME + 
"/bin/kafka-server-stop.sh "
+
+  @BeforeClass
+  static void kafkaSetUp() {
+    /* Restart kafka server with new broker id 111
+     * Enable delete.topic.enable
+     */
+    sh.exec(KAFKA_SERVER_STOP);
+    sh.exec(KAFKA_SERVER_START + KAFKA_CONFIG
+      + " --override delete.topic.enable=true"
+      + " --override broker.id=111"
+      + " --override port=9192"
+      + " --override log.dirs=/tmp/kafka-logs-111 &"
 
 Review comment:
   I'm a little bit worry about this because it changes the broker settings. 
What if there's already a broker 111 exists in the testing cluster? 
   
   Let's not jump into development directly and discuss of what's the best way 
to do it first. Maybe a better way to test Kafka is to make test topic 
idempotent(i.e. either create it or it's already exists). And then we test the 
produce and consume functionality instead?
   
   If  there's no easy way to implement it another way. Can we just enable 
delete.topic.enable on the fly and don't change the broker settings?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to