cassandra: Add passthru.tests

This commit is contained in:
Robert Hensing 2020-12-09 13:01:56 +01:00
parent 72a5301610
commit a298710dd1
7 changed files with 32 additions and 8 deletions

View File

@ -49,7 +49,10 @@ in
cadvisor = handleTestOn ["x86_64-linux"] ./cadvisor.nix {};
cage = handleTest ./cage.nix {};
cagebreak = handleTest ./cagebreak.nix {};
cassandra = handleTest ./cassandra.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-multi-node = handleTestOn ["x86_64-linux"] ./ceph-multi-node.nix {};
ceph-single-node = handleTestOn ["x86_64-linux"] ./ceph-single-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";