From 63e2d8c5b60730f03370cb67b33dc5f31542aa1f Mon Sep 17 00:00:00 2001 From: paolino Date: Mon, 27 Nov 2023 09:50:36 +0000 Subject: [PATCH 01/13] Change cardanofoundation into cardano-foundation where appropriate --- README.md | 4 ++-- lib/read/cardano-wallet-read.cabal | 2 +- test/e2e/README.md | 2 +- test/e2e/helpers/buildkite.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 880c7fdc303..3652ff4de61 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ - + - + diff --git a/lib/read/cardano-wallet-read.cabal b/lib/read/cardano-wallet-read.cabal index 8cfaf5b41f8..a242028b631 100644 --- a/lib/read/cardano-wallet-read.cabal +++ b/lib/read/cardano-wallet-read.cabal @@ -5,7 +5,7 @@ synopsis: Primitive era-dependent operations to read the cardano blocks and transactions -- description: -homepage: https://github.com/cardanofoundation/cardano-wallet +homepage: https://github.com/cardano-foundation/cardano-wallet license: Apache-2.0 license-file: LICENSE author: Cardano Foundation (High Assurance Lab) diff --git a/test/e2e/README.md b/test/e2e/README.md index c26d3d3062c..b514e92e21c 100644 --- a/test/e2e/README.md +++ b/test/e2e/README.md @@ -95,7 +95,7 @@ Running tests as such skips downloading latest wallet and node binaries. ### Test artifacts By default following locations are used for different artifacts used by the tests: -- `./bins` - location for wallet and node binaries (will be downloaded here from [Buildkite](https://buildkite.com/cardanofoundation/cardano-wallet)) +- `./bins` - location for wallet and node binaries (will be downloaded here from [Buildkite](https://buildkite.com/cardano-foundation/cardano-wallet)) - `./state` - wallet/node databases, logs and configs Locations are relative to `test/e2e` directory. diff --git a/test/e2e/helpers/buildkite.rb b/test/e2e/helpers/buildkite.rb index 18ea0d14de2..72bbee5d062 100644 --- a/test/e2e/helpers/buildkite.rb +++ b/test/e2e/helpers/buildkite.rb @@ -12,7 +12,7 @@ class Buildkite attr_reader :org, :pipeline, :client def initialize(pipeline = 'cardano-wallet') - @org = 'cardanofoundation' + @org = 'cardano-foundation' @pipeline = pipeline @api_token = ENV.fetch('BUILDKITE_API_TOKEN', nil) @client = Buildkit.new(token: @api_token) From 4f47de2a50cde67f35b770ccde20d5e242441216 Mon Sep 17 00:00:00 2001 From: paolino Date: Tue, 28 Nov 2023 14:59:06 +0000 Subject: [PATCH 02/13] Fix linux E2E --- .github/workflows/e2e-linux.yml | 74 ++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/.github/workflows/e2e-linux.yml b/.github/workflows/e2e-linux.yml index 8e43836d996..de6f5200b65 100644 --- a/.github/workflows/e2e-linux.yml +++ b/.github/workflows/e2e-linux.yml @@ -24,6 +24,12 @@ jobs: test: runs-on: ubuntu-latest + env: + TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }} + BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }} + BRANCH: ${{ github.event.inputs.branch || '' }} + TAGS: ${{ github.event.inputs.tags || 'all' }} + steps: - uses: actions/checkout@v3.2.0 @@ -36,38 +42,44 @@ jobs: - name: Install dependencies run: bundle install - - name: 🕒 Get Date/Time - id: date-time - shell: bash - run: | - echo "value=$(rake datetime)" >> $GITHUB_OUTPUT - - - name: 💾 GH Cache node db - id: cache + - name: 💾 GH Restore Cache of node db + id: cache-node uses: actions/cache@v3 with: - path: test/e2e/state/node_db/${{ env.NETWORK }} - key: node-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} - restore-keys: | - node-db-${{ runner.os }}-${{ env.NETWORK }}- + path: test/e2e/state/node_db/preprod + key: node-db-e2e-linux-preprod - name: 💾 Cache wallet db id: cache-wallet uses: actions/cache@v3 with: - path: test/e2e/state/wallet_db/${{ env.NETWORK }} - key: wallet-db3-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} - restore-keys: | - wallet-db3-${{ runner.os }}-${{ env.NETWORK }}- + path: test/e2e/state/wallet_db/preprod + key: wallet-db-e2e-linux-preprod + + - name: Fetch preprod snapshot + if: steps.cache-node.outputs.cache-hit != 'true' + run: | + mkdir state + cd state + mkdir node_db + cd node_db + mkdir preprod + cd preprod + curl -s https://downloads.csnapshots.io/snapshots/testnet/testnet-db-snapshot.json \ + | jq -r .[].file_name > snapshot.json + curl -o - \ + https://downloads.csnapshots.io/snapshots/testnet/$(cat snapshot.json) \ + | lz4 -c -d - | tar -x -C . + mv db/* . - name: ⚙️ Setup (get latest bins and configs and decode fixtures) - run: rake setup[$NETWORK,$BRANCH] + run: rake setup[preprod,$BRANCH] - name: 🔍 Display versions run: rake display_versions - name: 🚀 Start node and wallet - run: rake start_node_and_wallet[$NETWORK] + run: rake start_node_and_wallet[preprod] - name: ⏳ Wait until node is synced run: rake wait_until_node_synced @@ -76,22 +88,28 @@ jobs: run: rake spec SPEC_OPTS="-t $TAGS" - name: 🏁 Stop node and wallet - run: rake stop_node_and_wallet[$NETWORK] + run: rake stop_node_and_wallet[preprod] + + - name: 💾 GH Save Cache of node db + if: always() + uses: actions/cache/save@v3 + with: + path: test/e2e/state/node_db/preprod + key: node-db-e2e-linux-preprod + + - name: 💾 GH Save Cache of wallet db + if: always() + uses: actions/cache/save@v3 + with: + path: test/e2e/state/wallet_db/preprod + key: wallet-db-e2e-linux-preprod - name: 📎 Upload state uses: actions/upload-artifact@v3 if: always() with: - name: ${{ runner.os }}-state + name: linux-state path: | test/e2e/state/logs test/e2e/state/configs test/e2e/state/wallet_db - - env: - TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }} - BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }} - NETWORK: ${{ github.event.inputs.network || 'preprod' }} - BRANCH: ${{ github.event.inputs.branch || '' }} - NODE_DB_CACHE: ${{ github.event.inputs.node_db_cache || 'GH' }} - TAGS: ${{ github.event.inputs.tags || 'all' }} From 45b756aef5d7278a3e762891c862f84de90e8b84 Mon Sep 17 00:00:00 2001 From: paolino Date: Thu, 30 Nov 2023 09:09:39 +0000 Subject: [PATCH 03/13] Add no buffering to rake program --- test/e2e/Rakefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/Rakefile b/test/e2e/Rakefile index 0729e135e52..6424ea7db64 100644 --- a/test/e2e/Rakefile +++ b/test/e2e/Rakefile @@ -5,9 +5,12 @@ require 'cardano_wallet' require_relative 'env' require_relative 'helpers/utils' require_relative 'helpers/buildkite' +require 'io/console' include Helpers::Utils +$stdout.sync = true + STATE = absolute_path ENV.fetch('TESTS_E2E_STATEDIR', nil) CONFIGS = absolute_path ENV.fetch('CARDANO_NODE_CONFIGS', nil) LOGS = absolute_path ENV.fetch('TESTS_LOGDIR', nil) @@ -124,7 +127,7 @@ task :wait_until_node_synced do current_time = Time.now while network.information['sync_progress']['status'] == 'syncing' log "Syncing node... #{network.information['sync_progress']['progress']['quantity']}%" - sleep 15 + sleep 5 end rescue StandardError retry if current_time <= timeout_treshold From 18aacb92c80897c6c530b051e9ad5f6d358ea541 Mon Sep 17 00:00:00 2001 From: paolino Date: Tue, 28 Nov 2023 16:52:15 +0000 Subject: [PATCH 04/13] Fix macOS E2E --- .github/workflows/e2e-macos.yml | 74 ++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/.github/workflows/e2e-macos.yml b/.github/workflows/e2e-macos.yml index baf69005532..aacd65fd84d 100644 --- a/.github/workflows/e2e-macos.yml +++ b/.github/workflows/e2e-macos.yml @@ -24,6 +24,12 @@ jobs: test: runs-on: macos-latest + env: + TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }} + BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }} + BRANCH: ${{ github.event.inputs.branch || '' }} + TAGS: ${{ github.event.inputs.tags || 'all' }} + steps: - uses: actions/checkout@v3 @@ -39,39 +45,45 @@ jobs: - name: Prepare MacOS run: brew install screen - - name: 🕒 Get Date/Time - id: date-time - shell: bash - run: | - echo "value=$(rake datetime)" >> $GITHUB_OUTPUT - - name: 💾 GH Cache node db - id: cache + id: cache-node uses: actions/cache@v3 with: - path: test/e2e/state/node_db/${{ env.NETWORK }} - key: node-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} - restore-keys: | - node-db-${{ runner.os }}-${{ env.NETWORK }}- - node-db-Linux-${{ env.NETWORK }}- + path: test/e2e/state/node_db/preprod + key: node-db-e2e-macos-preprod - name: 💾 Cache wallet db id: cache-wallet uses: actions/cache@v3 with: - path: test/e2e/state/wallet_db/${{ env.NETWORK }} - key: wallet-db3-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} - restore-keys: | - wallet-db3-${{ runner.os }}-${{ env.NETWORK }}- + path: test/e2e/state/wallet_db/preprod + key: wallet-db-e2-macos-preprod + + - name: Fetch preprod snapshot + if: steps.cache-node.outputs.cache-hit != 'true' + run: | + mkdir state + cd state + mkdir node_db + cd node_db + mkdir preprod + cd preprod + curl -s https://downloads.csnapshots.io/snapshots/testnet/testnet-db-snapshot.json \ + | jq -r .[].file_name > snapshot.json + curl -o - \ + https://downloads.csnapshots.io/snapshots/testnet/$(cat snapshot.json) \ + | lz4 -c -d - | tar -x -C . + mv db/* . + - name: ⚙️ Setup (get latest bins and configs and decode fixtures) - run: rake setup[$NETWORK,$BRANCH] + run: rake setup[preprod,$BRANCH] - name: 🔍 Display versions run: rake display_versions - name: 🚀 Start node and wallet - run: rake start_node_and_wallet[$NETWORK] + run: rake start_node_and_wallet[preprod] - name: ⏳ Wait until node is synced run: rake wait_until_node_synced @@ -80,22 +92,28 @@ jobs: run: rake spec SPEC_OPTS="-t $TAGS" - name: 🏁 Stop node and wallet - run: rake stop_node_and_wallet[$NETWORK] + run: rake stop_node_and_wallet[preprod] + + - name: 💾 GH Save Cache of node db + if: always() + uses: actions/cache/save@v3 + with: + path: test/e2e/state/node_db/preprod + key: node-db-e2e-macos-preprod + + - name: 💾 GH Save Cache of wallet db + if: always() + uses: actions/cache/save@v3 + with: + path: test/e2e/state/wallet_db/preprod + key: wallet-db-e2e-macos-preprod - name: 📎 Upload state uses: actions/upload-artifact@v3 if: always() with: - name: ${{ runner.os }}-state + name: macos-state path: | test/e2e/state/logs test/e2e/state/configs test/e2e/state/wallet_db - - env: - TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }} - BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }} - NETWORK: ${{ github.event.inputs.network || 'preprod' }} - BRANCH: ${{ github.event.inputs.branch || '' }} - NODE_DB_CACHE: ${{ github.event.inputs.node_db_cache || 'GH' }} - TAGS: ${{ github.event.inputs.tags || 'all' }} From d787cc9f07590f745d3f4a2535e3f5898ddd65ea Mon Sep 17 00:00:00 2001 From: paolino Date: Wed, 29 Nov 2023 07:53:31 +0000 Subject: [PATCH 05/13] Fix windows E2E --- .github/workflows/e2e-windows.yml | 70 +++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/.github/workflows/e2e-windows.yml b/.github/workflows/e2e-windows.yml index e7632dd28f7..45b8977b3c4 100644 --- a/.github/workflows/e2e-windows.yml +++ b/.github/workflows/e2e-windows.yml @@ -17,8 +17,16 @@ on: default: 'all' jobs: test: + runs-on: windows-latest + env: + NETWORK: ${{ github.event.inputs.network || 'preprod' }} + BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }} + TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }} + BRANCH: ${{ github.event.inputs.branch || 'master' }} + TAGS: ${{ github.event.inputs.tags || 'all' }} + steps: - name: Check space run: Get-PSDrive @@ -52,6 +60,8 @@ jobs: choco install wget choco install unzip choco install nssm + choco install archiver + - name: 🕒 Get Date/Time working-directory: C:/cardano-wallet/test/e2e @@ -61,27 +71,37 @@ jobs: echo "value=$(rake datetime)" >> $GITHUB_OUTPUT - name: 💾 GH Cache node db - id: cache + id: cache-node uses: actions/cache@v3 with: - path: C:/cardano-wallet/test/e2e/state/node_db/${{ env.NETWORK }} - key: node-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} - restore-keys: | - node-db-${{ runner.os }}-${{ env.NETWORK }}- - node-db-Linux-${{ env.NETWORK }}- + path: C:/cardano-wallet/test/e2e/state/node_db/preprod + key: node-db-e2e-windows-preprod - name: 💾 Cache wallet db id: cache-wallet uses: actions/cache@v3 with: - path: C:/cardano-wallet/test/e2e/state/wallet_db/${{ env.NETWORK }} - key: wallet-db3-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} - restore-keys: | - wallet-db3-${{ runner.os }}-${{ env.NETWORK }}- + path: C:/cardano-wallet/test/e2e/state/wallet_db/preprod + key: wallet-db-e2e-windows-preprod + + - name: Fetch preprod snapshot + if: steps.cache-node.outputs.cache-hit != 'true' + working-directory: C:/cardano-wallet/test/e2e + run: | + mkdir state + cd state + mkdir node_db + cd node_db + mkdir preprod + cd preprod + curl -s https://downloads.csnapshots.io/snapshots/testnet/testnet-db-snapshot.json | jq -r .[].file_name > snapshot.json + curl -o snapshot.tar.lz4 https://downloads.csnapshots.io/snapshots/testnet/$(cat snapshot.json) + arc unarchive snapshot.tar.lz4 + mv db/* . - name: ⚙️ Setup (get latest bins and configs and decode fixtures) working-directory: C:/cardano-wallet/test/e2e - run: rake setup[%NETWORK%,%BRANCH%] + run: rake setup[preprod,%BRANCH%] - name: 🔍 Display versions working-directory: C:/cardano-wallet/test/e2e @@ -89,7 +109,7 @@ jobs: - name: 🚀 Start node and wallet working-directory: C:/cardano-wallet/test/e2e - run: rake start_node_and_wallet[%NETWORK%] + run: rake start_node_and_wallet[preprod] - name: ⏳ Wait until node is synced working-directory: C:/cardano-wallet/test/e2e @@ -101,22 +121,28 @@ jobs: - name: 🏁 Stop node and wallet working-directory: C:/cardano-wallet/test/e2e - run: rake stop_node_and_wallet[%NETWORK%] + run: rake stop_node_and_wallet[preprod] + + - name: 💾 GH Save Cache of node db + if: always() + uses: actions/cache/save@v3 + with: + path: test/e2e/state/node_db/preprod + key: node-db-e2e-windows-preprod + + - name: 💾 GH Save Cache of wallet db + if: always() + uses: actions/cache/save@v3 + with: + path: test/e2e/state/wallet_db/preprod + key: wallet-db-e2e-windows-preprod - name: 📎 Upload state uses: actions/upload-artifact@v3 if: always() with: - name: ${{ runner.os }}-state + name: windows-state path: | C:/cardano-wallet/test/e2e/state/logs C:/cardano-wallet/test/e2e/state/configs C:/cardano-wallet/test/e2e/state/wallet_db - - env: - NETWORK: ${{ github.event.inputs.network || 'preprod' }} - BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }} - TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }} - BRANCH: ${{ github.event.inputs.branch || 'master' }} - NODE_DB_CACHE: ${{ github.event.inputs.node_db_cache || 'GH' }} - TAGS: ${{ github.event.inputs.tags || 'all' }} From 249ce6dd5bbb64a0216f44127cfea189aa22e7c2 Mon Sep 17 00:00:00 2001 From: paolino Date: Wed, 29 Nov 2023 10:30:08 +0000 Subject: [PATCH 06/13] Make fetching from smash server maintenance action pending --- test/e2e/spec/shelley_spec.rb | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/test/e2e/spec/shelley_spec.rb b/test/e2e/spec/shelley_spec.rb index db329520a16..ec8b1313757 100644 --- a/test/e2e/spec/shelley_spec.rb +++ b/test/e2e/spec/shelley_spec.rb @@ -447,8 +447,7 @@ describe 'Stake Pools GC Maintenance' do matrix = [{ 'direct' => 'not_applicable' }, - { 'none' => 'not_applicable' }, - { ENV.fetch('TESTS_E2E_SMASH', nil) => 'has_run' }] + { 'none' => 'not_applicable' }] matrix.each do |tc| it "GC metadata maintenance action on metadata source #{tc}" do settings = CW.misc.settings @@ -467,6 +466,27 @@ end end end + describe 'Stake Pools GC Maintenance' do + matrix = [{ ENV.fetch('TESTS_E2E_SMASH', nil) => 'has_run' }] + matrix.each do |tc| + it "GC metadata maintenance action on metadata source #{tc}" do + pending "GC metadata maintenance action on metadata source #{ENV.fetch('TESTS_E2E_SMASH', nil)}" + settings = CW.misc.settings + pools = SHELLEY.stake_pools + + s = settings.update({ pool_metadata_source: tc.keys.first }) + expect(s).to be_correct_and_respond 204 + + t = pools.trigger_maintenance_actions({ maintenance_action: 'gc_stake_pools' }) + expect(t).to be_correct_and_respond 204 + + eventually "Maintenance action has status = #{tc.values.first}" do + r = pools.view_maintenance_actions + (r.code == 200) && (r.to_s.include? tc.values.first) + end + end + end + end it 'I could quit stake pool - if I was delegating' do id = create_shelley_wallet From b4a47f70743f583efa72c9b1c5979ee6435523b9 Mon Sep 17 00:00:00 2001 From: paolino Date: Mon, 27 Nov 2023 10:13:51 +0000 Subject: [PATCH 07/13] Add slack notification for E2E failures for linux mac and windows --- .github/workflows/e2e-linux.yml | 22 ++++++++++++++++++++++ .github/workflows/e2e-macos.yml | 27 +++++++++++++++++++++++++++ .github/workflows/e2e-windows.yml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) diff --git a/.github/workflows/e2e-linux.yml b/.github/workflows/e2e-linux.yml index de6f5200b65..3019dfaa1a4 100644 --- a/.github/workflows/e2e-linux.yml +++ b/.github/workflows/e2e-linux.yml @@ -113,3 +113,25 @@ jobs: test/e2e/state/logs test/e2e/state/configs test/e2e/state/wallet_db + + - name: Slack Notification on failure + if: failure() + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':poop:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#FF0000' + + - name: Slack Notification on success + if: success() + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':rocket:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#00FF00' \ No newline at end of file diff --git a/.github/workflows/e2e-macos.yml b/.github/workflows/e2e-macos.yml index aacd65fd84d..f433d0d15e7 100644 --- a/.github/workflows/e2e-macos.yml +++ b/.github/workflows/e2e-macos.yml @@ -117,3 +117,30 @@ jobs: test/e2e/state/logs test/e2e/state/configs test/e2e/state/wallet_db + report: + needs: test + if: always() + runs-on: ubuntu-latest + steps: + + - name: Slack Notification on failure + if: needs.test.result != 'success' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':poop:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#FF0000' + + - name: Slack Notification on success + if: needs.test.result == 'success' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':rocket:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#00FF00' diff --git a/.github/workflows/e2e-windows.yml b/.github/workflows/e2e-windows.yml index 45b8977b3c4..ae4c7a5b1b4 100644 --- a/.github/workflows/e2e-windows.yml +++ b/.github/workflows/e2e-windows.yml @@ -27,6 +27,7 @@ jobs: BRANCH: ${{ github.event.inputs.branch || 'master' }} TAGS: ${{ github.event.inputs.tags || 'all' }} + steps: - name: Check space run: Get-PSDrive @@ -146,3 +147,32 @@ jobs: C:/cardano-wallet/test/e2e/state/logs C:/cardano-wallet/test/e2e/state/configs C:/cardano-wallet/test/e2e/state/wallet_db + + + + report: + needs: [test] + if: always() + runs-on: ubuntu-latest + steps: + - name: Slack Notification on failure + if: needs.test.result != 'success' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':poop:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#FF0000' + + - name: Slack Notification on success + if: needs.test.result == 'success' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':rocket:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#00FF00' \ No newline at end of file From 75c76df66d5888a8ab79fb95a53ad344958d30c0 Mon Sep 17 00:00:00 2001 From: paolino Date: Wed, 29 Nov 2023 11:03:07 +0000 Subject: [PATCH 08/13] Fix docker E2E --- .github/workflows/e2e-docker.yml | 99 ++++++++++++++++++++++---------- 1 file changed, 70 insertions(+), 29 deletions(-) diff --git a/.github/workflows/e2e-docker.yml b/.github/workflows/e2e-docker.yml index 99bb421c4fa..fc4da96e98b 100644 --- a/.github/workflows/e2e-docker.yml +++ b/.github/workflows/e2e-docker.yml @@ -30,6 +30,14 @@ jobs: runs-on: ubuntu-latest + env: + TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }} + BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }} + WALLET: ${{ github.event.inputs.walletTag || 'dev-master' }} + TESTS_E2E_TOKEN_METADATA: https://metadata.cardano-testnet.iohkdev.io/ + TAGS: ${{ github.event.inputs.tags || 'all' }} + E2E_DOCKER_RUN: 1 + steps: - uses: actions/checkout@v3.2.0 @@ -55,31 +63,37 @@ jobs: run: bundle install - name: ⚙️ Setup (get latest bins and configs and decode fixtures) - run: rake setup[$NETWORK] + run: rake setup[preprod] - - name: 🕒 Get Date/Time - id: date-time - shell: bash - run: | - echo "value=$(rake datetime)" >> $GITHUB_OUTPUT - name: 💾 Cache node db - id: cache + id: cache-node uses: actions/cache@v3 with: - path: test/e2e/state/node_db/${{ env.NETWORK }} - key: node-db-docker-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} - restore-keys: | - node-db-docker-${{ env.NETWORK }}- - node-db-Linux-${{ env.NETWORK }}- + path: test/e2e/state/node_db/preprod + key: node-db-docker-linux-preprod + + - name: Fetch preprod snapshot + if: steps.cache-node.outputs.cache-hit != 'true' + run: | + cd state + mkdir node_db + cd node_db + mkdir preprod + cd preprod + curl -s https://downloads.csnapshots.io/snapshots/testnet/testnet-db-snapshot.json \ + | jq -r .[].file_name > snapshot.json + curl -o - \ + https://downloads.csnapshots.io/snapshots/testnet/$(cat snapshot.json) \ + | lz4 -c -d - | tar -x -C . + mv db/* . - name: 💾 Cache wallet db id: cache-wallet uses: actions/cache@v3 with: - path: test/e2e/state/wallet_db/${{ env.NETWORK }} - key: wallet-db3-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }} - restore-keys: wallet-db3-docker-${{ env.NETWORK }}- + path: test/e2e/state/wallet_db/preprod + key: wallet-db-docker-linux-preprod - name: 🚀 Start node and wallet run: | @@ -87,9 +101,9 @@ jobs: echo "Node: ${{steps.cardano-node-tag.outputs.NODE_TAG}}" NODE=${{steps.cardano-node-tag.outputs.NODE_TAG}} \ - NODE_CONFIG_PATH=`pwd`/state/configs/$NETWORK \ - DATA=`pwd`/state/node_db/$NETWORK \ - WALLET_DATA=`pwd`/state/wallet_db/$NETWORK \ + NODE_CONFIG_PATH=`pwd`/state/configs/preprod \ + DATA=`pwd`/state/node_db/preprod \ + WALLET_DATA=`pwd`/state/wallet_db/preprod \ docker-compose -f docker-compose-test.yml up --detach - name: 🔍 Display versions @@ -111,17 +125,44 @@ jobs: uses: actions/upload-artifact@v3 if: always() with: - name: ${{ runner.os }}-docker-logs + name: linux-docker-logs path: test/e2e/state/logs - name: Stop docker-compose - run: NODE_CONFIG_PATH=`pwd`/state/configs/$NETWORK docker-compose -f docker-compose-test.yml down - env: - TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }} - BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }} - NETWORK: ${{ github.event.inputs.network || 'preprod' }} - WALLET: ${{ github.event.inputs.walletTag || 'dev-master' }} - TESTS_E2E_TOKEN_METADATA: https://metadata.cardano-testnet.iohkdev.io/ - NODE_DB_CACHE: ${{ github.event.inputs.node_db_cache || 'GH' }} - TAGS: ${{ github.event.inputs.tags || 'all' }} - E2E_DOCKER_RUN: 1 + run: NODE_CONFIG_PATH=`pwd`/state/configs/preprod docker-compose -f docker-compose-test.yml down + + - name: 💾 GH Save Cache of node db + if: always() + uses: actions/cache/save@v3 + with: + path: test/e2e/state/node_db/preprod + key: node-db-docker-linux-preprod + + - name: 💾 GH Save Cache of wallet db + if: always() + uses: actions/cache/save@v3 + with: + path: test/e2e/state/wallet_db/preprod + key: wallet-db-docker-linux-preprod + + - name: Slack Notification on failure + if: failure() + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':poop:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#FF0000' + + - name: Slack Notification on success + if: success() + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':rocket:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#00FF00' \ No newline at end of file From 49d6195130786f9ccdd1a0feaa6e1fc22207becd Mon Sep 17 00:00:00 2001 From: paolino Date: Wed, 29 Nov 2023 15:26:54 +0000 Subject: [PATCH 09/13] Add slack reporting for windows tests --- .github/workflows/windows.yml | 37 ++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3e2db9c6792..a2ad042795b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,4 +1,4 @@ -name: windows +name: Windows Unit Tests on: schedule: @@ -72,6 +72,41 @@ jobs: - run: '.\\cardano-wallet-launcher-test-unit.exe --color' continue-on-error: true + report: + needs: [cardano-wallet-test-unit, text-class-test-unit, cardano-wallet-launcher-test-unit] + if: always() + runs-on: ubuntu-latest + + steps: + - name: Slack Notification on failure + if: | + needs.cardano-wallet-launcher-test-unit.result != 'success' || + needs.cardano-wallet-test-unit.result != 'success' || + needs.text-class-test-unit.result != 'success' + + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':poop:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#FF0000' + + - name: Slack Notification on success + if: | + needs.cardano-wallet-launcher-test-unit.result == 'success' && + needs.cardano-wallet-test-unit.result == 'success' && + needs.text-class-test-unit.result == 'success' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':rocket:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#00FF00' + # ADP-2517 - Fix integration tests on Windows # cardano-wallet-test-integration: # name: 'cardano-wallet:integration' From a8ab136fb9adb6a145447ec3c8d768550e5a4b63 Mon Sep 17 00:00:00 2001 From: paolino Date: Thu, 30 Nov 2023 09:22:00 +0000 Subject: [PATCH 10/13] Fix docker-compose for macos test --- .github/workflows/docker_macos.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_macos.yml b/.github/workflows/docker_macos.yml index b7f03bc11a1..b8a958f9a95 100644 --- a/.github/workflows/docker_macos.yml +++ b/.github/workflows/docker_macos.yml @@ -17,7 +17,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3.2.0 - - uses: docker-practice/actions-setup-docker@1.0.11 + - uses: docker-practice/actions-setup-docker@master - uses: ruby/setup-ruby@v1.127.0 with: ruby-version: 2.7.1 @@ -29,3 +29,29 @@ jobs: ./scripts/connect_wallet.rb env: NETWORK: ${{ github.event.inputs.network || 'mainnet' }} + report: + needs: [build] + if: always() + runs-on: ubuntu-latest + steps: + - name: Slack Notification on failure + if: needs.build.result == 'failure' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':poop:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#FF0000' + + - name: Slack Notification on success + if: needs.build.result == 'success' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':rocket:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#00FF00' From e7ecb380bf928d4ca35875c02077541ce6a1a561 Mon Sep 17 00:00:00 2001 From: paolino Date: Thu, 30 Nov 2023 09:30:41 +0000 Subject: [PATCH 11/13] Fix docker-compose for linux test --- .github/workflows/docker_linux.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/docker_linux.yml b/.github/workflows/docker_linux.yml index d87b4348e5c..702b4d84a22 100644 --- a/.github/workflows/docker_linux.yml +++ b/.github/workflows/docker_linux.yml @@ -28,3 +28,29 @@ jobs: ./scripts/connect_wallet.rb env: NETWORK: ${{ github.event.inputs.network || 'mainnet' }} + report: + needs: [build] + if: always() + runs-on: ubuntu-latest + steps: + - name: Slack Notification on failure + if: needs.build.result == 'failure' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':poop:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#FF0000' + + - name: Slack Notification on success + if: needs.build.result == 'success' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_ICON_EMOJI: ':rocket:' + SLACK_USERNAME: 'GitHub Action' + SLACK_MESSAGE: | + *Job Link:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + SLACK_COLOR: '#00FF00' \ No newline at end of file From e5a0d59dcc59ec639b8d6aebaa061c36b58f87b3 Mon Sep 17 00:00:00 2001 From: paolino Date: Thu, 30 Nov 2023 09:31:43 +0000 Subject: [PATCH 12/13] Fix lean workflow --- .github/workflows/lean.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lean.yml b/.github/workflows/lean.yml index 4372ac48377..880a5b06db4 100644 --- a/.github/workflows/lean.yml +++ b/.github/workflows/lean.yml @@ -6,6 +6,7 @@ on: paths: ['specifications/**.lean'] pull_request: paths: ['specifications/**.lean'] + workflow_dispatch: permissions: contents: read From 85841710728180372458e59ebcb99fd585ccc462 Mon Sep 17 00:00:00 2001 From: paolino Date: Thu, 30 Nov 2023 11:47:44 +0000 Subject: [PATCH 13/13] Remove network parameter from workflows dispatch inputs --- .github/workflows/docker_linux.yml | 8 ++------ .github/workflows/docker_macos.yml | 8 ++------ .github/workflows/e2e-docker.yml | 4 ---- .github/workflows/e2e-linux.yml | 5 +---- .github/workflows/e2e-macos.yml | 5 +---- .github/workflows/e2e-windows.yml | 6 +----- 6 files changed, 7 insertions(+), 29 deletions(-) diff --git a/.github/workflows/docker_linux.yml b/.github/workflows/docker_linux.yml index 702b4d84a22..25c6c044f44 100644 --- a/.github/workflows/docker_linux.yml +++ b/.github/workflows/docker_linux.yml @@ -3,11 +3,7 @@ on: schedule: - cron: "0 23 * * *" workflow_dispatch: - inputs: - network: - description: 'NETWORK' - required: true - default: 'mainnet' + jobs: build: @@ -27,7 +23,7 @@ jobs: docker-compose up -d ./scripts/connect_wallet.rb env: - NETWORK: ${{ github.event.inputs.network || 'mainnet' }} + NETWORK: preprod report: needs: [build] if: always() diff --git a/.github/workflows/docker_macos.yml b/.github/workflows/docker_macos.yml index b8a958f9a95..4b5c5c7be40 100644 --- a/.github/workflows/docker_macos.yml +++ b/.github/workflows/docker_macos.yml @@ -3,11 +3,7 @@ on: schedule: - cron: "0 23 * * *" workflow_dispatch: - inputs: - network: - description: 'NETWORK' - required: true - default: 'mainnet' + jobs: build: @@ -28,7 +24,7 @@ jobs: docker-compose up -d ./scripts/connect_wallet.rb env: - NETWORK: ${{ github.event.inputs.network || 'mainnet' }} + NETWORK: preprod report: needs: [build] if: always() diff --git a/.github/workflows/e2e-docker.yml b/.github/workflows/e2e-docker.yml index fc4da96e98b..75a209cc3a0 100644 --- a/.github/workflows/e2e-docker.yml +++ b/.github/workflows/e2e-docker.yml @@ -13,10 +13,6 @@ on: description: 'Wallet tag (docker)' required: true default: 'dev-master' - network: - description: 'Network' - required: true - default: 'preprod' tags: description: 'Test tags (all, light, offchain...)' default: 'all' diff --git a/.github/workflows/e2e-linux.yml b/.github/workflows/e2e-linux.yml index 3019dfaa1a4..42dd0dd6d10 100644 --- a/.github/workflows/e2e-linux.yml +++ b/.github/workflows/e2e-linux.yml @@ -5,10 +5,7 @@ on: - cron: "0 20 * * *" workflow_dispatch: inputs: - network: - description: 'Network' - required: true - default: 'preprod' + branch: description: 'Run tests against branch' default: 'master' diff --git a/.github/workflows/e2e-macos.yml b/.github/workflows/e2e-macos.yml index f433d0d15e7..3b4703e3ab7 100644 --- a/.github/workflows/e2e-macos.yml +++ b/.github/workflows/e2e-macos.yml @@ -5,10 +5,7 @@ on: - cron: "0 20 * * *" workflow_dispatch: inputs: - network: - description: 'Network' - required: true - default: 'preprod' + branch: description: 'Run tests against branch' default: 'master' diff --git a/.github/workflows/e2e-windows.yml b/.github/workflows/e2e-windows.yml index ae4c7a5b1b4..ea2bdc9f345 100644 --- a/.github/workflows/e2e-windows.yml +++ b/.github/workflows/e2e-windows.yml @@ -5,10 +5,6 @@ on: - cron: "0 20 * * *" workflow_dispatch: inputs: - network: - description: 'Network' - required: true - default: 'preprod' branch: description: 'Run tests against branch' default: 'master' @@ -21,7 +17,7 @@ jobs: runs-on: windows-latest env: - NETWORK: ${{ github.event.inputs.network || 'preprod' }} + NETWORK: preprod BUILDKITE_API_TOKEN: ${{ secrets.BUILDKITE_TOKEN_READ_BUILDS_ARTIFACTS }} TESTS_E2E_FIXTURES: ${{ secrets.TESTS_E2E_FIXTURES }} BRANCH: ${{ github.event.inputs.branch || 'master' }}