Merge pull request #106441 from hercules-ci/cassandra-passthru-tests

Cassandra passthru tests
This commit is contained in:
Robert Hensing 2020-12-14 16:49:47 +01:00 committed by GitHub
commit b37c00ab90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 10 deletions

View File

@ -67,6 +67,8 @@ rec {
LOGFILE=/dev/null tests='exec(os.environ["testScript"])' ${driver}/bin/nixos-test-driver LOGFILE=/dev/null tests='exec(os.environ["testScript"])' ${driver}/bin/nixos-test-driver
''; '';
passthru = driver.passthru;
}; };
@ -76,6 +78,7 @@ rec {
, name ? "unnamed" , name ? "unnamed"
# Skip linting (mainly intended for faster dev cycles) # Skip linting (mainly intended for faster dev cycles)
, skipLint ? false , skipLint ? false
, passthru ? {}
, ... , ...
} @ t: } @ t:
let let
@ -137,7 +140,7 @@ rec {
testScript = testScript'; testScript = testScript';
preferLocalBuild = true; preferLocalBuild = true;
testName = name; testName = name;
passthru = { passthru = passthru // {
inherit nodes; inherit nodes;
}; };
} }

View File

@ -49,7 +49,10 @@ in
cadvisor = handleTestOn ["x86_64-linux"] ./cadvisor.nix {}; cadvisor = handleTestOn ["x86_64-linux"] ./cadvisor.nix {};
cage = handleTest ./cage.nix {}; cage = handleTest ./cage.nix {};
cagebreak = handleTest ./cagebreak.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-multi-node = handleTestOn ["x86_64-linux"] ./ceph-multi-node.nix {};
ceph-single-node = handleTestOn ["x86_64-linux"] ./ceph-single-node.nix {}; ceph-single-node = handleTestOn ["x86_64-linux"] ./ceph-single-node.nix {};
certmgr = handleTest ./certmgr.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 let
# Change this to test a different version of Cassandra:
testPackage = pkgs.cassandra;
clusterName = "NixOS Automated-Test Cluster"; clusterName = "NixOS Automated-Test Cluster";
testRemoteAuth = lib.versionAtLeast testPackage.version "3.11"; testRemoteAuth = lib.versionAtLeast testPackage.version "3.11";
@ -47,7 +45,7 @@ let
}; };
in in
{ {
name = "cassandra"; name = "cassandra-${testPackage.version}";
meta = { meta = {
maintainers = with lib.maintainers; [ johnazoidberg ]; maintainers = with lib.maintainers; [ johnazoidberg ];
}; };
@ -128,4 +126,8 @@ in
"nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass2'" "nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass2'"
) )
''; '';
passthru = {
inherit testPackage;
};
}) })

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,9 @@
{ stdenv, fetchurl, python, makeWrapper, gawk, bash, getopt, procps { 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 let
@ -83,11 +87,22 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/cqlsh --prefix PATH : ${python}/bin 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; { meta = with stdenv.lib; {
homepage = "http://cassandra.apache.org/"; homepage = "http://cassandra.apache.org/";
description = "A massively scalable open source NoSQL database"; description = "A massively scalable open source NoSQL database";
platforms = platforms.unix; platforms = platforms.unix;
license = licenses.asl20; license = licenses.asl20;
maintainers = []; maintainers = [ maintainers.roberth ];
}; };
} }