From 425e707bb2112d82a96db579f4301aa28e0fc2e4 Mon Sep 17 00:00:00 2001 From: Sarah Brofeldt Date: Wed, 26 Oct 2022 10:07:17 +0200 Subject: [PATCH 1/2] apacheKafka: Fix passthru of jre This unbreaks the NixOS module and tests that rely on the value in order to map the desired kafka version to a supported jre --- pkgs/servers/apache-kafka/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/apache-kafka/default.nix b/pkgs/servers/apache-kafka/default.nix index bf51260c7fe1..cb3691460bd7 100644 --- a/pkgs/servers/apache-kafka/default.nix +++ b/pkgs/servers/apache-kafka/default.nix @@ -75,6 +75,10 @@ stdenv.mkDerivation rec { chmod +x $out/bin\/* ''; + passthru = { + inherit jre; # Used by the NixOS module to select the supported jre + }; + meta = with lib; { homepage = "https://kafka.apache.org"; description = "A high-throughput distributed messaging system"; @@ -83,5 +87,4 @@ stdenv.mkDerivation rec { maintainers = [ maintainers.ragge ]; platforms = platforms.unix; }; - passthru = { inherit jdk17_headless; }; } From af484ef1c4167812bad756132e2b00ad54ae505b Mon Sep 17 00:00:00 2001 From: Sarah Brofeldt Date: Wed, 26 Oct 2022 10:41:53 +0200 Subject: [PATCH 2/2] nixos/tests/kafka: Fix tests Requires new flags that works across all versions Drops unused 0.9 compat --- nixos/tests/kafka.nix | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/nixos/tests/kafka.nix b/nixos/tests/kafka.nix index c0488a0e93a3..79af02710c32 100644 --- a/nixos/tests/kafka.nix +++ b/nixos/tests/kafka.nix @@ -50,7 +50,7 @@ let kafka.wait_until_succeeds( "${kafkaPackage}/bin/kafka-topics.sh --create " - + "--zookeeper zookeeper1:2181 --partitions 1 " + + "--bootstrap-server localhost:9092 --partitions 1 " + "--replication-factor 1 --topic testtopic" ) kafka.succeed( @@ -58,19 +58,12 @@ let + "${kafkaPackage}/bin/kafka-console-producer.sh " + "--broker-list localhost:9092 --topic testtopic" ) - '' + (if name == "kafka_0_9" then '' - assert "test 1" in kafka.succeed( - "${kafkaPackage}/bin/kafka-console-consumer.sh " - + "--zookeeper zookeeper1:2181 --topic testtopic " - + "--from-beginning --max-messages 1" - ) - '' else '' assert "test 1" in kafka.succeed( "${kafkaPackage}/bin/kafka-console-consumer.sh " + "--bootstrap-server localhost:9092 --topic testtopic " + "--from-beginning --max-messages 1" ) - ''); + ''; }) { inherit system; }); in with pkgs; {