Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): remove end-to-end/Earthfile #9364

Merged
merged 27 commits into from
Oct 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test_config.yml, remove logic from ci.yml
spypsy committed Oct 23, 2024
commit 098dc2766960c13086ac0416b16b8b3c483b83d2
35 changes: 2 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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:
11 changes: 9 additions & 2 deletions scripts/ci/get_e2e_jobs.sh
Original file line number Diff line number Diff line change
@@ -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=(
11 changes: 0 additions & 11 deletions yarn-project/end-to-end/scripts/compose_e2e_test_list

This file was deleted.

63 changes: 62 additions & 1 deletion yarn-project/end-to-end/scripts/e2e_test.sh
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@
# Usage: ./e2e_test.sh <test> <...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
108 changes: 108 additions & 0 deletions yarn-project/end-to-end/scripts/e2e_test_config.yml
Original file line number Diff line number Diff line change
@@ -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
61 changes: 0 additions & 61 deletions yarn-project/end-to-end/scripts/full_e2e_test_list

This file was deleted.

7 changes: 0 additions & 7 deletions yarn-project/end-to-end/scripts/test.sh

This file was deleted.