Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3380 from input-output-hk/devops-980-wallet-integ…
Browse files Browse the repository at this point in the history
…ration-log-artifact

[DEVOPS-980] Fix log collection in integration test
  • Loading branch information
disassembler authored Aug 10, 2018
2 parents 642dd87 + edec151 commit 633b494
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ let
shellcheck = pkgs.callPackage ./scripts/test/shellcheck.nix { inherit src; };
hlint = pkgs.callPackage ./scripts/test/hlint.nix { inherit src; };
stylishHaskell = pkgs.callPackage ./scripts/test/stylish.nix { inherit (cardanoPkgs) stylish-haskell; inherit src localLib; };
walletIntegration = pkgs.callPackage ./scripts/test/wallet/integration/build-test.nix { inherit walletIntegrationTests pkgs; };
walletIntegration = pkgs.callPackage ./scripts/test/wallet/integration/build-test.nix { inherit walletIntegrationTests; };
swaggerSchemaValidation = pkgs.callPackage ./scripts/test/wallet/swaggerSchemaValidation.nix { inherit gitrev; };
};
cardano-sl-explorer-frontend = (import ./explorer/frontend {
Expand Down
33 changes: 17 additions & 16 deletions scripts/test/wallet/integration/build-test.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{pkgs, stdenv, walletIntegrationTests, glibcLocales }:
stdenv.mkDerivation rec {
name = "cardano-wallet-integration-tests";
buildInputs = with pkgs; [ jq curl glibcLocales ];
buildCommand = ''
${walletIntegrationTests}
EXIT_CODE=$?
mkdir -pv $out/nix-support
if [ $EXIT_CODE != 0 ]
then
touch $out/nix-support/failed
tar -czvf $out/logs.tar.gz state-demo/logs
echo "file binary-dist $out/logs.tar.gz" >> $out/nix-support/hydra-build-products
fi
'';

{stdenv, jq, curl, runCommand, walletIntegrationTests, glibcLocales }:
runCommand "cardano-wallet-integration-tests" {
buildInputs = [ jq curl glibcLocales ];
}
''
#!${stdenv.shell}
function capture_logs {
echo "The build failed with exit code $?"
mkdir -pv $out/nix-support
touch $out/nix-support/failed
tar -czvf $out/logs.tar.gz state-demo/logs
echo "file binary-dist $out/logs.tar.gz" >> $out/nix-support/hydra-build-products
exit 0
}
${walletIntegrationTests} || capture_logs
touch $out
exit 0
''

0 comments on commit 633b494

Please sign in to comment.