Skip to content

Commit

Permalink
contracts-bedrock: debug tests (#11397)
Browse files Browse the repository at this point in the history
* contracts-bedrock: debug tests

See why the tests are flaking and cannot be reproduced locally.
Also modularize/cleanup CI along the way

* typo: fix

* debug: remove

* just: update name

* ci: better error help

* ci: fix typo

* contracts-bedrock: abstract

* ci: run with foundry profile ci
  • Loading branch information
tynes authored Aug 8, 2024
1 parent 7343468 commit 0c8d7c8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
46 changes: 25 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ commands:
pip3 install -r requirements.txt
python3 main.py "<<parameters.patterns>>"
install-contracts-dependencies:
description: "Install the dependencies for the smart contracts"
steps:
- run:
command: just install
working_directory: packages/contracts-bedrock

notify-failures-on-develop:
description: "Notify Slack"
parameters:
Expand Down Expand Up @@ -180,9 +187,7 @@ jobs:
- run:
name: "Check L1 geth version"
command: ./ops/scripts/geth-version-checker.sh || (echo "geth version is wrong, update ci-builder"; false)
- run:
name: git submodules
command: make submodules
- install-contracts-dependencies
- restore_cache:
name: Restore PNPM Package Cache
keys:
Expand Down Expand Up @@ -516,9 +521,7 @@ jobs:
resource_class: xlarge
steps:
- checkout
- run:
name: git submodules
command: make submodules
- install-contracts-dependencies
- check-changed:
patterns: contracts-bedrock,op-node
- run:
Expand All @@ -545,11 +548,13 @@ jobs:
resource_class: xlarge
steps:
- checkout
- run:
name: git submodules
command: make submodules
- check-changed:
patterns: contracts-bedrock,op-node
- install-contracts-dependencies
- run:
name: print dependencies
command: just dep-status
working_directory: packages/contracts-bedrock
- run:
name: print forge version
command: forge --version
Expand All @@ -561,16 +566,21 @@ jobs:
FOUNDRY_PROFILE: ci
working_directory: packages/contracts-bedrock
no_output_timeout: 15m
- run:
name: print failed test traces
command: just test-rerun
environment:
FOUNDRY_PROFILE: ci
working_directory: packages/contracts-bedrock
when: on_fail

contracts-bedrock-checks:
docker:
- image: <<pipeline.parameters.ci_builder_image>>
resource_class: xlarge
steps:
- checkout
- run:
name: git submodules
command: make submodules
- install-contracts-dependencies
- restore_cache:
name: Restore PNPM Package Cache
keys:
Expand Down Expand Up @@ -1071,9 +1081,7 @@ jobs:
key: gomod-{{ checksum "go.sum" }}
- restore_cache:
key: golang-build-cache
- run:
name: git submodules
command: make submodules
- install-contracts-dependencies
- run:
name: generate devnet allocs
command: make devnet-allocs
Expand Down Expand Up @@ -1171,9 +1179,7 @@ jobs:
name: Install pnpm
command: |
npm i pnpm --global
- run:
name: git submodules
command: make submodules
- install-contracts-dependencies
- attach_workspace:
at: "."
- when:
Expand Down Expand Up @@ -1486,9 +1492,7 @@ jobs:
resource_class: xlarge
steps:
- checkout
- run:
name: Checkout Submodule
command: make submodules
- install-contracts-dependencies
- check-changed:
no_go_deps: "true"
patterns: contracts-bedrock/test/kontrol,contracts-bedrock/src/L1/OptimismPortal\.sol,contracts-bedrock/src/L1/OptimismPortal2\.sol,contracts-bedrock/src/L1/L1CrossDomainMessenger\.sol,contracts-bedrock/src/L1/L1ERC721Bridge\.sol,contracts-bedrock/src/L1/L1StandardBridge\.sol,contracts-bedrock/src/L1/ResourceMetering\.sol,contracts-bedrock/src/universal/StandardBridge\.sol,contracts-bedrock/src/universal/ERC721Bridge\.sol,contracts-bedrock/src/universal/CrossDomainMessenger\.sol
Expand Down
9 changes: 9 additions & 0 deletions packages/contracts-bedrock/justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
prebuild:
./scripts/checks/check-foundry-install.sh

dep-status:
git submodule status

install:
forge install

build: prebuild
forge build

Expand All @@ -16,6 +22,9 @@ test: build-go-ffi
test-kontrol:
./test/kontrol/scripts/run-kontrol.sh script

test-rerun: build-go-ffi
forge test --rerun -vvv

genesis:
forge script scripts/L2Genesis.s.sol:L2Genesis --sig 'runWithStateDump()'

Expand Down

0 comments on commit 0c8d7c8

Please sign in to comment.