Skip to content

Commit

Permalink
Merge #1974
Browse files Browse the repository at this point in the history
1974: Edge node test fixes r=jbgi a=newhoggy

This reverts commit be28792.

Co-authored-by: John Ky <john.ky@iohk.io>
Co-authored-by: Jean-Baptiste Giraudeau <jean-baptiste.giraudeau@iohk.io>
  • Loading branch information
3 people committed Oct 13, 2020
2 parents 388ebca + 0f35b3c commit d53f570
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 711 deletions.
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ let

scripts = callPackage ./nix/scripts.nix { inherit customConfig; };
# NixOS tests run a proxy and validate it listens
nixosTests = import ./nix/nixos/tests {
nixosTests = recRecurseIntoAttrs (import ./nix/nixos/tests {
inherit pkgs;
};
});

dockerImage = let
defaultConfig = rec {
Expand Down
40 changes: 31 additions & 9 deletions nix/nixos/tests/cardano-node-edge.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,47 @@ with pkgs;
{
name = "cardano-node-edge-test";
nodes = {
machine = { config, pkgs, ... }: {
nixpkgs.overlays = commonLib.overlays;
machine = { config, ... }: {
nixpkgs.pkgs = pkgs;
imports = [
../.
];
services.cardano-node = {
enable = true;
systemdSocketActivation = true;
port = 3001;
inherit (commonLib.environments.staging) genesisFile genesisHash;
topology = commonLib.mkEdgeTopology {};
hostAddr = "127.0.0.1";
environment = "mainnet";
cardanoNodePkgs = pkgs;
nodeConfig = config.services.cardano-node.environments.${config.services.cardano-node.environment}.nodeConfig // {
hasPrometheus = [ config.services.cardano-node.hostAddr 12798 ];
# Use Journald output:
setupScribes = [{
scKind = "JournalSK";
scName = "cardano";
scFormat = "ScText";
}];
defaultScribes = [
[
"JournalSK"
"cardano"
]
];
};
};
systemd.services.cardano-node.serviceConfig.Restart = lib.mkForce "no";
};
};
testScript = ''
startAll
$machine->waitForUnit("cardano-node.service");
$machine->waitForOpenPort(3001);
$machine->succeed("stat /run/cardano-node");
$machine->succeed("stat /run/cardano-node/node-core-0.socket");
start_all()
machine.wait_for_unit("cardano-node.service")
machine.sleep(3)
machine.succeed("systemctl status cardano-node")
machine.succeed("stat /run/cardano-node")
machine.succeed("stat /run/cardano-node/node.socket")
machine.sleep(10)
machine.succeed("nc -z 127.0.0.1 12798")
machine.succeed("nc -z 127.0.0.1 3001")
'';

}
107 changes: 0 additions & 107 deletions nix/nixos/tests/chairmans-cluster.nix

This file was deleted.

7 changes: 2 additions & 5 deletions nix/nixos/tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ with pkgs.commonLib;
forAllSystems = genAttrs supportedSystems;
importTest = fn: args: system: let
imported = import fn;
test = import (pkgs.path + "/nixos/tests/make-test.nix") imported;
test = import (pkgs.path + "/nixos/tests/make-test-python.nix") imported;
in test ({
inherit pkgs system config;
} // args);
callTest = fn: args: forAllSystems (system: hydraJob (importTest fn args system));
in rec {
# only tests that port is open since the test can't access network to actually sync
# cardanoNodeEdge = callTest ./cardano-node-edge.nix {};

# Subsumes what cardanoNodeEdge does
chairmansCluster = callTest ./chairmans-cluster.nix {};
cardanoNodeEdge = callTest ./cardano-node-edge.nix {};
}
3 changes: 1 addition & 2 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ let
};
};
extraBuilds = {
# only build nixos tests on first supported system (linux)
inherit (pkgsFor (builtins.head supportedSystems));
# Environments listed in Network Configuration page
cardano-deployment = pkgs.iohkNix.cardanoLib.mkConfigHtml { inherit (pkgs.iohkNix.cardanoLib.environments) mainnet testnet; };
} // (builtins.listToAttrs (map makeRelease [
Expand Down Expand Up @@ -156,6 +154,7 @@ let
};
}) // extraBuilds // (mkRequiredJob (concatLists [
(collectJobs jobs.native.checks)
(collectJobs jobs.native.nixosTests)
(collectJobs jobs.native.benchmarks)
(collectJobs jobs.native.exes)
(optional windowsBuild jobs.cardano-node-win64)
Expand Down
62 changes: 0 additions & 62 deletions scripts/chairmans-cluster/README.org

This file was deleted.

0 comments on commit d53f570

Please sign in to comment.