diff --git a/.buildkite/release.yml b/.buildkite/release.yml index eb5fe26bda3..bb1998e6fb0 100644 --- a/.buildkite/release.yml +++ b/.buildkite/release.yml @@ -10,8 +10,8 @@ env: steps: - label: Add release commits key: add-release-commits - commands: | - ./scripts/buildkite/release/release-candidate.sh + commands: + - ./scripts/buildkite/release/release-candidate.sh agents: system: x86_64-linux @@ -36,8 +36,8 @@ steps: - add-release-commits - refresh-node-state - linux-package - commands: | - ./scripts/buildkite/release/linux-e2e.sh + commands: + - nix develop -c ./scripts/buildkite/release/linux-e2e.sh artifact_paths: - "./result/linux/**" - "./logs/**/*" diff --git a/.gitignore b/.gitignore index 735641ab7d5..5ff75b3ca42 100644 --- a/.gitignore +++ b/.gitignore @@ -78,3 +78,4 @@ lib/wallet-benchmarks/data/membench-snapshot ## Local cluster swagger golden actual lib/local-cluster/data/swagger.json.actual +test/e2e/.direnv/flake-profile* diff --git a/default.nix b/default.nix deleted file mode 100644 index 7e86e640f00..00000000000 --- a/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################ -# -# Cardano Wallet Nix build - legacy flake compatibility layer. -# See flake.nix for further documentation on top-level attributes. -# -############################################################################ - -{ ... }@args: -with (import ./nix/flake-compat.nix args); -defaultNix // defaultNix.packages.${builtins.currentSystem} // { - private.project = defaultNix.legacyPackages.${builtins.currentSystem}; -} diff --git a/nix/haskell.nix b/nix/haskell.nix index 52a5dd0cb12..cf7c3d24961 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -110,7 +110,17 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [ filter = haskell-nix.haskellSourceFilter; }; - shell = { + shell = + let + # To update gemset.nix, run: + # nix-shell --arg bins false --run bundix + gems = pkgs.bundlerEnv { + name = "gems-cardano-wallet-e2e"; + gemdir = ../test/e2e; + ruby = pkgs.ruby_3_1; + }; + in + { name = "cardano-wallet-shell${lib.optionalString config.profiling "-profiled"}"; packages = ps: builtins.attrValues (haskellLib.selectProjectPackages ps); tools = { @@ -130,6 +140,11 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [ nodePkgs.cardano-node cardano-addresses-cli.components.exes.cardano-address bech32.components.exes.bech32 + # for e2e tests + gems + gems.wrappedRuby + pkgs.bundix + pkgs.screen ]) ++ (with pkgs.buildPackages.buildPackages; [ just pkg-config diff --git a/scripts/buildkite/release/fetch-preprod-snapshot.sh b/scripts/buildkite/release/fetch-preprod-snapshot.sh index a8fecbf6790..92f00642f3e 100755 --- a/scripts/buildkite/release/fetch-preprod-snapshot.sh +++ b/scripts/buildkite/release/fetch-preprod-snapshot.sh @@ -23,15 +23,21 @@ if [ "$failed" ]; then fi fi + export failed2=false curl -o - \ "https://downloads.csnapshots.io/testnet/$(cat file.new)" \ - | lz4 -c -d - | tar -x -C . + | lz4 -c -d - | tar -x -C . || export failed2=true - mv file.new file.old + if [ "$failed2" ]; then + echo "Failed to fetch preprod snapshot." + else + echo "Successfully fetched preprod snapshot." + mv file.new file.old - rm -rf db-new + rm -rf db-new - mv db db-new + mv db db-new + fi else - echo "Failed to fetch preprod snapshot. Hope there is an old one available." + echo "Failed to fetch preprod snapshot name." fi \ No newline at end of file diff --git a/scripts/buildkite/release/linux-e2e.sh b/scripts/buildkite/release/linux-e2e.sh index 8f46ad8383a..47347b6ec95 100755 --- a/scripts/buildkite/release/linux-e2e.sh +++ b/scripts/buildkite/release/linux-e2e.sh @@ -1,4 +1,4 @@ -#! /usr/bin/env -S nix shell 'nixpkgs#rsync' 'nixpkgs#gnutar' --command bash +#! /usr/bin/env -S nix shell 'nixpkgs#rsync' 'nixpkgs#gnutar' '.#cardano-wallet' --command bash # shellcheck shell=bash set -euox pipefail @@ -42,7 +42,6 @@ export TESTS_E2E_STATEDIR TESTS_E2E_TOKEN_METADATA=https://metadata.world.dev.cardano.org/ export TESTS_E2E_TOKEN_METADATA - -nix-shell --run "rake run_on[preprod,sync,true]" +rake "run_on[preprod,sync,true]" rm "$tmpfile" \ No newline at end of file diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 044c16a3f06..00000000000 --- a/shell.nix +++ /dev/null @@ -1 +0,0 @@ -{...}@args: (import ./nix/flake-compat.nix args).shellNix diff --git a/test/e2e/.envrc b/test/e2e/.envrc index 41b29c74f89..fdb3995c2fe 100644 --- a/test/e2e/.envrc +++ b/test/e2e/.envrc @@ -8,7 +8,7 @@ else # to prevent bootstrapping problems. # It's definitely better to use lorri, because direnv won't # be fast like this. - use nix + use flake fi # Source a user-specific config in .envrc-local at the project diff --git a/test/e2e/shell.nix b/test/e2e/shell.nix deleted file mode 100644 index 6768e56fe9f..00000000000 --- a/test/e2e/shell.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs ? import ../../nix/default.nix {} -, cardanoWallet ? import ../../default.nix { inherit pkgs; } -# Whether to build cardano-wallet from this source directory and -# include in the shell. -, bins ? true -}: - -let - # To update gemset.nix, run: - # nix-shell --arg bins false --run bundix - gems = pkgs.bundlerEnv { - name = "gems-cardano-wallet-e2e"; - gemdir = ./.; - ruby = pkgs.ruby_3_1; - }; -in pkgs.mkShell { - name = "cardano-wallet-e2e"; - buildInputs = [ - gems - gems.wrappedRuby - pkgs.bundix - pkgs.screen - ] ++ pkgs.lib.optionals bins [ - cardanoWallet.cardano-wallet - cardanoWallet.cardano-node - cardanoWallet.cardano-cli - ]; -}