cassandra: Add passthru.tests

(cherry picked from commit a298710dd1)
This commit is contained in:
Robert Hensing
2020-12-09 19:23:25 +01:00
parent d9bc1306a3
commit a8ae72800d
7 changed files with 33 additions and 8 deletions

View File

@@ -44,7 +44,11 @@ in
caddy = handleTest ./caddy.nix {};
cadvisor = handleTestOn ["x86_64-linux"] ./cadvisor.nix {};
cage = handleTest ./cage.nix {};
cassandra = handleTest ./cassandra.nix {};
cagebreak = handleTest ./cagebreak.nix {};
cassandra_2_1 = handleTest ./cassandra.nix { testPackage = pkgs.cassandra_2_1; };
cassandra_2_2 = handleTest ./cassandra.nix { testPackage = pkgs.cassandra_2_2; };
cassandra_3_0 = handleTest ./cassandra.nix { testPackage = pkgs.cassandra_3_0; };
cassandra_3_11 = handleTest ./cassandra.nix { testPackage = pkgs.cassandra_3_11; };
ceph-single-node = handleTestOn ["x86_64-linux"] ./ceph-single-node.nix {};
ceph-multi-node = handleTestOn ["x86_64-linux"] ./ceph-multi-node.nix {};
certmgr = handleTest ./certmgr.nix {};

View File

@@ -1,7 +1,5 @@
import ./make-test-python.nix ({ pkgs, lib, ... }:
import ./make-test-python.nix ({ pkgs, lib, testPackage ? pkgs.cassandra, ... }:
let
# Change this to test a different version of Cassandra:
testPackage = pkgs.cassandra;
clusterName = "NixOS Automated-Test Cluster";
testRemoteAuth = lib.versionAtLeast testPackage.version "3.11";
@@ -47,7 +45,7 @@ let
};
in
{
name = "cassandra";
name = "cassandra-${testPackage.version}";
meta = {
maintainers = with lib.maintainers; [ johnazoidberg ];
};
@@ -128,4 +126,8 @@ in
"nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass2'"
)
'';
passthru = {
inherit testPackage;
};
})

View File

@@ -3,4 +3,5 @@
callPackage ./generic.nix (args // {
version = "2.1.22";
sha256 = "1wk57dz0kmc6d5y8d8dkx269lzh3ark3751z734gxncwdlclcyz3";
generation = "2_1";
})

View File

@@ -1,6 +1,7 @@
{ callPackage, ... } @ args:
callPackage ./generic.nix (args // {
version = "2.2.19";
sha256 = "1f8axpxxpmzlb22k3lqsnw3096qjp6xd36brvq5xbdk698jw15jl";
version = "2.2.14";
sha256 = "1b2x3q1ach44qg07sh8wr7d8a10n36w5522drd3p35djbiwa3d9q";
generation = "2_2";
})

View File

@@ -3,4 +3,5 @@
callPackage ./generic.nix (args // {
version = "3.0.23";
sha256 = "0cbia20bggq85q2p6gsybw045qdfqxd5xv8ihppq1hwl21sb2klz";
generation = "3_0";
})

View File

@@ -3,4 +3,5 @@
callPackage ./generic.nix (args // {
version = "3.11.9";
sha256 = "1ckaacc1z0j72llklrc4587ia6a0pab02bdyac6g3kl6kqvcz40c";
generation = "3_11";
})

View File

@@ -1,5 +1,9 @@
{ stdenv, fetchurl, python, makeWrapper, gawk, bash, getopt, procps
, which, jre, version, sha256, coreutils, ...
, which, jre, coreutils, nixosTests
# generation is the attribute version suffix such as 3_11 in pkgs.cassandra_3_11
, generation
, version, sha256
, ...
}:
let
@@ -83,6 +87,17 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/cqlsh --prefix PATH : ${python}/bin
'';
passthru = {
tests =
let
test = nixosTests."cassandra_${generation}";
in {
nixos =
assert test.testPackage.version == version;
test;
};
};
meta = with stdenv.lib; {
homepage = "http://cassandra.apache.org/";
description = "A massively scalable open source NoSQL database";