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

fix: cpp cache and add other e2e #5512

Merged
merged 62 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
90bab87
fix(ci): earthly e2e test issues
ludamad Mar 25, 2024
78cbc86
Attempt fix
ludamad Mar 25, 2024
e97d2a1
try stabilize test
ludamad Mar 25, 2024
e3d7b74
attempt fix
ludamad Mar 25, 2024
db61db5
try fix again
ludamad Mar 25, 2024
5505387
earthly
ludamad Mar 25, 2024
5958957
test
ludamad Mar 25, 2024
9291ff8
avm
ludamad Mar 25, 2024
22f3c78
avm
ludamad Mar 25, 2024
f5db53b
better e2e build flag
ludamad Mar 25, 2024
2d53ff5
Merge remote-tracking branch 'origin/master' into ad/fix/e2e-earthly
ludamad Mar 26, 2024
6901e11
test fixes
ludamad Mar 26, 2024
352a5f0
cleaner cloud
ludamad Mar 26, 2024
143b8df
merge
ludamad Mar 26, 2024
84795e5
Update
ludamad Mar 26, 2024
bf036f8
preset wasm
ludamad Mar 26, 2024
7666eb5
fixes
ludamad Mar 26, 2024
f2ef478
reduce runners
ludamad Mar 26, 2024
b95c51f
e2e browser speculative fix
ludamad Mar 26, 2024
73fb335
arm fix
ludamad Mar 26, 2024
5870d90
always cache node_modules (experimental)
ludamad Mar 26, 2024
54ce088
wasm threads
ludamad Mar 26, 2024
6b0530e
use wasm threads
ludamad Mar 26, 2024
e8c4e38
threads fix
ludamad Mar 26, 2024
f6c01c8
fix arm
ludamad Mar 26, 2024
5a73646
Update
ludamad Mar 26, 2024
1f7b82a
Update docker-compose.yml
ludamad Mar 27, 2024
1320982
Merge branch 'master' into ad/fix/e2e-earthly
ludamad Mar 27, 2024
77d2d26
Update ci.yml
ludamad Mar 28, 2024
2c7e6ed
fix: disable bb-native-tests arm for now
ludamad Mar 28, 2024
d3a4842
Merge branch 'master' into ad/fix/e2e-earthly
ludamad Mar 28, 2024
2eb48ed
fix: on for everyone
ludamad Mar 28, 2024
846a7f2
ccache
ludamad Mar 28, 2024
40f9389
conservative
ludamad Mar 28, 2024
2ef6f4a
Merge remote-tracking branch 'origin/master' into ad/fix/e2e-earthly
ludamad Mar 28, 2024
262d551
keep old name for now
ludamad Mar 28, 2024
fea5795
rollback
ludamad Mar 28, 2024
7a2a617
sync e2e
ludamad Mar 28, 2024
c527459
remove from circleci the e2e
ludamad Mar 28, 2024
481e367
roll back. too bold
ludamad Mar 28, 2024
04c9160
fix ccache
ludamad Mar 28, 2024
8e7217a
roll back ccache
ludamad Mar 28, 2024
c2054e7
Update CMakeLists.txt
ludamad Mar 28, 2024
f680852
Merge branch 'master' into ad/fix-cpp-cache-and-add-other-e2e
ludamad Mar 28, 2024
cd1546e
Update Earthfile
ludamad Mar 28, 2024
0d2377d
dynamic e2e list
ludamad Mar 28, 2024
43d81e3
Merge remote-tracking branch 'origin/ad/fix-cpp-cache-and-add-other-e…
ludamad Mar 28, 2024
7953db6
one-liner
ludamad Mar 28, 2024
4bf2d01
FromJson
ludamad Mar 28, 2024
d8a0bc9
fix ref
ludamad Mar 28, 2024
006f1df
handle folder tests properly
ludamad Mar 28, 2024
4cd2bbf
lets go
ludamad Mar 28, 2024
9c851b0
fixes
ludamad Mar 28, 2024
e11272e
fix suffix
ludamad Mar 28, 2024
eb1f946
fix
ludamad Mar 28, 2024
f7d7a5a
fix e2e speculatively
ludamad Mar 29, 2024
2d03e25
brr
ludamad Mar 29, 2024
fa4632d
Update Earthfile
ludamad Mar 29, 2024
512e43c
Merge branch 'master' into ad/fix-cpp-cache-and-add-other-e2e
ludamad Mar 29, 2024
82431be
Update Earthfile
ludamad Mar 29, 2024
f423c05
Merge branch 'master' into ad/fix-cpp-cache-and-add-other-e2e
ludamad Mar 29, 2024
cf7de51
Merge branch 'master' into ad/fix-cpp-cache-and-add-other-e2e
ludamad Mar 30, 2024
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
48 changes: 18 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
# there's a lot of x86 tasks - let's split out the build step
build-x86:
runs-on: ubuntu-latest
outputs:
e2e_list: ${{ steps.e2e_list.outputs.list }}
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
# cancel if reran on same PR if exists, otherwise if on same commit
Expand Down Expand Up @@ -36,12 +38,20 @@ jobs:
# push to registry
earthly-cloud build x86 --push +build-end-to-end

