From ec52151b06f30568646fc7bc8c0b8d64961fc76d Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev <16622558+mmv08@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:21:52 +0100 Subject: [PATCH] Add an e2e test that uses upstream bundler --- .github/workflows/ci_4337.yml | 12 ++++++++++++ modules/4337/docker-compose.yaml | 11 +++++++++++ modules/4337/docker/bundler/Dockerfile | 3 ++- modules/4337/package.json | 1 + modules/4337/test/e2e/run.sh | 8 +++++++- 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_4337.yml b/.github/workflows/ci_4337.yml index a7fad27a..cd2c8a17 100644 --- a/.github/workflows/ci_4337.yml +++ b/.github/workflows/ci_4337.yml @@ -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: diff --git a/modules/4337/docker-compose.yaml b/modules/4337/docker-compose.yaml index 0d189872..fee33d68 100644 --- a/modules/4337/docker-compose.yaml +++ b/modules/4337/docker-compose.yaml @@ -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 diff --git a/modules/4337/docker/bundler/Dockerfile b/modules/4337/docker/bundler/Dockerfile index 6dec50a6..a011d0e7 100644 --- a/modules/4337/docker/bundler/Dockerfile +++ b/modules/4337/docker/bundler/Dockerfile @@ -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"] diff --git a/modules/4337/package.json b/modules/4337/package.json index 0aad20cd..2dba52fc 100644 --- a/modules/4337/package.json +++ b/modules/4337/package.json @@ -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", diff --git a/modules/4337/test/e2e/run.sh b/modules/4337/test/e2e/run.sh index 8fdd4204..88ac9ce4 100755 --- a/modules/4337/test/e2e/run.sh +++ b/modules/4337/test/e2e/run.sh @@ -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