Skip to content

Commit

Permalink
Add an e2e test that uses upstream bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
mmv08 committed Jan 31, 2024
1 parent abfafdc commit ec52151
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci_4337.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ jobs:
- run: |
npm ci
npm run test:e2e -w modules/4337
e2e-upstream-bundler:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: npm
cache-dependency-path: package-lock.json
- run: |
npm ci
npm run test:e2e:upstream -w modules/4337
lint:
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 11 additions & 0 deletions modules/4337/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ services:
command: ['--auto', '--network=http://geth:8545']
ports:
- 3000:3000

bundler-upstream:
build:
context: .
dockerfile: docker/bundler/Dockerfile
args:
TAG: main
restart: always
command: ['--auto', '--network=http://geth:8545']
ports:
- 3000:3000
3 changes: 2 additions & 1 deletion modules/4337/docker/bundler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM docker.io/library/node:18

ARG TAG=v0.6.1
RUN git clone https://github.com/eth-infinitism/bundler /src/bundler
WORKDIR /src/bundler
RUN git checkout v0.6.1
RUN git checkout ${TAG}

RUN yarn && yarn preprocess
ENTRYPOINT ["yarn", "bundler"]
Expand Down
1 change: 1 addition & 0 deletions modules/4337/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"build:ts": "npx rimraf dist && tsc",
"test": "hardhat test --deploy-fixture",
"test:e2e": "./test/e2e/run.sh",
"test:e2e:upstream": "USE_UPSTREAM_BUNDLER=1 ./test/e2e/run.sh",
"test:all": "npm run test && npm run test:e2e",
"coverage": "hardhat coverage --network hardhat",
"benchmark": "npm run test benchmark/*.ts",
Expand Down
8 changes: 7 additions & 1 deletion modules/4337/test/e2e/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env bash

docker compose up -d
bundler_container="bundler"

if [[ -n "$USE_UPSTREAM_BUNDLER" ]]; then
bundler_container="bundler-upstream"
fi

docker compose up -d geth "$bundler_container"
# wait for containers to start up
SECONDS=0
until curl -fs http://localhost:8545 >/dev/null && curl -fs http://localhost:3000 >/dev/null; do
Expand Down

0 comments on commit ec52151

Please sign in to comment.