# We base our e2e list used in e2e-x86 off the targets in ./yarn-project/end-to-end
# (Note ARM uses just 2 tests as a smoketest)
- id: e2e_list
working-directory: ./yarn-project/end-to-end
run: |
echo "list=$(earthly ls | grep -v '+base' | sed 's/+//' | jq -R . | jq -cs .)" >> $GITHUB_OUTPUT

# all the end-to-end integration tests for aztec
e2e-arm:
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
strategy:
fail-fast: false
matrix:
test:
- e2e-card-game
Expand Down Expand Up @@ -80,35 +90,9 @@ jobs:
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
strategy:
fail-fast: false
matrix:
test:
- e2e-state-vars
- e2e-block-building
- e2e-nested-contract
- e2e-static-calls
- e2e-delegate-calls
- e2e-non-contract-account
- e2e-cross-chain-messaging
- e2e-crowdfunding-and-claim
- e2e-public-cross-chain-messaging
- e2e-public-to-private-messaging
- e2e-account-contracts
- e2e-escrow-contract
- e2e-inclusion-proofs-contract
- e2e-pending-note-hashes-contract
- e2e-ordering
- uniswap-trade-on-l1-from-l2
- integration-l1-publisher
- e2e-cli
- e2e-persistence
- e2e-browser
- e2e-card-game
- e2e-avm-simulator
- e2e-fees
- e2e-dapp-subscription
- pxe
- cli-docs-sandbox
- e2e-docs-examples
test: ${{ fromJson( needs.build-x86.outputs.e2e_list )}}
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: ${{ matrix.test }}-${{ github.event.pull_request.number || github.ref_name }}-x86
Expand Down Expand Up @@ -146,8 +130,12 @@ jobs:
runs-on: ubuntu-latest
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
strategy: { matrix: { environment: [x86] } }
# strategy: { matrix: { environment: [x86, arm] } }
strategy:
fail-fast: false
matrix:
environment: [x86]
# pending fix fot intermittent test
# environment: [x86, arm]
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: bb-native-tests-${{ github.event.pull_request.number || github.ref_name }}-${{ matrix.environment }}
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/cpp/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ wasmtime:

source:
# cpp source
COPY --dir src/barretenberg src/CMakeLists.txt src
COPY --keep-ts --dir src/barretenberg src/CMakeLists.txt src
# cmake source
COPY --dir cmake CMakeLists.txt CMakePresets.json .
COPY --keep-ts --dir cmake CMakeLists.txt CMakePresets.json .
# for debugging rebuilds
RUN echo CONTENT HASH $(find . -type f -exec sha256sum {} ';' | sort | sha256sum | awk '{print $1}') | tee .content-hash

Expand Down
2 changes: 2 additions & 0 deletions scripts/earthly-cloud
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ elif ! earthly $EARTHLY_FLAGS $@ 2>&1 | tee $OUTPUT_FILE >&2 ; then
# 'failed to solve: failed to get edge: inconsistent graph state'
echo "Got 'inconsistent graph state'. Restarting earthly. See https://github.com/earthly/earthly/issues/2454'"
earthly $EARTHLY_FLAGS $@
# TODO handle
# could not configure satellite: failed getting org: unable to authenticate: failed to execute login request: Post
else
# otherwise, propagate error
exit 1
Expand Down
170 changes: 129 additions & 41 deletions yarn-project/end-to-end/Earthfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@

VERSION 0.8

# requires first saving the images locally with ../+build-end-to-end

# run lcoally, used for our mainly x86 jobs
# run locally, used for our mainly x86 jobs
E2E_TEST_FROM_DOCKERHUB:
FUNCTION
ARG test
ARG compose_file=./scripts/docker-compose.yml
ARG enable_gas=""
ARG debug="aztec:*"
LOCALLY
ENV ENABLE_GAS=$enable_gas
ENV TEST=$test.test.ts
ENV TEST=$test
ENV DEBUG="$debug"
# Locally, we do not use WITH DOCKER as we have had issues with earthly copying big images
RUN docker compose -f $compose_file up --exit-code-from=end-to-end --force-recreate

