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

[DEVOPS-980] Fix log collection in integration test #3380

Merged
merged 1 commit into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
''