Skip to content

Commit

Permalink
MINOR: system test clean up (apache#7552)
Browse files Browse the repository at this point in the history
Guozhang Wang <wangguoz@gmail.com>, Sophie Blee-Goldman <sophie@confluent.io>,
  • Loading branch information
bbejeck authored Oct 21, 2019
1 parent e20dcff commit 6afe05f
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ public class StreamsUpgradeToCooperativeRebalanceTest {

@SuppressWarnings("unchecked")
public static void main(final String[] args) throws Exception {
if (args.length < 3) {
System.err.println("StreamsUpgradeTest requires three argument (kafka-url, zookeeper-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] + " " : "")
+ (args.length > 1 ? args[1] : ""));
if (args.length < 2) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires two arguments (zookeeper-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] : ""));
}

final String zookeeper = args[1];
final String propFileName = args.length > 2 ? args[2] : null;
final String zookeeper = args[0];
final String propFileName = args[1];

final Properties streamsProperties = Utils.loadProps(propFileName);
final Properties config = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ public class StreamsUpgradeToCooperativeRebalanceTest {

@SuppressWarnings("unchecked")
public static void main(final String[] args) throws Exception {
if (args.length < 3) {
System.err.println("StreamsUpgradeTest requires three argument (kafka-url, zookeeper-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] + " " : "")
+ (args.length > 1 ? args[1] : ""));
if (args.length < 2) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires two arguments (zookeeper-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] : ""));
}
final String zookeeper = args[1];
final String propFileName = args.length > 2 ? args[2] : null;
final String zookeeper = args[0];
final String propFileName = args[1];

final Properties streamsProperties = Utils.loadProps(propFileName);
final Properties config = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ public class StreamsUpgradeToCooperativeRebalanceTest {

@SuppressWarnings("unchecked")
public static void main(final String[] args) throws Exception {
if (args.length < 2) {
System.err.println("StreamsUpgradeTest requires three argument (kafka-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] + " " : ""));
if (args.length < 1) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires one argument (properties-file) but none provided");
}
final String propFileName = args[1];
final String propFileName = args[0];

final Properties streamsProperties = Utils.loadProps(propFileName);
final Properties config = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,14 @@ public class StreamsUpgradeToCooperativeRebalanceTest {

@SuppressWarnings("unchecked")
public static void main(final String[] args) throws Exception {
if (args.length < 2) {
System.err.println("StreamsUpgradeTest requires three argument (kafka-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] + " " : ""));
if (args.length < 1) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires one argument (properties-file) but none provided");
}
final String kafka = args[0];
final String propFileName = args[1];

final String propFileName = args[0];
final Properties streamsProperties = Utils.loadProps(propFileName);
final Properties config = new Properties();

System.out.println("StreamsTest instance started (StreamsUpgradeToCooperativeRebalanceTest v0.11.0)");
System.out.println("kafka=" + kafka);
System.out.println("props=" + config);

config.put(StreamsConfig.APPLICATION_ID_CONFIG, "cooperative-rebalance-upgrade");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ public class StreamsUpgradeToCooperativeRebalanceTest {

@SuppressWarnings("unchecked")
public static void main(final String[] args) throws Exception {
if (args.length < 2) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires two argument (kafka-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] : ""));
if (args.length < 1) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires one argument (properties-file) but none provided");
}
System.out.println("Args are " + Arrays.toString(args));
final String propFileName = args[1];
final String propFileName = args[0];
final Properties streamsProperties = Utils.loadProps(propFileName);

final Properties config = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ public class StreamsUpgradeToCooperativeRebalanceTest {

@SuppressWarnings("unchecked")
public static void main(final String[] args) throws Exception {
if (args.length < 2) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires two argument (kafka-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] : ""));
if (args.length < 1) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires one argument (properties-file) but none provided");
}
System.out.println("Args are " + Arrays.toString(args));
final String propFileName = args[1];
final String propFileName = args[0];
final Properties streamsProperties = Utils.loadProps(propFileName);

final Properties config = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ public class StreamsUpgradeToCooperativeRebalanceTest {

@SuppressWarnings("unchecked")
public static void main(final String[] args) throws Exception {
if (args.length < 2) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires two argument (kafka-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] : ""));
if (args.length < 1) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires one argument (properties-file) but none provided");
}
System.out.println("Args are " + Arrays.toString(args));
final String propFileName = args[1];
final String propFileName = args[0];
final Properties streamsProperties = Utils.loadProps(propFileName);

final Properties config = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ public class StreamsUpgradeToCooperativeRebalanceTest {

@SuppressWarnings("unchecked")
public static void main(final String[] args) throws Exception {
if (args.length < 2) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires two argument (kafka-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] : ""));
if (args.length < 1) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires one argument (properties-file) but none provided");
}
System.out.println("Args are " + Arrays.toString(args));
final String propFileName = args[1];
final String propFileName = args[0];
final Properties streamsProperties = Utils.loadProps(propFileName);

final Properties config = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ public class StreamsUpgradeToCooperativeRebalanceTest {

@SuppressWarnings("unchecked")
public static void main(final String[] args) throws Exception {
if (args.length < 2) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires two argument (kafka-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] : ""));
if (args.length < 1) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires one argument (properties-file) but none provided");
}
System.out.println("Args are " + Arrays.toString(args));
final String propFileName = args[1];
final String propFileName = args[0];
final Properties streamsProperties = Utils.loadProps(propFileName);

final Properties config = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ public class StreamsUpgradeToCooperativeRebalanceTest {

@SuppressWarnings("unchecked")
public static void main(final String[] args) throws Exception {
if (args.length < 2) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires two argument (kafka-url, properties-file) but only " + args.length + " provided: "
+ (args.length > 0 ? args[0] : ""));
if (args.length < 1) {
System.err.println("StreamsUpgradeToCooperativeRebalanceTest requires one argument (kafka-url, properties-file) but none provided");
}
System.out.println("Args are " + Arrays.toString(args));
final String propFileName = args[1];
final String propFileName = args[0];
final Properties streamsProperties = Utils.loadProps(propFileName);

final Properties config = new Properties();
Expand Down
9 changes: 2 additions & 7 deletions tests/kafkatest/services/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,7 @@ def set_upgrade_phase(self, upgrade_phase):

def start_cmd(self, node):
args = self.args.copy()
if self.KAFKA_STREAMS_VERSION in [str(LATEST_0_10_0), str(LATEST_0_10_1), str(LATEST_0_10_2),
str(LATEST_0_11_0), str(LATEST_1_0), str(LATEST_1_1),
str(LATEST_2_0), str(LATEST_2_1), str(LATEST_2_2), str(LATEST_2_3)]:
args['kafka'] = self.kafka.bootstrap_servers()
else:
args['kafka'] = ""

if self.KAFKA_STREAMS_VERSION == str(LATEST_0_10_0) or self.KAFKA_STREAMS_VERSION == str(LATEST_0_10_1):
args['zk'] = self.kafka.zk.connect_setting()
else:
Expand All @@ -612,7 +607,7 @@ def start_cmd(self, node):

cmd = "( export KAFKA_LOG4J_OPTS=\"-Dlog4j.configuration=file:%(log4j)s\"; " \
"INCLUDE_TEST_JARS=true UPGRADE_KAFKA_STREAMS_TEST_VERSION=%(version)s " \
" %(kafka_run_class)s %(streams_class_name)s %(kafka)s %(zk)s %(config_file)s " \
" %(kafka_run_class)s %(streams_class_name)s %(zk)s %(config_file)s " \
" & echo $! >&3 ) 1>> %(stdout)s 2>> %(stderr)s 3> %(pidfile)s" % args

self.logger.info("Executing: " + cmd)
Expand Down

0 comments on commit 6afe05f

Please sign in to comment.