Expand All @@ -21,17 +22,19 @@ E2E_TEST_FROM_BUILD:
ARG test
ARG compose_file=./scripts/docker-compose.yml
ARG enable_gas=""
ARG debug="aztec:*"
FROM earthly/dind:alpine-3.19-docker-25.0.2-r0
ENV ENABLE_GAS=$enable_gas
ENV TEST=$test.test.ts
ENV TEST=$test
ENV DEBUG=$debug
COPY $compose_file $compose_file
# For ARM, we do use WITH DOCKER as we don't have many e2e tests, but note E2E_TEST_FROM_DOCKERHUB
WITH DOCKER \
--load aztecprotocol/aztec:latest=../+aztec \
--load aztecprotocol/end-to-end:latest=../+end-to-end-minimal \
--load ghcr.io/foundry-rs/foundry:nightly-de33b6af53005037b463318d2628b5cfcaf39916=../../foundry/+get
# Run our docker compose, ending whenever sandbox ends, filtering out noisy eth_getLogs
RUN docker compose -f $compose_file up --exit-code-from=sandbox --force-recreate
# Run our docker compose, ending whenever sandbox ends, filtering out noisy eth_getLogs
RUN docker compose -f $compose_file up --exit-code-from=sandbox --force-recreate
END

E2E_TEST:
Expand All @@ -40,121 +43,206 @@ E2E_TEST:
ARG compose_file=./scripts/docker-compose.yml
ARG enable_gas=""
ARG e2e_build=false
ARG debug="aztec:*"
LOCALLY
IF [ $e2e_build = true ]
DO +E2E_TEST_FROM_BUILD --test=$test --compose_file=$compose_file --enable_gas=$enable_gas
DO +E2E_TEST_FROM_BUILD --test=$test --compose_file=$compose_file --enable_gas=$enable_gas --debug=$debug
ELSE
DO +E2E_TEST_FROM_DOCKERHUB --test=$test --compose_file=$compose_file --enable_gas=$enable_gas
DO +E2E_TEST_FROM_DOCKERHUB --test=$test --compose_file=$compose_file --enable_gas=$enable_gas --debug=$debug
END

# we could use a parameterized target, but these just print cleaner in earthly log
e2e-block-building:
# Define e2e tests
e2e-2-pxes:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_block_building --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_2_pxes.test.ts --e2e_build=$e2e_build

e2e-nested-contract:
e2e-note-getter:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_nested_contract --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_note_getter.test.ts --e2e_build=$e2e_build

e2e-static-calls:
e2e-counter:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_counter_contract.test.ts --e2e_build=$e2e_build

e2e-private-voting:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_private_voting_contract.test.ts --e2e_build=$e2e_build

e2e-max-block-number:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_max_block_number.test.ts --e2e_build=$e2e_build

e2e-multiple-accounts-1-enc-key:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_multiple_accounts_1_enc_key.test.ts --e2e_build=$e2e_build

e2e-deploy-contract:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_deploy_contract.test.ts --e2e_build=$e2e_build

e2e-lending-contract:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_lending_contract.test.ts --e2e_build=$e2e_build

e2e-token-contract:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_token_contract.test.ts --e2e_build=$e2e_build

e2e-authwit-test:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_authwit.test.ts --e2e_build=$e2e_build

e2e-blacklist-token-contract:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_blacklist_token_contract.test.ts --e2e_build=$e2e_build

# TODO(3458): Investigate intermittent failure
# e2e-slow-tree:
# DO +E2E_TEST --test=e2e_slow_tree

e2e-sandbox-example:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_static_calls --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_sandbox_example.test.ts --e2e_build=$e2e_build

e2e-state-vars:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_state_vars --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_state_vars.test.ts --e2e_build=$e2e_build

e2e-block-building:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_block_building.test.ts --e2e_build=$e2e_build

e2e-nested-contract:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_nested_contract.test.ts --e2e_build=$e2e_build

e2e-static-calls:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_static_calls.test.ts --e2e_build=$e2e_build

e2e-delegate-calls:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_delegate_calls --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_delegate_calls.test.ts --e2e_build=$e2e_build

e2e-non-contract-account:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_non_contract_account --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_non_contract_account.test.ts --e2e_build=$e2e_build

e2e-cross-chain-messaging:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_cross_chain_messaging --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_cross_chain_messaging.test.ts --e2e_build=$e2e_build

e2e-crowdfunding-and-claim:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_crowdfunding_and_claim --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_crowdfunding_and_claim.test.ts --e2e_build=$e2e_build

e2e-public-cross-chain-messaging:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_public_cross_chain_messaging --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_public_cross_chain_messaging.test.ts --e2e_build=$e2e_build

