6 default = testsForPackage { sparkPackage = pkgs.spark; };
9 testsForPackage = args: lib.recurseIntoAttrs {
10 sparkCluster = testSparkCluster args;
11 passthru.override = args': testsForPackage (args // args');
13 testSparkCluster = { sparkPackage, ... }: pkgs.testers.nixosTest ({
17 worker = { nodes, pkgs, ... }: {
19 package = sparkPackage;
22 master = "master:7077";
25 virtualisation.memorySize = 2048;
27 master = { config, pkgs, ... }: {
29 package = sparkPackage;
35 networking.firewall.allowedTCPPorts = [ 22 7077 8080 ];
40 master.wait_for_unit("spark-master.service")
41 worker.wait_for_unit("spark-worker.service")
42 worker.copy_from_host( "${./spark_sample.py}", "/spark_sample.py" )
43 assert "<title>Spark Master at spark://" in worker.succeed("curl -sSfkL http://master:8080/")
44 worker.succeed("spark-submit --version | systemd-cat")
45 worker.succeed("spark-submit --master spark://master:7077 --executor-memory 512m --executor-cores 1 /spark_sample.py")