From fd0786a96ca389df04d2eccb3120c006654728a0 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 23 Oct 2024 16:44:53 +0000 Subject: [PATCH 01/23] chore(CI): remove end-to-end/Earthfile --- .github/workflows/ci-arm.yml | 5 +- .github/workflows/ci.yml | 50 ++- .github/workflows/nightly-kind-test.yml | 3 +- .github/workflows/sepolia-test.yml | 10 +- Earthfile | 5 +- scripts/ci/get_e2e_compose_jobs.sh | 53 +++ scripts/ci/get_e2e_jobs.sh | 53 +-- scripts/ci/old_script.sh | 59 ++++ scripts/ci/select_runner.sh | 15 + yarn-project/end-to-end/Earthfile | 306 ------------------ .../end-to-end/scripts/compose_e2e_test_list | 11 + .../end-to-end/scripts/full_e2e_test_list | 61 ++++ yarn-project/end-to-end/scripts/test.sh | 7 + 13 files changed, 287 insertions(+), 351 deletions(-) create mode 100644 scripts/ci/get_e2e_compose_jobs.sh create mode 100755 scripts/ci/old_script.sh create mode 100644 scripts/ci/select_runner.sh delete mode 100644 yarn-project/end-to-end/Earthfile create mode 100644 yarn-project/end-to-end/scripts/compose_e2e_test_list create mode 100644 yarn-project/end-to-end/scripts/full_e2e_test_list create mode 100755 yarn-project/end-to-end/scripts/test.sh diff --git a/.github/workflows/ci-arm.yml b/.github/workflows/ci-arm.yml index 104914717e6..1ba74da9a63 100644 --- a/.github/workflows/ci-arm.yml +++ b/.github/workflows/ci-arm.yml @@ -3,7 +3,7 @@ on: push: branches: - master - - '*/*arm-build' + - "*/*arm-build" workflow_dispatch: inputs: {} concurrency: @@ -101,8 +101,9 @@ jobs: # prepare images locally, tagged by commit hash - name: "Build E2E Image" timeout-minutes: 40 + working-directory: ./yarn-project/end-to-end run: | - earthly-ci ./yarn-project/end-to-end+uniswap-trade-on-l1-from-l2 + ./scripts/e2e_compose_test.sh uniswap_trade_on_l1_from_l2.test.ts rerun-check: runs-on: ubuntu-20.04 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e0a50f16fc..0bab845c437 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: branches: - master - provernet - - '*/ci-push*' + - "*/ci-push*" pull_request: types: - opened @@ -170,6 +170,7 @@ jobs: fi echo Labels: $LABELS echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT + echo "compose_list=$(./scripts/ci/get_e2e_compose_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT - name: Create list of bench end-to-end jobs id: bench_list run: | @@ -194,24 +195,53 @@ jobs: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } - uses: ./.github/ci-setup-action + - name: Determine runner type + id: runner_type + run: | + runner=$(./scripts/select_runner.sh ${{ matrix.test }}) + echo "type=$runner" >> $GITHUB_OUTPUT - name: Setup and Test timeout-minutes: 40 uses: ./.github/ensure-tester-with-images env: USERNAME: ${{ needs.configure.outputs.username }} with: - runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '8core-tester-x86' }} + runner_type: ${{ steps.runner_type.outputs.type }} builder_type: builder-x86 - # these are copied to the tester and expected by the earthly command below - # if they fail to copy, it will try to build them on the tester and fail builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/end-to-end:${{ env.GIT_COMMIT }} - # command to produce the images in case they don't exist builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images run: | set -eux cd ./yarn-project/end-to-end/ export FORCE_COLOR=1 - ../../scripts/earthly-ci -P --no-output +${{ matrix.test }} + + # Handle env vars for certain tests + if [[ "$matrix.test" == *"fake_proofs"* ]]; then + export FAKE_PROOFS=1 + fi + if [[ "$matrix.test" == *"prover_full"* ]]; then + export HARDWARE_CONCURRENCY=32 + fi + + # Handle special cases for network tests + if [[ "$matrix.test" == *"kind_network"* ]]; then + if [[ "$matrix.test" == *"smoke"* ]]; then + NAMESPACE=smoke + elif [[ "$matrix.test" == *"transfer"* ]]; then + NAMESPACE=transfer + fi + if [[ "$matrix.test" == *"4epochs"* ]]; then + RUN NAMESPACE=$NAMESPACE FRESH_INSTALL=true VALUES_FILE=$-default.yaml ./scripts/network_test.sh ./src/spartan/4epochs.test.ts || true + else + RUN NAMESPACE=$NAMESPACE FRESH_INSTALL=true VALUES_FILE=$-default.yaml ./scripts/network_test.sh ./src/spartan/smoke.test.ts + fi + # Handle tests that need to be run with e2e_compose_test script + elif grep -qF "$matrix.test" yarn-project/end-to-end/scripts/compose_e2e_test_list; then + ./scripts/e2e_compose_test.sh ${{ matrix.test }} + else + # Default case + ./scripts/e2e_test.sh ${{ matrix.test }} + fi # all the benchmarking end-to-end integration tests for aztec (not required to merge) bench-e2e: @@ -245,7 +275,13 @@ jobs: cd ./yarn-project/end-to-end/ export FORCE_COLOR=1 export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" - ../../scripts/earthly-ci --exec-stats -P --no-output +${{ matrix.test }} + export COMPOSE_FILE=scripts/docker-compose-no-sandbox.yml + export DEBUG="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" + export HARDWARE_CONCURRENCY=32 + ./scripts/e2e_compose_test.sh ${{ matrix.test }} + + # redundant, but just to be explicit: + earthly-ci +UPLOAD_LOGS --PULL_REQUEST=${{ github.event.pull_request.number }} --BRANCH=${{ github.ref_name }} --COMMIT_HASH=${{ env.GIT_COMMIT }} acir-bench: runs-on: ubuntu-20.04 diff --git a/.github/workflows/nightly-kind-test.yml b/.github/workflows/nightly-kind-test.yml index 255835daa76..668dc341ca6 100644 --- a/.github/workflows/nightly-kind-test.yml +++ b/.github/workflows/nightly-kind-test.yml @@ -74,8 +74,7 @@ jobs: set -eux ./spartan/scripts/setup_local_k8s.sh export FORCE_COLOR=1 - export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" - ./scripts/earthly-ci --exec-stats -P --no-output ./yarn-project/end-to-end/+kind-network-transfer --values-file=${{ matrix.values_file }} + NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${{ matrix.values_file }} ./scripts/network_test.sh ./src/spartan/transfer.test.ts || true success-check: runs-on: ubuntu-20.04 diff --git a/.github/workflows/sepolia-test.yml b/.github/workflows/sepolia-test.yml index e2e6210f28a..b389302f2a5 100644 --- a/.github/workflows/sepolia-test.yml +++ b/.github/workflows/sepolia-test.yml @@ -54,11 +54,11 @@ jobs: set -eux cd ./yarn-project/end-to-end/ export FORCE_COLOR=1 - ../../scripts/earthly-ci -P --no-output +e2e-public-testnet \ - --SEQ_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_SEQ_PRIVATE_KEY }} \ - --PROVER_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_PROVER_PRIVATE_KEY }} \ - --ETHEREUM_HOST="https://sepolia.infura.io/v3/${{ secrets.SEPOLIA_API_KEY }}" \ - --L1_CHAIN_ID=${{ env.L1_CHAIN_ID }} + SEQ_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_SEQ_PRIVATE_KEY }} \ + PROVER_PUBLISHER_PRIVATE_KEY=${{ secrets.SEPOLIA_PROVER_PRIVATE_KEY }} \ + ETHEREUM_HOST="https://sepolia.infura.io/v3/${{ secrets.SEPOLIA_API_KEY }}" \ + L1_CHAIN_ID=${{ env.L1_CHAIN_ID }} \ + ./scripts/e2e_test_public_testnet.sh ./src/public-testnet success-check: runs-on: ubuntu-20.04 diff --git a/Earthfile b/Earthfile index f8eea6475ba..ed020738d41 100644 --- a/Earthfile +++ b/Earthfile @@ -20,9 +20,6 @@ build: # yarn-project has the entry point to Aztec BUILD ./yarn-project/+build -test-end-to-end: - BUILD ./yarn-project/end-to-end+e2e-tests - release-meta: COPY .release-please-manifest.json /usr/src/.release-please-manifest.json SAVE ARTIFACT /usr/src /usr/src @@ -46,7 +43,7 @@ UPLOAD_LOGS: ENV BRANCH=$BRANCH ENV COMMIT_HASH=$COMMIT_HASH RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log - + base-log-uploader: # Install awscli on a fresh ubuntu, and copy the repo "scripts" folder, which we'll use to upload logs # Note that we cannot do this LOCALLY because Earthly does not support using secrets locally diff --git a/scripts/ci/get_e2e_compose_jobs.sh b/scripts/ci/get_e2e_compose_jobs.sh new file mode 100644 index 00000000000..68b00eb5c7d --- /dev/null +++ b/scripts/ci/get_e2e_compose_jobs.sh @@ -0,0 +1,53 @@ +#!/bin/bash +set -eu + +# Enter repo root. +cd "$(dirname "$0")"/../.. + +BRANCH=$1 +LABELS=$2 + +# Read the full list from the file +full_list=$(cat yarn-project/end-to-end/scripts/full_e2e_test_list) + +# Define that need the compose_test script to run +compose_list=( + e2e_sandbox_example + uniswap_trade_on_l1_from_l2 + integration_l1_publisher + e2e_browser + pxe + e2e_docs_examples + guides/writing_an_account_contract + guides/dapp_testing + sample-dapp/ci/index.test.mjs + sample-dapp/index.test.mjs + guides/up_quick_start +) + +# Add labels from input to the allow_list +IFS=',' read -r -a input_labels <<<"$LABELS" +allow_list+=("${input_labels[@]}") + +# Generate full list of targets, excluding specific entries, on one line +test_list=$(echo "${full_list[@]}" | grep -v 'base' | grep -v 'bench' | grep -v "network" | grep -v 'devnet' | xargs echo) + +# # If branch is master or allow_list contains 'e2e-all', return full list +if [[ "$BRANCH" == "master" ]] || [[ " ${allow_list[@]} " =~ "e2e-all" ]]; then + # print as JSON list + echo "$test_list" | jq -Rc 'split(" ")' + exit 0 +fi + +# # Filter the test_list to include only items in the allow_list +filtered_list=() +for item in $test_list; do + for allowed in "${allow_list[@]}"; do + if [[ "$item" == "$allowed" ]]; then + filtered_list+=("$item") + fi + done +done + +# # Print the filtered list in JSON format +echo ${filtered_list[@]} | jq -Rc 'split(" ")' diff --git a/scripts/ci/get_e2e_jobs.sh b/scripts/ci/get_e2e_jobs.sh index 7203bdfa432..9c1ee30c6bf 100755 --- a/scripts/ci/get_e2e_jobs.sh +++ b/scripts/ci/get_e2e_jobs.sh @@ -7,45 +7,48 @@ cd "$(dirname "$0")"/../.. BRANCH=$1 LABELS=$2 +# Read the full list from the file +full_list=$(cat yarn-project/end-to-end/scripts/full_e2e_test_list) + # Define the jobs that will run on every PR allow_list=( - "e2e-2-pxes" - "e2e-authwit" - "e2e-avm-simulator" - "e2e-block-building" - "e2e-cross-chain-messaging" - "e2e-deploy-contract" - "e2e-fees" - "e2e-fees-gas-estimation" - "e2e-fees-private-payments" - "e2e-max-block-number" - "e2e-nested-contract" - "e2e-ordering" - "e2e-static-calls" - "integration-l1-publisher" - "e2e-cheat-codes" - "e2e-prover-fake-proofs" - "e2e-lending-contract" - "kind-network-smoke" + "e2e_2_pxes" + "e2e_authwit" + "e2e_avm_simulator" + "e2e_block_building" + "e2e_cross_chain_messaging" + "e2e_deploy_contract" + "e2e_fees" + "e2e_fees_gas_estimation" + "e2e_fees_private_payments" + "e2e_max_block_number" + "e2e_nested_contract" + "e2e_ordering" + "e2e_static_calls" + "integration_l1_publisher" + "e2e_cheat_codes" + "e2e_prover_fake_proofs" + "e2e_lending_contract" + "kind_network_smoke" ) # Add labels from input to the allow_list -IFS=',' read -r -a input_labels <<< "$LABELS" +IFS=',' read -r -a input_labels <<<"$LABELS" allow_list+=("${input_labels[@]}") # Generate full list of targets, excluding specific entries, on one line -full_list=$(earthly ls ./yarn-project/end-to-end | grep -v '+base' | grep -v '+bench' | grep -v "+network" | grep -v 'devnet' | sed 's/+//' | xargs echo) +test_list=$(echo "${full_list[@]}" | grep -v 'base' | grep -v 'bench' | grep -v "network" | grep -v 'devnet' | xargs echo) -# If branch is master or allow_list contains 'e2e-all', return full list +# # If branch is master or allow_list contains 'e2e-all', return full list if [[ "$BRANCH" == "master" ]] || [[ " ${allow_list[@]} " =~ "e2e-all" ]]; then # print as JSON list - echo "$full_list" | jq -Rc 'split(" ")' + echo "$test_list" | jq -Rc 'split(" ")' exit 0 fi -# Filter the full_list to include only items in the allow_list +# # Filter the test_list to include only items in the allow_list filtered_list=() -for item in $full_list; do +for item in $test_list; do for allowed in "${allow_list[@]}"; do if [[ "$item" == "$allowed" ]]; then filtered_list+=("$item") @@ -53,5 +56,5 @@ for item in $full_list; do done done -# Print the filtered list in JSON format +# # Print the filtered list in JSON format echo ${filtered_list[@]} | jq -Rc 'split(" ")' diff --git a/scripts/ci/old_script.sh b/scripts/ci/old_script.sh new file mode 100755 index 00000000000..4805fbd265c --- /dev/null +++ b/scripts/ci/old_script.sh @@ -0,0 +1,59 @@ +#!/bin/bash +set -eu + +# Enter repo root. +cd "$(dirname "$0")"/../.. + +BRANCH=$1 +LABELS=$2 + +# Define the jobs that will run on every PR +allow_list=( + "e2e-2-pxes" + "e2e-authwit" + "e2e-avm-simulator" + "e2e-block-building" + "e2e-cross-chain-messaging" + "e2e-deploy-contract" + "e2e-fees" + "e2e-fees-gas-estimation" + "e2e-fees-private-payments" + "e2e-max-block-number" + "e2e-nested-contract" + "e2e-ordering" + "e2e-static-calls" + "integration-l1-publisher" + "e2e-cheat-codes" + "e2e-prover-fake-proofs" + "e2e-lending-contract" + "kind-network-smoke" +) + +# Add labels from input to the allow_list +IFS=',' read -r -a input_labels <<<"$LABELS" +allow_list+=("${input_labels[@]}") + +# Generate full list of targets, excluding specific entries, on one line +full_list=$(earthly ls ./yarn-project/end-to-end | grep -v '+base' | grep -v '+bench' | grep -v "+network" | grep -v 'devnet' | sed 's/+//' | xargs echo) + +echo "Full list: $full_list" + +# If branch is master or allow_list contains 'e2e-all', return full list +if [[ "$BRANCH" == "master" ]] || [[ " ${allow_list[@]} " =~ "e2e-all" ]]; then + # print as JSON list + echo "$full_list" | jq -Rc 'split(" ")' + exit 0 +fi + +# Filter the full_list to include only items in the allow_list +filtered_list=() +for item in $full_list; do + for allowed in "${allow_list[@]}"; do + if [[ "$item" == "$allowed" ]]; then + filtered_list+=("$item") + fi + done +done + +# Print the filtered list in JSON format +echo ${filtered_list[@]} | jq -Rc 'split(" ")' diff --git a/scripts/ci/select_runner.sh b/scripts/ci/select_runner.sh new file mode 100644 index 00000000000..d8cc89d40c1 --- /dev/null +++ b/scripts/ci/select_runner.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Check if the test requires a prover +requires_prover() { + local test_name=$1 + [[ $test_name == *"prover"* ]] +} + +test_name=$1 + +if requires_prover "$test_name"; then + echo "64core-tester-x86" +else + echo "8core-tester-x86" +fi diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile deleted file mode 100644 index a2ce9b24853..00000000000 --- a/yarn-project/end-to-end/Earthfile +++ /dev/null @@ -1,306 +0,0 @@ -VERSION 0.8 - -# Flakey, TODO(https://github.com/AztecProtocol/aztec-packages/issues/9164) -# e2e-p2p: -# LOCALLY -# RUN ./scripts/e2e_test.sh ./src/e2e_p2p/ --runInBand - -e2e-l1-with-wall-time: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_l1_with_wall_time.test.ts - -e2e-synching: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_synching.test.ts - -e2e-2-pxes: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_2_pxes.test.ts - -e2e-nft: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_nft.test.ts - -e2e-prover-full: - LOCALLY - RUN HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-32} ./scripts/e2e_test.sh ./src/e2e_prover/full - -e2e-prover-fake-proofs: - LOCALLY - RUN FAKE_PROOFS=1 ./scripts/e2e_test.sh ./src/e2e_prover/full - -e2e-account-contracts: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_account_contracts.test.ts - -e2e-authwit: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_authwit.test.ts - -e2e-avm-simulator: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_avm_simulator.test.ts - -e2e-blacklist-token-contract: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_blacklist_token_contract - -e2e-block-building: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_block_building.test.ts - -e2e-bot: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_bot.test.ts - -e2e-card-game: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_card_game.test.ts - -e2e-cheat-codes: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_cheat_codes.test.ts - -e2e-crowdfunding-and-claim: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_crowdfunding_and_claim.test.ts - -e2e-deploy-contract: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_deploy_contract - -e2e-escrow-contract: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_escrow_contract.test.ts - -e2e-keys: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_keys.test.ts - -e2e-lending-contract: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_lending_contract.test.ts - -e2e-max-block-number: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_max_block_number.test.ts - -e2e-multiple-accounts-1-enc-key: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_multiple_accounts_1_enc_key.test.ts - -e2e-nested-contract: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_nested_contract - -e2e-non-contract-account: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_non_contract_account.test.ts - -e2e-note-getter: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_note_getter.test.ts - -e2e-ordering: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_ordering.test.ts - -e2e-outbox: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_outbox.test.ts - -e2e-pending-note-hashes-contract: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_pending_note_hashes_contract.test.ts - -e2e-private-voting-contract: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_private_voting_contract.test.ts - -e2e-fees-private-payments: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_fees/private_payments.test.ts - -e2e-fees-private-refunds: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_fees/private_refunds.test.ts - -e2e-fees-gas-estimation: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_fees/gas_estimation.test.ts - -e2e-fees-dapp-subscription: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_fees/dapp_subscription.test.ts - -e2e-fees-failures: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_fees/failures.test.ts - -e2e-fees-fee-juice-payments: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_fees/fee_juice_payments.test.ts - -e2e-fees-account-init: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_fees/account_init.test.ts - -e2e-cross-chain-messaging: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_cross_chain_messaging - -e2e-state-vars: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_state_vars.test.ts - -e2e-logs: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_event_logs.test.ts - -e2e-static-calls: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_static_calls.test.ts - -e2e-token-contract: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/e2e_token_contract - -# https://github.com/AztecProtocol/aztec-packages/issues/8925 -# e2e-prover-coordination: -# LOCALLY -# RUN ./scripts/e2e_test.sh ./src/prover-coordination/e2e_json_coordination.test.ts - -e2e-public-testnet: - ARG L1_CHAIN_ID="31337" - # automatically exported as ENV variables for below - ARG ETHEREUM_HOST - ARG SEQ_PUBLISHER_PRIVATE_KEY - ARG PROVER_PUBLISHER_PRIVATE_KEY - LOCALLY - RUN ./scripts/e2e_test_public_testnet.sh ./src/public-testnet - -flakey-e2e-tests: - LOCALLY - RUN ./scripts/e2e_test.sh ./src/flakey || true - -e2e-sandbox-example: - LOCALLY - RUN ./scripts/e2e_compose_test.sh e2e_sandbox_example.test.ts - -uniswap-trade-on-l1-from-l2: - LOCALLY - RUN ./scripts/e2e_compose_test.sh uniswap_trade_on_l1_from_l2.test.ts - -integration-l1-publisher: - LOCALLY - RUN ./scripts/e2e_compose_test.sh integration_l1_publisher.test.ts - -# Disabled, TODO https://github.com/AztecProtocol/aztec-packages/issues/6624 -# integration-proof-verification: -# LOCALLY -# RUN COMPOSE_FILE=./scripts/docker-compose-no-sandbox.yml ./scripts/e2e_compose_test.sh integration_proof_verification.test.ts - -e2e-browser: - LOCALLY - RUN ./scripts/e2e_compose_test.sh e2e_aztec_js_browser.test.ts - -pxe: - LOCALLY - RUN ./scripts/e2e_compose_test.sh pxe.test.ts - -e2e-docs-examples: - LOCALLY - RUN ./scripts/e2e_compose_test.sh docs_examples.test.ts - -guides-writing-an-account-contract: - LOCALLY - RUN ./scripts/e2e_compose_test.sh guides/writing_an_account_contract.test.ts - -guides-dapp-testing: - LOCALLY - RUN ./scripts/e2e_compose_test.sh guides/dapp_testing.test.ts - -# The two tests below need to be separated, because there is some crosstalk between the two. TODO (#8813): Figure out why. -guides-sample-dapp-ci: - LOCALLY - RUN ./scripts/e2e_compose_test.sh sample-dapp/ci/index.test.mjs - -guides-sample-dapp: - LOCALLY - RUN ./scripts/e2e_compose_test.sh sample-dapp/index.test.mjs - -guides-up-quick-start: - LOCALLY - RUN ./scripts/e2e_compose_test.sh guides/up_quick_start.test.ts - -bench-publish-rollup: - LOCALLY - ENV COMPOSE_FILE=scripts/docker-compose-no-sandbox.yml - ENV DEBUG="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" - ENV HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-32} - # redundant, but just to be explicit: - ENV PULL_REQUEST=$PULL_REQUEST - ENV BRANCH=$BRANCH - ENV COMMIT_HASH=$COMMIT_HASH - RUN ./scripts/e2e_compose_test.sh benchmarks/bench_publish_rollup.test.ts - DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH - -# TODO(#9359): regressed seemingly after changes to reorgs -#bench-process-history: -# LOCALLY -# ENV COMPOSE_FILE=scripts/docker-compose-no-sandbox.yml -# ENV DEBUG="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" -# ENV HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-32} -# # redundant, but just to be explicit: -# ENV PULL_REQUEST=$PULL_REQUEST -# ENV BRANCH=$BRANCH -# ENV COMMIT_HASH=$COMMIT_HASH -# RUN ./scripts/e2e_compose_test.sh benchmarks/bench_process_history.test.ts -# DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH - -bench-tx-size: - LOCALLY - ENV COMPOSE_FILE=scripts/docker-compose-no-sandbox.yml - ENV DEBUG="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" - ENV HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-32} - # redundant, but just to be explicit: - ENV PULL_REQUEST=$PULL_REQUEST - ENV BRANCH=$BRANCH - ENV COMMIT_HASH=$COMMIT_HASH - RUN ./scripts/e2e_compose_test.sh benchmarks/bench_tx_size_fees.test.ts - DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH - -bench-prover: - LOCALLY - ENV COMPOSE_FILE=scripts/docker-compose-no-sandbox.yml - ENV DEBUG="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" - ENV HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-32} - # redundant, but just to be explicit: - ENV PULL_REQUEST=$PULL_REQUEST - ENV BRANCH=$BRANCH - ENV COMMIT_HASH=$COMMIT_HASH - RUN ./scripts/e2e_compose_test.sh bench_prover - DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH - -e2e-devnet-smoke: - LOCALLY - RUN COMPOSE_FILE=scripts/docker-compose-devnet.yml ./scripts/e2e_compose_test.sh devnet/e2e_smoke.test.ts - -e2e-cli-wallet: - LOCALLY - RUN COMPOSE_FILE=scripts/docker-compose-wallet.yml ./scripts/e2e_compose_test.sh e2e_cli_wallet - -kind-network-smoke: - ARG values_file - LOCALLY - RUN NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/smoke.test.ts - -kind-network-transfer: - ARG values_file - LOCALLY - RUN NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/transfer.test.ts - -kind-network-4epochs: - ARG values_file - LOCALLY - RUN NAMESPACE=transfer FRESH_INSTALL=true VALUES_FILE=${values_file:-default.yaml} ./scripts/network_test.sh ./src/spartan/4epochs.test.ts || true diff --git a/yarn-project/end-to-end/scripts/compose_e2e_test_list b/yarn-project/end-to-end/scripts/compose_e2e_test_list new file mode 100644 index 00000000000..459f0ef61e7 --- /dev/null +++ b/yarn-project/end-to-end/scripts/compose_e2e_test_list @@ -0,0 +1,11 @@ +e2e_sandbox_example +uniswap_trade_on_l1_from_l2 +integration_l1_publisher +e2e_browser +pxe +e2e_docs_examples +guides/writing_an_account_contract +guides/dapp_testing +sample-dapp/ci/index.test.mjs +sample-dapp/index.test.mjs +guides/up_quick_start \ No newline at end of file diff --git a/yarn-project/end-to-end/scripts/full_e2e_test_list b/yarn-project/end-to-end/scripts/full_e2e_test_list new file mode 100644 index 00000000000..347e4b339fc --- /dev/null +++ b/yarn-project/end-to-end/scripts/full_e2e_test_list @@ -0,0 +1,61 @@ +base +bench_prover +bench_publish_rollup +bench_tx_size +e2e_2_pxes +e2e_account_contracts +e2e_authwit +e2e_avm_simulator +e2e_blacklist_token_contract +e2e_block_building +e2e_bot +e2e_browser +e2e_card_game +e2e_cheat_codes +e2e_cli_wallet +e2e_cross_chain_messaging +e2e_crowdfunding_and_claim +e2e_deploy_contract +e2e_devnet_smoke +e2e_docs_examples +e2e_escrow_contract +e2e_fees_account_init +e2e_fees_dapp_subscription +e2e_fees_failures +e2e_fees_fee_juice_payments +e2e_fees_gas_estimation +e2e_fees_private_payments +e2e_fees_private_refunds +e2e_keys +e2e_l1_with_wall_time +e2e_lending_contract +e2e_logs +e2e_max_block_number +e2e_multiple_accounts_1_enc_key +e2e_nested_contract +e2e_nft +e2e_non_contract_account +e2e_note_getter +e2e_ordering +e2e_outbox +e2e_pending_note_hashes_contract +e2e_private_voting_contract +e2e_prover_fake_proofs +e2e_prover_full +e2e_public_testnet +e2e_sandbox_example +e2e_state_vars +e2e_static_calls +e2e_synching +e2e_token_contract +flakey_e2e_tests +guides_dapp_testing +guides_sample_dapp +guides_sample_dapp_ci +guides_up_quick_start +guides_writing_an_account_contract +integration_l1_publisher +kind_network_4epochs +kind_network_smoke +kind_network_transfer +pxe diff --git a/yarn-project/end-to-end/scripts/test.sh b/yarn-project/end-to-end/scripts/test.sh new file mode 100755 index 00000000000..5836448e9a0 --- /dev/null +++ b/yarn-project/end-to-end/scripts/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if grep -qF "$1" ./compose_e2e_test_list; then + echo "Running compose test" +else + echo "Running normal test" +fi From 098dc2766960c13086ac0416b16b8b3c483b83d2 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 23 Oct 2024 17:37:08 +0000 Subject: [PATCH 02/23] add test_config.yml, remove logic from ci.yml --- .github/workflows/ci.yml | 35 +----- scripts/ci/get_e2e_jobs.sh | 11 +- .../end-to-end/scripts/compose_e2e_test_list | 11 -- yarn-project/end-to-end/scripts/e2e_test.sh | 63 +++++++++- .../end-to-end/scripts/e2e_test_config.yml | 108 ++++++++++++++++++ .../end-to-end/scripts/full_e2e_test_list | 61 ---------- yarn-project/end-to-end/scripts/test.sh | 7 -- 7 files changed, 181 insertions(+), 115 deletions(-) delete mode 100644 yarn-project/end-to-end/scripts/compose_e2e_test_list create mode 100644 yarn-project/end-to-end/scripts/e2e_test_config.yml delete mode 100644 yarn-project/end-to-end/scripts/full_e2e_test_list delete mode 100755 yarn-project/end-to-end/scripts/test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bab845c437..d8cffc3d3c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -214,34 +214,7 @@ jobs: set -eux cd ./yarn-project/end-to-end/ export FORCE_COLOR=1 - - # Handle env vars for certain tests - if [[ "$matrix.test" == *"fake_proofs"* ]]; then - export FAKE_PROOFS=1 - fi - if [[ "$matrix.test" == *"prover_full"* ]]; then - export HARDWARE_CONCURRENCY=32 - fi - - # Handle special cases for network tests - if [[ "$matrix.test" == *"kind_network"* ]]; then - if [[ "$matrix.test" == *"smoke"* ]]; then - NAMESPACE=smoke - elif [[ "$matrix.test" == *"transfer"* ]]; then - NAMESPACE=transfer - fi - if [[ "$matrix.test" == *"4epochs"* ]]; then - RUN NAMESPACE=$NAMESPACE FRESH_INSTALL=true VALUES_FILE=$-default.yaml ./scripts/network_test.sh ./src/spartan/4epochs.test.ts || true - else - RUN NAMESPACE=$NAMESPACE FRESH_INSTALL=true VALUES_FILE=$-default.yaml ./scripts/network_test.sh ./src/spartan/smoke.test.ts - fi - # Handle tests that need to be run with e2e_compose_test script - elif grep -qF "$matrix.test" yarn-project/end-to-end/scripts/compose_e2e_test_list; then - ./scripts/e2e_compose_test.sh ${{ matrix.test }} - else - # Default case - ./scripts/e2e_test.sh ${{ matrix.test }} - fi + ./scripts/e2e_test.sh ${{ matrix.test }} # all the benchmarking end-to-end integration tests for aztec (not required to merge) bench-e2e: @@ -275,12 +248,8 @@ jobs: cd ./yarn-project/end-to-end/ export FORCE_COLOR=1 export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" - export COMPOSE_FILE=scripts/docker-compose-no-sandbox.yml - export DEBUG="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" - export HARDWARE_CONCURRENCY=32 - ./scripts/e2e_compose_test.sh ${{ matrix.test }} + ./scripts/e2e_test.sh ${{ matrix.test }} - # redundant, but just to be explicit: earthly-ci +UPLOAD_LOGS --PULL_REQUEST=${{ github.event.pull_request.number }} --BRANCH=${{ github.ref_name }} --COMMIT_HASH=${{ env.GIT_COMMIT }} acir-bench: diff --git a/scripts/ci/get_e2e_jobs.sh b/scripts/ci/get_e2e_jobs.sh index 9c1ee30c6bf..be76e7581cc 100755 --- a/scripts/ci/get_e2e_jobs.sh +++ b/scripts/ci/get_e2e_jobs.sh @@ -7,8 +7,15 @@ cd "$(dirname "$0")"/../.. BRANCH=$1 LABELS=$2 -# Read the full list from the file -full_list=$(cat yarn-project/end-to-end/scripts/full_e2e_test_list) +# Function to parse YAML and extract test names +get_test_names() { + yq e '.tests | keys | .[]' yarn-project/end-to-end/scripts/e2e_test_config.yml +} + +# Read the full list from the YAML file +full_list=$(get_test_names) + +echo "Full list: $full_list" # Define the jobs that will run on every PR allow_list=( diff --git a/yarn-project/end-to-end/scripts/compose_e2e_test_list b/yarn-project/end-to-end/scripts/compose_e2e_test_list deleted file mode 100644 index 459f0ef61e7..00000000000 --- a/yarn-project/end-to-end/scripts/compose_e2e_test_list +++ /dev/null @@ -1,11 +0,0 @@ -e2e_sandbox_example -uniswap_trade_on_l1_from_l2 -integration_l1_publisher -e2e_browser -pxe -e2e_docs_examples -guides/writing_an_account_contract -guides/dapp_testing -sample-dapp/ci/index.test.mjs -sample-dapp/index.test.mjs -guides/up_quick_start \ No newline at end of file diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index 3dcf49edfac..a5702385a73 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -3,6 +3,8 @@ # Usage: ./e2e_test.sh <...extra_args> # Optional environment variables: # HARDWARE_CONCURRENCY (default: "") +# FAKE_PROOFS (default: "") +# COMPOSE_FILE (default: "./scripts/docker-compose.yml") set -eu @@ -13,11 +15,70 @@ shift # Default values for environment variables HARDWARE_CONCURRENCY="${HARDWARE_CONCURRENCY:-}" FAKE_PROOFS="${FAKE_PROOFS:-}" +COMPOSE_FILE="${COMPOSE_FILE:-./scripts/docker-compose.yml}" AZTEC_DOCKER_TAG=$(git rev-parse HEAD) +# Function to load test configuration +load_test_config() { + local test_name="$1" + yq e ".tests.${test_name}" yarn-project/end-to-end/scripts/e2e_test_config.yml +} + +# Check if Docker images exist if ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG"; then echo "Docker images not found. They need to be built with 'earthly ./yarn-project/+export-end-to-end' or otherwise tagged with aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG." exit 1 fi -docker run -e HARDWARE_CONCURRENCY="$HARDWARE_CONCURRENCY" -e FAKE_PROOFS="$FAKE_PROOFS" --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG "$TEST" $@ +# Function to run docker compose +run_docker_compose() { + local test_name=$1 + shift + + # Compute project_name + local project_name=$(echo "$test_name" | sed 's/\./_/g' | sed 's/\//_/g') + + # Determine CMD + if docker compose >/dev/null 2>&1; then + local CMD="docker compose" + else + local CMD="docker-compose" + fi + + # Run docker compose + $CMD -p "$project_name" -f "$COMPOSE_FILE" up --exit-code-from=end-to-end --force-recreate "$@" +} + +# Load test configuration +test_config=$(load_test_config "$TEST") + +# Check if the test uses docker compose +if [ "$(echo "$test_config" | yq e '.use_compose // false' -)" = "true" ]; then + run_docker_compose "$TEST" "$@" +else + # Set environment variables + while IFS='=' read -r key value; do + export "$key=$value" + done < <(echo "$test_config" | yq e '.env // {} | to_entries | .[] | .key + "=" + .value' -) + + # Check for custom command + custom_command=$(echo "$test_config" | yq e '.command // ""' -) + env_args=$(echo "$test_config" | yq e '.env // {} | to_entries | .[] | "-e " + .key + "=" + .value' - | tr '\n' ' ') + if [ -n "$custom_command" ]; then + # Run the docker command + docker run \ + -e HARDWARE_CONCURRENCY="$HARDWARE_CONCURRENCY" \ + -e FAKE_PROOFS="$FAKE_PROOFS" \ + $env_args \ + --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG \ + /bin/bash -c "$custom_command" + else + # Run the default docker command + docker run \ + -e HARDWARE_CONCURRENCY="$HARDWARE_CONCURRENCY" \ + -e FAKE_PROOFS="$FAKE_PROOFS" \ + $env_args \ + --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG \ + "$TEST" "$@" + fi +fi diff --git a/yarn-project/end-to-end/scripts/e2e_test_config.yml b/yarn-project/end-to-end/scripts/e2e_test_config.yml new file mode 100644 index 00000000000..7e94d75ca59 --- /dev/null +++ b/yarn-project/end-to-end/scripts/e2e_test_config.yml @@ -0,0 +1,108 @@ +tests: + base: {} + bench_prover: + env: + HARDWARE_CONCURRENCY: "32" + COMPOSE_FILE: "scripts/docker-compose-no-sandbox.yml" + DEBUG: "aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" + command: "./scripts/e2e_compose_test.sh bench_prover" + bench_publish_rollup: + env: + HARDWARE_CONCURRENCY: "32" + COMPOSE_FILE: "scripts/docker-compose-no-sandbox.yml" + DEBUG: "aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" + command: "./scripts/e2e_compose_test.sh bench_publish_rollup" + bench_tx_size: + env: + HARDWARE_CONCURRENCY: "32" + COMPOSE_FILE: "scripts/docker-compose-no-sandbox.yml" + DEBUG: "aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" + command: "./scripts/e2e_compose_test.sh bench_tx_size" + e2e_2_pxes: {} + e2e_account_contracts: {} + e2e_authwit: {} + e2e_avm_simulator: {} + e2e_blacklist_token_contract: {} + e2e_block_building: {} + e2e_bot: {} + e2e_browser: + use_compose: true + e2e_card_game: {} + e2e_cheat_codes: {} + e2e_cli_wallet: {} + e2e_cross_chain_messaging: {} + e2e_crowdfunding_and_claim: {} + e2e_deploy_contract: {} + e2e_devnet_smoke: {} + e2e_docs_examples: + use_compose: true + e2e_escrow_contract: {} + e2e_fees_account_init: {} + e2e_fees_dapp_subscription: {} + e2e_fees_failures: {} + e2e_fees_fee_juice_payments: {} + e2e_fees_gas_estimation: {} + e2e_fees_private_payments: {} + e2e_fees_private_refunds: {} + e2e_keys: {} + e2e_l1_with_wall_time: {} + e2e_lending_contract: {} + e2e_logs: {} + e2e_max_block_number: {} + e2e_multiple_accounts_1_enc_key: {} + e2e_nested_contract: {} + e2e_nft: {} + e2e_non_contract_account: {} + e2e_note_getter: {} + e2e_ordering: {} + e2e_outbox: {} + e2e_pending_note_hashes_contract: {} + e2e_private_voting_contract: {} + e2e_prover_fake_proofs: + env: + FAKE_PROOFS: "1" + e2e_prover_full: + env: + HARDWARE_CONCURRENCY: "32" + e2e_public_testnet: {} + e2e_sandbox_example: + use_compose: true + e2e_state_vars: {} + e2e_static_calls: {} + e2e_synching: {} + e2e_token_contract: {} + flakey_e2e_tests: {} + guides_dapp_testing: + use_compose: true + guides_sample_dapp: + use_compose: true + guides_sample_dapp_ci: + use_compose: true + guides_up_quick_start: + use_compose: true + guides_writing_an_account_contract: + use_compose: true + integration_l1_publisher: + use_compose: true + kind_network_4epochs: + env: + NAMESPACE: "smoke" + FRESH_INSTALL: "true" + VALUES_FILE: "$-default.yaml" + command: "./scripts/network_test.sh ./src/spartan/4epochs.test.ts || true" + kind_network_smoke: + env: + NAMESPACE: "smoke" + FRESH_INSTALL: "true" + VALUES_FILE: "$-default.yaml" + command: "./scripts/network_test.sh ./src/spartan/smoke.test.ts" + kind_network_transfer: + env: + NAMESPACE: "transfer" + FRESH_INSTALL: "true" + VALUES_FILE: "$-default.yaml" + command: "./scripts/network_test.sh ./src/spartan/smoke.test.ts" + pxe: + use_compose: true + uniswap_trade_on_l1_from_l2: + use_compose: true diff --git a/yarn-project/end-to-end/scripts/full_e2e_test_list b/yarn-project/end-to-end/scripts/full_e2e_test_list deleted file mode 100644 index 347e4b339fc..00000000000 --- a/yarn-project/end-to-end/scripts/full_e2e_test_list +++ /dev/null @@ -1,61 +0,0 @@ -base -bench_prover -bench_publish_rollup -bench_tx_size -e2e_2_pxes -e2e_account_contracts -e2e_authwit -e2e_avm_simulator -e2e_blacklist_token_contract -e2e_block_building -e2e_bot -e2e_browser -e2e_card_game -e2e_cheat_codes -e2e_cli_wallet -e2e_cross_chain_messaging -e2e_crowdfunding_and_claim -e2e_deploy_contract -e2e_devnet_smoke -e2e_docs_examples -e2e_escrow_contract -e2e_fees_account_init -e2e_fees_dapp_subscription -e2e_fees_failures -e2e_fees_fee_juice_payments -e2e_fees_gas_estimation -e2e_fees_private_payments -e2e_fees_private_refunds -e2e_keys -e2e_l1_with_wall_time -e2e_lending_contract -e2e_logs -e2e_max_block_number -e2e_multiple_accounts_1_enc_key -e2e_nested_contract -e2e_nft -e2e_non_contract_account -e2e_note_getter -e2e_ordering -e2e_outbox -e2e_pending_note_hashes_contract -e2e_private_voting_contract -e2e_prover_fake_proofs -e2e_prover_full -e2e_public_testnet -e2e_sandbox_example -e2e_state_vars -e2e_static_calls -e2e_synching -e2e_token_contract -flakey_e2e_tests -guides_dapp_testing -guides_sample_dapp -guides_sample_dapp_ci -guides_up_quick_start -guides_writing_an_account_contract -integration_l1_publisher -kind_network_4epochs -kind_network_smoke -kind_network_transfer -pxe diff --git a/yarn-project/end-to-end/scripts/test.sh b/yarn-project/end-to-end/scripts/test.sh deleted file mode 100755 index 5836448e9a0..00000000000 --- a/yarn-project/end-to-end/scripts/test.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if grep -qF "$1" ./compose_e2e_test_list; then - echo "Running compose test" -else - echo "Running normal test" -fi From 93987b0d984af0e0c7572fced31e89f1bd9e29e4 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 23 Oct 2024 17:39:20 +0000 Subject: [PATCH 03/23] fix select_runner usage --- .github/workflows/ci.yml | 2 +- scripts/ci/select_runner.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 scripts/ci/select_runner.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8cffc3d3c2..6048f874aed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,7 +198,7 @@ jobs: - name: Determine runner type id: runner_type run: | - runner=$(./scripts/select_runner.sh ${{ matrix.test }}) + runner=$(./scripts/ci/select_runner.sh ${{ matrix.test }}) echo "type=$runner" >> $GITHUB_OUTPUT - name: Setup and Test timeout-minutes: 40 diff --git a/scripts/ci/select_runner.sh b/scripts/ci/select_runner.sh old mode 100644 new mode 100755 From fa323b200f19c7be7c8a32c0390aaf8bbb585e4e Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 09:37:16 +0000 Subject: [PATCH 04/23] remove test logging --- .github/workflows/ci.yml | 1 - scripts/ci/get_e2e_jobs.sh | 2 -- 2 files changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6048f874aed..8273a866dd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,7 +170,6 @@ jobs: fi echo Labels: $LABELS echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT - echo "compose_list=$(./scripts/ci/get_e2e_compose_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT - name: Create list of bench end-to-end jobs id: bench_list run: | diff --git a/scripts/ci/get_e2e_jobs.sh b/scripts/ci/get_e2e_jobs.sh index be76e7581cc..e970d6dbbb8 100755 --- a/scripts/ci/get_e2e_jobs.sh +++ b/scripts/ci/get_e2e_jobs.sh @@ -15,8 +15,6 @@ get_test_names() { # Read the full list from the YAML file full_list=$(get_test_names) -echo "Full list: $full_list" - # Define the jobs that will run on every PR allow_list=( "e2e_2_pxes" From 5426dfd5b9a057ba1222d8ed9383254c6dfed589 Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 10:29:19 +0000 Subject: [PATCH 05/23] debug log --- .github/workflows/ci.yml | 1 + scripts/ci/old_script.sh | 59 ---------------------------------------- 2 files changed, 1 insertion(+), 59 deletions(-) delete mode 100755 scripts/ci/old_script.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8273a866dd8..33d9929674a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -169,6 +169,7 @@ jobs: LABELS="" fi echo Labels: $LABELS + echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")" echo "list=$(./scripts/ci/get_e2e_jobs.sh ${{github.ref_name}} "$LABELS")" >> $GITHUB_OUTPUT - name: Create list of bench end-to-end jobs id: bench_list diff --git a/scripts/ci/old_script.sh b/scripts/ci/old_script.sh deleted file mode 100755 index 4805fbd265c..00000000000 --- a/scripts/ci/old_script.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -set -eu - -# Enter repo root. -cd "$(dirname "$0")"/../.. - -BRANCH=$1 -LABELS=$2 - -# Define the jobs that will run on every PR -allow_list=( - "e2e-2-pxes" - "e2e-authwit" - "e2e-avm-simulator" - "e2e-block-building" - "e2e-cross-chain-messaging" - "e2e-deploy-contract" - "e2e-fees" - "e2e-fees-gas-estimation" - "e2e-fees-private-payments" - "e2e-max-block-number" - "e2e-nested-contract" - "e2e-ordering" - "e2e-static-calls" - "integration-l1-publisher" - "e2e-cheat-codes" - "e2e-prover-fake-proofs" - "e2e-lending-contract" - "kind-network-smoke" -) - -# Add labels from input to the allow_list -IFS=',' read -r -a input_labels <<<"$LABELS" -allow_list+=("${input_labels[@]}") - -# Generate full list of targets, excluding specific entries, on one line -full_list=$(earthly ls ./yarn-project/end-to-end | grep -v '+base' | grep -v '+bench' | grep -v "+network" | grep -v 'devnet' | sed 's/+//' | xargs echo) - -echo "Full list: $full_list" - -# If branch is master or allow_list contains 'e2e-all', return full list -if [[ "$BRANCH" == "master" ]] || [[ " ${allow_list[@]} " =~ "e2e-all" ]]; then - # print as JSON list - echo "$full_list" | jq -Rc 'split(" ")' - exit 0 -fi - -# Filter the full_list to include only items in the allow_list -filtered_list=() -for item in $full_list; do - for allowed in "${allow_list[@]}"; do - if [[ "$item" == "$allowed" ]]; then - filtered_list+=("$item") - fi - done -done - -# Print the filtered list in JSON format -echo ${filtered_list[@]} | jq -Rc 'split(" ")' From 8b2c02b4157e155af2076d4a7f16121754314186 Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 10:57:23 +0000 Subject: [PATCH 06/23] setup yq --- .github/ci-setup-action/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/ci-setup-action/action.yml b/.github/ci-setup-action/action.yml index 14708938330..93ad03f5941 100644 --- a/.github/ci-setup-action/action.yml +++ b/.github/ci-setup-action/action.yml @@ -35,6 +35,10 @@ runs: # TODO reconsider how jq gets into image - name: Setup jq uses: dcarbone/install-jq-action@v2.1.0 + - name: Setup yq + uses: dcarbone/install-yq-action@v1.1.1 + with: + version: v4.44.3 - name: Setup Earthly uses: earthly/actions-setup@v1 From 04770aeb592c9f47e5dc786e6122cea8caff59ad Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 11:14:05 +0000 Subject: [PATCH 07/23] install yq in e2e_test --- yarn-project/end-to-end/scripts/e2e_test.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index a5702385a73..bacfc97747e 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -18,6 +18,12 @@ FAKE_PROOFS="${FAKE_PROOFS:-}" COMPOSE_FILE="${COMPOSE_FILE:-./scripts/docker-compose.yml}" AZTEC_DOCKER_TAG=$(git rev-parse HEAD) +# Install yq if not already installed +if ! command -v yq &>/dev/null; then + wget https://github.com/mikefarah/yq/releases/download/4.44.3/yq_linux_amd64 -O - | + tar xz && mv yq_linux_amd64 /usr/bin/yq +fi + # Function to load test configuration load_test_config() { local test_name="$1" From 1e67318f7a774ca26395e8ffa67f1d61397dd7c0 Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 11:44:28 +0000 Subject: [PATCH 08/23] fix typo --- yarn-project/end-to-end/scripts/e2e_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index bacfc97747e..0c1fcdcd3c7 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -20,7 +20,7 @@ AZTEC_DOCKER_TAG=$(git rev-parse HEAD) # Install yq if not already installed if ! command -v yq &>/dev/null; then - wget https://github.com/mikefarah/yq/releases/download/4.44.3/yq_linux_amd64 -O - | + wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64 -O - | tar xz && mv yq_linux_amd64 /usr/bin/yq fi From 76eae4a7da9f2032ac8b27fde94f20824b161e4c Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 12:13:05 +0000 Subject: [PATCH 09/23] fix chmod --- yarn-project/end-to-end/scripts/e2e_test.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index 0c1fcdcd3c7..3bc7d00210f 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -20,8 +20,7 @@ AZTEC_DOCKER_TAG=$(git rev-parse HEAD) # Install yq if not already installed if ! command -v yq &>/dev/null; then - wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64 -O - | - tar xz && mv yq_linux_amd64 /usr/bin/yq + wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq fi # Function to load test configuration From 5fe4d1755093c1d0efdf890f4fdfd3fa926ad446 Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 12:44:37 +0000 Subject: [PATCH 10/23] try in ensure-tester action --- .github/ensure-tester/action.yml | 10 ++++++++++ yarn-project/end-to-end/scripts/e2e_test.sh | 5 ----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/ensure-tester/action.yml b/.github/ensure-tester/action.yml index ca85b7da853..1a8526a1bba 100644 --- a/.github/ensure-tester/action.yml +++ b/.github/ensure-tester/action.yml @@ -94,6 +94,16 @@ runs: " || true fi + - name: Setup yq + shell: bash + run: | + set -x + scripts/run_on_tester " + if ! command -v yq &>/dev/null; then + wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq + fi + " + - name: Ensure Tester Cleanup uses: gacts/run-and-post-run@v1 with: diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index 3bc7d00210f..a5702385a73 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -18,11 +18,6 @@ FAKE_PROOFS="${FAKE_PROOFS:-}" COMPOSE_FILE="${COMPOSE_FILE:-./scripts/docker-compose.yml}" AZTEC_DOCKER_TAG=$(git rev-parse HEAD) -# Install yq if not already installed -if ! command -v yq &>/dev/null; then - wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq -fi - # Function to load test configuration load_test_config() { local test_name="$1" From c9454288e389a12563d7832663fbbc650b72a9b7 Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 13:00:33 +0000 Subject: [PATCH 11/23] chmod -> then move --- .github/ensure-tester/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ensure-tester/action.yml b/.github/ensure-tester/action.yml index 1a8526a1bba..ad4e178ad71 100644 --- a/.github/ensure-tester/action.yml +++ b/.github/ensure-tester/action.yml @@ -99,9 +99,9 @@ runs: run: | set -x scripts/run_on_tester " - if ! command -v yq &>/dev/null; then - wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq - fi + wget https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64 -O ./yq + chmod +x ./yq + sudo mv ./yq /usr/bin/yq " - name: Ensure Tester Cleanup From 485ac9c584cd695bc7ab7fb0db081befe404945c Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 14:22:03 +0000 Subject: [PATCH 12/23] fix test config loc --- yarn-project/end-to-end/scripts/e2e_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index a5702385a73..141ce8cdcd3 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -21,7 +21,7 @@ AZTEC_DOCKER_TAG=$(git rev-parse HEAD) # Function to load test configuration load_test_config() { local test_name="$1" - yq e ".tests.${test_name}" yarn-project/end-to-end/scripts/e2e_test_config.yml + yq e ".tests.${test_name}" "$(dirname "$0")/e2e_test_config.yml" } # Check if Docker images exist From 2f888199a8fbc6a995ed602e889df88422eaa48d Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 14:23:22 +0000 Subject: [PATCH 13/23] rm unused script --- scripts/ci/get_e2e_compose_jobs.sh | 53 ------------------------------ 1 file changed, 53 deletions(-) delete mode 100644 scripts/ci/get_e2e_compose_jobs.sh diff --git a/scripts/ci/get_e2e_compose_jobs.sh b/scripts/ci/get_e2e_compose_jobs.sh deleted file mode 100644 index 68b00eb5c7d..00000000000 --- a/scripts/ci/get_e2e_compose_jobs.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -set -eu - -# Enter repo root. -cd "$(dirname "$0")"/../.. - -BRANCH=$1 -LABELS=$2 - -# Read the full list from the file -full_list=$(cat yarn-project/end-to-end/scripts/full_e2e_test_list) - -# Define that need the compose_test script to run -compose_list=( - e2e_sandbox_example - uniswap_trade_on_l1_from_l2 - integration_l1_publisher - e2e_browser - pxe - e2e_docs_examples - guides/writing_an_account_contract - guides/dapp_testing - sample-dapp/ci/index.test.mjs - sample-dapp/index.test.mjs - guides/up_quick_start -) - -# Add labels from input to the allow_list -IFS=',' read -r -a input_labels <<<"$LABELS" -allow_list+=("${input_labels[@]}") - -# Generate full list of targets, excluding specific entries, on one line -test_list=$(echo "${full_list[@]}" | grep -v 'base' | grep -v 'bench' | grep -v "network" | grep -v 'devnet' | xargs echo) - -# # If branch is master or allow_list contains 'e2e-all', return full list -if [[ "$BRANCH" == "master" ]] || [[ " ${allow_list[@]} " =~ "e2e-all" ]]; then - # print as JSON list - echo "$test_list" | jq -Rc 'split(" ")' - exit 0 -fi - -# # Filter the test_list to include only items in the allow_list -filtered_list=() -for item in $test_list; do - for allowed in "${allow_list[@]}"; do - if [[ "$item" == "$allowed" ]]; then - filtered_list+=("$item") - fi - done -done - -# # Print the filtered list in JSON format -echo ${filtered_list[@]} | jq -Rc 'split(" ")' From d41eb4989512e2137f6d1da56dd489a7772d41af Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 14:52:33 +0000 Subject: [PATCH 14/23] handle tests in subdirectories --- yarn-project/end-to-end/scripts/e2e_test.sh | 11 +++++++++- .../end-to-end/scripts/e2e_test_config.yml | 21 ++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index 141ce8cdcd3..fe186e65436 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -52,6 +52,15 @@ run_docker_compose() { # Load test configuration test_config=$(load_test_config "$TEST") +# Determine the test path +test_directory=$(echo "$test_config" | yq e '.directory // ""' -) + +if [ -n "$test_directory" ]; then + test_path="${test_directory}/${TEST}.test.ts" +else + test_path="${TEST}.test.ts" +fi + # Check if the test uses docker compose if [ "$(echo "$test_config" | yq e '.use_compose // false' -)" = "true" ]; then run_docker_compose "$TEST" "$@" @@ -79,6 +88,6 @@ else -e FAKE_PROOFS="$FAKE_PROOFS" \ $env_args \ --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG \ - "$TEST" "$@" + "$test_path" "$@" fi fi diff --git a/yarn-project/end-to-end/scripts/e2e_test_config.yml b/yarn-project/end-to-end/scripts/e2e_test_config.yml index 50b779b666e..5daf6e9e1ea 100644 --- a/yarn-project/end-to-end/scripts/e2e_test_config.yml +++ b/yarn-project/end-to-end/scripts/e2e_test_config.yml @@ -37,13 +37,20 @@ tests: e2e_docs_examples: use_compose: true e2e_escrow_contract: {} - e2e_fees_account_init: {} - e2e_fees_dapp_subscription: {} - e2e_fees_failures: {} - e2e_fees_fee_juice_payments: {} - e2e_fees_gas_estimation: {} - e2e_fees_private_payments: {} - e2e_fees_private_refunds: {} + account_init: + directory: "e2e_fees" + dapp_subscription: + directory: "e2e_fees" + failures: + directory: "e2e_fees" + fee_juice_payments: + directory: "e2e_fees" + gas_estimation: + directory: "e2e_fees" + private_payments: + directory: "e2e_fees" + private_refunds: + directory: "e2e_fees" e2e_keys: {} e2e_l1_with_wall_time: {} e2e_lending_contract: {} From 8284205062fa5b3bb249ad2cf515333743fabe99 Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 15:07:27 +0000 Subject: [PATCH 15/23] updates for some cases --- yarn-project/end-to-end/scripts/e2e_test.sh | 7 +--- .../end-to-end/scripts/e2e_test_config.yml | 37 ++++++++++--------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index fe186e65436..a30caa5614e 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -53,11 +53,8 @@ run_docker_compose() { test_config=$(load_test_config "$TEST") # Determine the test path -test_directory=$(echo "$test_config" | yq e '.directory // ""' -) - -if [ -n "$test_directory" ]; then - test_path="${test_directory}/${TEST}.test.ts" -else +test_path=$(echo "$test_config" | yq e '.test_path // ""' -) +if [ -z "$test_path" ]; then test_path="${TEST}.test.ts" fi diff --git a/yarn-project/end-to-end/scripts/e2e_test_config.yml b/yarn-project/end-to-end/scripts/e2e_test_config.yml index 5daf6e9e1ea..fa23449a20f 100644 --- a/yarn-project/end-to-end/scripts/e2e_test_config.yml +++ b/yarn-project/end-to-end/scripts/e2e_test_config.yml @@ -29,7 +29,6 @@ tests: use_compose: true e2e_card_game: {} e2e_cheat_codes: {} - e2e_cli_wallet: {} e2e_cross_chain_messaging: {} e2e_crowdfunding_and_claim: {} e2e_deploy_contract: {} @@ -37,24 +36,24 @@ tests: e2e_docs_examples: use_compose: true e2e_escrow_contract: {} - account_init: - directory: "e2e_fees" - dapp_subscription: - directory: "e2e_fees" - failures: - directory: "e2e_fees" - fee_juice_payments: - directory: "e2e_fees" - gas_estimation: - directory: "e2e_fees" - private_payments: - directory: "e2e_fees" - private_refunds: - directory: "e2e_fees" + e2e_fees_account_init: + test_path: "e2e_fees/account_init.test.ts" + e2e_fees_dapp_subscription: + test_path: "e2e_fees/dapp_subscription.test.ts" + e2e_fees_failures: + test_path: "e2e_fees/failures.test.ts" + e2e_fees_fee_juice_payments: + test_path: "e2e_fees/fee_juice_payments.test.ts" + e2e_fees_gas_estimation: + test_path: "e2e_fees/gas_estimation.test.ts" + e2e_fees_private_payments: + test_path: "e2e_fees/private_payments.test.ts" + e2e_fees_private_refunds: + test_path: "e2e_fees/private_refunds.test.ts" e2e_keys: {} e2e_l1_with_wall_time: {} e2e_lending_contract: {} - e2e_logs: {} + e2e_event_logs: {} e2e_max_block_number: {} e2e_multiple_accounts_1_enc_key: {} e2e_nested_contract: {} @@ -67,9 +66,11 @@ tests: e2e_private_voting_contract: {} e2e_prover_coordination: {} e2e_prover_fake_proofs: + test_path: "e2e_prover/full.test.ts" env: FAKE_PROOFS: "1" e2e_prover_full: + test_path: "e2e_prover/full.test.ts" env: HARDWARE_CONCURRENCY: "32" e2e_public_testnet: {} @@ -79,7 +80,9 @@ tests: e2e_static_calls: {} e2e_synching: {} e2e_token_contract: {} - flakey_e2e_tests: {} + flakey_e2e_tests: + test_path: "./src/flakey" + command: "./scripts/e2e_test.sh ./src/flakey || true" guides_dapp_testing: use_compose: true guides_sample_dapp: From 4e698df9d5bed1cedc1f5b198e0313bb42390976 Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 15:28:35 +0000 Subject: [PATCH 16/23] no test.ts postfix --- yarn-project/end-to-end/scripts/e2e_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index a30caa5614e..3e350d6d088 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -55,7 +55,7 @@ test_config=$(load_test_config "$TEST") # Determine the test path test_path=$(echo "$test_config" | yq e '.test_path // ""' -) if [ -z "$test_path" ]; then - test_path="${TEST}.test.ts" + test_path="${TEST}" fi # Check if the test uses docker compose From cc41f5be6544922b729ea8a2fad81bf3ef37748a Mon Sep 17 00:00:00 2001 From: spypsy Date: Thu, 24 Oct 2024 16:06:23 +0000 Subject: [PATCH 17/23] add ignore_failures option --- yarn-project/end-to-end/scripts/e2e_test.sh | 12 +++++++++--- yarn-project/end-to-end/scripts/e2e_test_config.yml | 5 +++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index 3e350d6d088..6e563fb70cf 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -58,9 +58,15 @@ if [ -z "$test_path" ]; then test_path="${TEST}" fi +# Check for ignore_failures +ignore_failures=$(echo "$test_config" | yq e '.ignore_failures // false' -) +if [ "$ignore_failures" = "true" ]; then + echo "Ignoring failures for test $TEST" +fi + # Check if the test uses docker compose if [ "$(echo "$test_config" | yq e '.use_compose // false' -)" = "true" ]; then - run_docker_compose "$TEST" "$@" + run_docker_compose "$TEST" "$@" || [ "$ignore_failures" = "true" ] else # Set environment variables while IFS='=' read -r key value; do @@ -77,7 +83,7 @@ else -e FAKE_PROOFS="$FAKE_PROOFS" \ $env_args \ --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG \ - /bin/bash -c "$custom_command" + /bin/bash -c "$custom_command" || [ "$ignore_failures" = "true" ] else # Run the default docker command docker run \ @@ -85,6 +91,6 @@ else -e FAKE_PROOFS="$FAKE_PROOFS" \ $env_args \ --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG \ - "$test_path" "$@" + "$test_path" "$@" || [ "$ignore_failures" = "true" ] fi fi diff --git a/yarn-project/end-to-end/scripts/e2e_test_config.yml b/yarn-project/end-to-end/scripts/e2e_test_config.yml index fa23449a20f..e56c5b9908e 100644 --- a/yarn-project/end-to-end/scripts/e2e_test_config.yml +++ b/yarn-project/end-to-end/scripts/e2e_test_config.yml @@ -82,7 +82,7 @@ tests: e2e_token_contract: {} flakey_e2e_tests: test_path: "./src/flakey" - command: "./scripts/e2e_test.sh ./src/flakey || true" + ignore_failures: true guides_dapp_testing: use_compose: true guides_sample_dapp: @@ -100,7 +100,8 @@ tests: NAMESPACE: "smoke" FRESH_INSTALL: "true" VALUES_FILE: "$-default.yaml" - command: "./scripts/network_test.sh ./src/spartan/4epochs.test.ts || true" + command: "./scripts/network_test.sh ./src/spartan/4epochs.test.ts" + ignore_failures: true kind_network_smoke: env: NAMESPACE: "smoke" From 8e637e01be8c0c6965e4b3ca2654ecc870f93835 Mon Sep 17 00:00:00 2001 From: spypsy Date: Fri, 25 Oct 2024 09:01:10 +0000 Subject: [PATCH 18/23] use old compose script --- yarn-project/end-to-end/scripts/e2e_compose_test.sh | 10 +++++----- yarn-project/end-to-end/scripts/e2e_test.sh | 13 +++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/yarn-project/end-to-end/scripts/e2e_compose_test.sh b/yarn-project/end-to-end/scripts/e2e_compose_test.sh index eb3e419f614..531230b83a6 100755 --- a/yarn-project/end-to-end/scripts/e2e_compose_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_compose_test.sh @@ -23,9 +23,9 @@ export AZTEC_DOCKER_TAG="${AZTEC_DOCKER_TAG:-$(git rev-parse HEAD)}" # Set the ARCH_TAG variable for docker compose ARCH=$(uname -m) if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then - export ARCH_TAG="arm64" + export ARCH_TAG="arm64" else - export ARCH_TAG="amd64" + export ARCH_TAG="amd64" fi FORCE_BUILD="${FORCE_BUILD:-true}" @@ -34,15 +34,15 @@ FORCE_BUILD="${FORCE_BUILD:-true}" export JOB_NAME=$(echo "$TEST" | sed 's/\./_/g' | sed 's/\//_/g') # Determine CMD -if docker compose > /dev/null 2>&1; then +if docker compose >/dev/null 2>&1; then CMD="docker compose" else CMD="docker-compose" fi # Optimize image building -if ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q "aztecprotocol/aztec:$AZTEC_DOCKER_TAG" || \ - ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG"; then +if ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q "aztecprotocol/aztec:$AZTEC_DOCKER_TAG" || + ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG"; then echo "Docker images not found. They need to be built with 'earthly ./yarn-project/+export-test-images' or otherwise tagged with aztecprotocol/aztec:$AZTEC_DOCKER_TAG and aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG." exit 1 fi diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index 6e563fb70cf..484e10375a5 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -9,14 +9,14 @@ set -eu # Main positional parameter -TEST="$1" +export TEST="$1" shift # Default values for environment variables -HARDWARE_CONCURRENCY="${HARDWARE_CONCURRENCY:-}" -FAKE_PROOFS="${FAKE_PROOFS:-}" -COMPOSE_FILE="${COMPOSE_FILE:-./scripts/docker-compose.yml}" -AZTEC_DOCKER_TAG=$(git rev-parse HEAD) +export HARDWARE_CONCURRENCY="${HARDWARE_CONCURRENCY:-}" +export FAKE_PROOFS="${FAKE_PROOFS:-}" +export COMPOSE_FILE="${COMPOSE_FILE:-./scripts/docker-compose.yml}" +export AZTEC_DOCKER_TAG=$(git rev-parse HEAD) # Function to load test configuration load_test_config() { @@ -66,7 +66,8 @@ fi # Check if the test uses docker compose if [ "$(echo "$test_config" | yq e '.use_compose // false' -)" = "true" ]; then - run_docker_compose "$TEST" "$@" || [ "$ignore_failures" = "true" ] + # run_docker_compose "$TEST" "$@" || [ "$ignore_failures" = "true" ] + ./e2e_compose_test.sh "$TEST" "$@" || [ "$ignore_failures" = "true" ] else # Set environment variables while IFS='=' read -r key value; do From 6da5cebcfdc7bf240de45a1d3bbb6c3fa7a7fb25 Mon Sep 17 00:00:00 2001 From: spypsy Date: Fri, 25 Oct 2024 09:44:31 +0000 Subject: [PATCH 19/23] fix dir --- yarn-project/end-to-end/scripts/e2e_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index 484e10375a5..706aa331a2b 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -67,7 +67,7 @@ fi # Check if the test uses docker compose if [ "$(echo "$test_config" | yq e '.use_compose // false' -)" = "true" ]; then # run_docker_compose "$TEST" "$@" || [ "$ignore_failures" = "true" ] - ./e2e_compose_test.sh "$TEST" "$@" || [ "$ignore_failures" = "true" ] + $(dirname "$0")/e2e_compose_test.sh "$TEST" "$@" || [ "$ignore_failures" = "true" ] else # Set environment variables while IFS='=' read -r key value; do From 553426850a9ce7182bc0a876f7aaee8d02dd0745 Mon Sep 17 00:00:00 2001 From: spypsy Date: Fri, 25 Oct 2024 12:48:36 +0000 Subject: [PATCH 20/23] fix some more test dirs --- yarn-project/end-to-end/scripts/e2e_test_config.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test_config.yml b/yarn-project/end-to-end/scripts/e2e_test_config.yml index e56c5b9908e..3520f49f139 100644 --- a/yarn-project/end-to-end/scripts/e2e_test_config.yml +++ b/yarn-project/end-to-end/scripts/e2e_test_config.yml @@ -25,7 +25,7 @@ tests: e2e_blacklist_token_contract: {} e2e_block_building: {} e2e_bot: {} - e2e_browser: + e2e_aztec_js_browser: use_compose: true e2e_card_game: {} e2e_cheat_codes: {} @@ -33,7 +33,7 @@ tests: e2e_crowdfunding_and_claim: {} e2e_deploy_contract: {} e2e_devnet_smoke: {} - e2e_docs_examples: + docs_examples: use_compose: true e2e_escrow_contract: {} e2e_fees_account_init: @@ -85,14 +85,19 @@ tests: ignore_failures: true guides_dapp_testing: use_compose: true + test_path: "guides/dapp_testing.test.ts" guides_sample_dapp: use_compose: true + test_path: "sample-dapp/index.test.mjs" guides_sample_dapp_ci: use_compose: true + test_path: "sample-dapp/ci/index.test.mjs" guides_up_quick_start: use_compose: true + test_path: "guides/up_quick_start.test.ts" guides_writing_an_account_contract: use_compose: true + test_path: "guides/writing_an_account_contract.test.ts" integration_l1_publisher: use_compose: true kind_network_4epochs: From f9c6f20683c43b3d0cc67d98cc3fa918d772999e Mon Sep 17 00:00:00 2001 From: spypsy Date: Fri, 25 Oct 2024 13:10:09 +0000 Subject: [PATCH 21/23] use test_path, not $TEST --- yarn-project/end-to-end/scripts/e2e_test.sh | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index 706aa331a2b..155c19da4e9 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -30,25 +30,6 @@ if ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q "aztecprotoco exit 1 fi -# Function to run docker compose -run_docker_compose() { - local test_name=$1 - shift - - # Compute project_name - local project_name=$(echo "$test_name" | sed 's/\./_/g' | sed 's/\//_/g') - - # Determine CMD - if docker compose >/dev/null 2>&1; then - local CMD="docker compose" - else - local CMD="docker-compose" - fi - - # Run docker compose - $CMD -p "$project_name" -f "$COMPOSE_FILE" up --exit-code-from=end-to-end --force-recreate "$@" -} - # Load test configuration test_config=$(load_test_config "$TEST") @@ -67,7 +48,7 @@ fi # Check if the test uses docker compose if [ "$(echo "$test_config" | yq e '.use_compose // false' -)" = "true" ]; then # run_docker_compose "$TEST" "$@" || [ "$ignore_failures" = "true" ] - $(dirname "$0")/e2e_compose_test.sh "$TEST" "$@" || [ "$ignore_failures" = "true" ] + $(dirname "$0")/e2e_compose_test.sh "$test_path" "$@" || [ "$ignore_failures" = "true" ] else # Set environment variables while IFS='=' read -r key value; do From 84c63798c478673888ff7ccf3759b4c582fff023 Mon Sep 17 00:00:00 2001 From: spypsy Date: Mon, 28 Oct 2024 10:23:57 +0000 Subject: [PATCH 22/23] rm comment --- yarn-project/end-to-end/scripts/e2e_test.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/yarn-project/end-to-end/scripts/e2e_test.sh b/yarn-project/end-to-end/scripts/e2e_test.sh index 155c19da4e9..61871b7bbb0 100755 --- a/yarn-project/end-to-end/scripts/e2e_test.sh +++ b/yarn-project/end-to-end/scripts/e2e_test.sh @@ -47,7 +47,6 @@ fi # Check if the test uses docker compose if [ "$(echo "$test_config" | yq e '.use_compose // false' -)" = "true" ]; then - # run_docker_compose "$TEST" "$@" || [ "$ignore_failures" = "true" ] $(dirname "$0")/e2e_compose_test.sh "$test_path" "$@" || [ "$ignore_failures" = "true" ] else # Set environment variables From 30ee02530f5d64372ddba4059e94d4e1c1f73a7d Mon Sep 17 00:00:00 2001 From: spypsy Date: Mon, 28 Oct 2024 10:29:51 +0000 Subject: [PATCH 23/23] use select_runner for bench as well --- .github/workflows/ci.yml | 13 +++++++++---- scripts/ci/select_runner.sh | 6 +++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbb85e2f973..8c1ffb5ff53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,13 +232,18 @@ jobs: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } - uses: ./.github/ci-setup-action + - name: Determine runner type + id: runner_type + run: | + runner=$(./scripts/ci/select_runner.sh ${{ matrix.test }}) + echo "type=$runner" >> $GITHUB_OUTPUT - name: Setup and Test uses: ./.github/ensure-tester-with-images env: USERNAME: ${{ needs.configure.outputs.username }} timeout-minutes: 45 with: - runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '16core-tester-x86' }} + runner_type: ${{ steps.runner_type.outputs.type }} builder_type: builder-x86 # these are copied to the tester and expected by the earthly command below # if they fail to copy, it will try to build them on the tester and fail @@ -589,7 +594,7 @@ jobs: yarn-project-formatting: needs: [build, configure] - if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master' + if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master' runs-on: ${{ needs.configure.outputs.username }}-x86 steps: - uses: actions/checkout@v4 @@ -603,7 +608,7 @@ jobs: yarn-project-test: needs: [build, configure] - if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master' + if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master' runs-on: ${{ needs.configure.outputs.username }}-x86 steps: - uses: actions/checkout@v4 @@ -618,7 +623,7 @@ jobs: prover-client-test: needs: [build, configure] runs-on: ${{ needs.configure.outputs.username }}-x86 - if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master' + if: needs.configure.outputs.yarn-project == 'true' || github.ref_name == 'master' steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } diff --git a/scripts/ci/select_runner.sh b/scripts/ci/select_runner.sh index d8cc89d40c1..a4db64dbd99 100755 --- a/scripts/ci/select_runner.sh +++ b/scripts/ci/select_runner.sh @@ -11,5 +11,9 @@ test_name=$1 if requires_prover "$test_name"; then echo "64core-tester-x86" else - echo "8core-tester-x86" + if [[ $test_name == *"bench"* ]]; then + echo "16core-tester-x86" + else + echo "8core-tester-x86" + fi fi