e2e-public-to-private-messaging:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_public_to_private_messaging --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_public_to_private_messaging.test.ts --e2e_build=$e2e_build

e2e-account-contracts:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_account_contracts --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_account_contracts.test.ts --e2e_build=$e2e_build

e2e-escrow-contract:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_escrow_contract --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_escrow_contract.test.ts --e2e_build=$e2e_build

e2e-inclusion-proofs-contract:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_inclusion_proofs_contract --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_inclusion_proofs_contract.test.ts --e2e_build=$e2e_build

e2e-pending-note-hashes-contract:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_pending_note_hashes_contract --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_pending_note_hashes_contract.test.ts --e2e_build=$e2e_build

e2e-ordering:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_ordering --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_ordering.test.ts --e2e_build=$e2e_build

e2e-outbox:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_outbox.test.ts --e2e_build=$e2e_build

uniswap-trade-on-l1-from-l2:
ARG e2e_build=false
DO +E2E_TEST --test=uniswap_trade_on_l1_from_l2 --e2e_build=$e2e_build
DO +E2E_TEST --test=uniswap_trade_on_l1_from_l2.test.ts --e2e_build=$e2e_build

integration-l1-publisher:
ARG e2e_build=false
DO +E2E_TEST --test=integration_l1_publisher --e2e_build=$e2e_build
DO +E2E_TEST --test=integration_l1_publisher.test.ts --e2e_build=$e2e_build

e2e-cli:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_cli --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_cli.test.ts --e2e_build=$e2e_build

e2e-persistence:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_persistence --compose_file=./scripts/docker-compose-no-sandbox.yml --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_persistence.test.ts --compose_file=./scripts/docker-compose-no-sandbox.yml --e2e_build=$e2e_build

e2e-browser:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_aztec_js_browser --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_aztec_js_browser.test.ts --e2e_build=$e2e_build

e2e-card-game:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_card_game --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_card_game.test.ts --e2e_build=$e2e_build

e2e-avm-simulator:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_avm_simulator --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_avm_simulator.test.ts --e2e_build=$e2e_build

e2e-fees:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_fees --enable_gas=1 --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_fees.test.ts --enable_gas=1 --e2e_build=$e2e_build

e2e-dapp-subscription:
ARG e2e_build=false
DO +E2E_TEST --test=e2e_dapp_subscription --enable_gas=1 --e2e_build=$e2e_build
DO +E2E_TEST --test=e2e_dapp_subscription.test.ts --enable_gas=1 --e2e_build=$e2e_build

pxe:
ARG e2e_build=false
DO +E2E_TEST --test=pxe --e2e_build=$e2e_build
DO +E2E_TEST --test=pxe.test.ts --e2e_build=$e2e_build

cli-docs-sandbox:
ARG e2e_build=false
DO +E2E_TEST --test=cli_docs_sandbox --e2e_build=$e2e_build
DO +E2E_TEST --test=cli_docs_sandbox.test.ts --e2e_build=$e2e_build

e2e-docs-examples:
ARG e2e_build=false
DO +E2E_TEST --test=docs_examples --e2e_build=$e2e_build
DO +E2E_TEST --test=docs_examples.test.ts --e2e_build=$e2e_build

guides-writing-an-account-contract:
ARG e2e_build=false
DO +E2E_TEST --test=guides/writing_an_account_contract.test.ts --e2e_build=$e2e_build

guides-dapp-testing:
ARG e2e_build=false
DO +E2E_TEST --test=guides/dapp_testing.test.ts --e2e_build=$e2e_build

guides-sample-dapp:
ARG e2e_build=false
DO +E2E_TEST --test=sample-dapp --e2e_build=$e2e_build

# TODO currently hangs for hour+
# guides-up-quick-start:
# ARG e2e_build=false
# DO +E2E_TEST --test=guides/up_quick_start.test.ts --e2e_build=$e2e_build

bench-publish-rollup:
ARG e2e_build=false
DO +E2E_TEST --test=benchmarks/bench_publish_rollup.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --e2e_build=$e2e_build --compose_file=./scripts/docker-compose-no-sandbox.yml

# TODO need to investigate why this isn't working
# bench-process-history:
# ARG e2e_build=false
# DO +E2E_TEST --test=benchmarks/bench_process_history.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --e2e_build=$e2e_build --compose_file=./scripts/docker-compose-no-sandbox.yml

# all:
# for stability, instead of an 'all' target in Earthly, use `make all`
# TODO need to investigate why this isn't working
# bench-tx-size:
# ARG e2e_build=false
# DO +E2E_TEST --test=benchmarks/bench_tx_size_fees.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --e2e_build=$e2e_build --compose_file=./scripts/docker-compose-no-sandbox.yml
Loading