diff --git a/.circleci/config.yml b/.circleci/config.yml index cc1eedce9e..585e1a9e97 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,24 +46,48 @@ jobs: job-integration-tests: working_directory: ~/repo machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2004:202104-01 docker_layer_caching: true resource_class: large steps: - checkout - attach_workspace: at: . + - restore_cache: + keys: + - v5-optimism-build- + - run: + name: Build docker containers if necessary + command: | + if [ ! -d ./optimism ]; then + npx hardhat ops --fresh --build --build-ops + fi; + - save_cache: + key: v5-optimism-build- + paths: + - ./optimism - run: name: Start docker chains background: true command: | - npx hardhat node + docker --version + npx hardhat ops --start - cmd-wait-for-port: port: 8545 + - cmd-wait-for-port: + port: 9545 - run: name: Run isolated layer 1 integration tests command: | - npx hardhat test:integration:l1 --compile --deploy + npx hardhat test:integration:l1 --compile --deploy --provider-port 9545 + - run: + name: Run isolated layer 2 integration tests + command: | + npx hardhat test:integration:l2 --compile --deploy + - run: + name: Run dual layer 1 and layer 2 integration tests + command: | + npx hardhat test:integration:dual --deploy job-lint: working_directory: ~/repo docker: @@ -318,7 +342,7 @@ workflows: requires: - job-prepare - job-integration-tests: - name: job-integration-tests-simplified + name: job-integration-tests requires: - job-prepare - job-pack-browser: diff --git a/.circleci/src/jobs/job-integration-tests.yml b/.circleci/src/jobs/job-integration-tests.yml index 91bfa7ec52..adaeb79e09 100644 --- a/.circleci/src/jobs/job-integration-tests.yml +++ b/.circleci/src/jobs/job-integration-tests.yml @@ -6,41 +6,38 @@ steps: - checkout - attach_workspace: at: . - # - restore_cache: - # keys: - # - v4-optimism-build-{{ checksum "package-lock.json" }} - # - run: - # name: Build docker containers if necessary - # command: | - # if [ ! -d ./optimism ]; then - # npx hardhat ops --fresh --build --build-ops - # fi; - # - save_cache: - # key: v4-optimism-build-{{ checksum "package-lock.json" }} - # paths: - # - ./optimism + - restore_cache: + keys: + - v5-optimism-build-{{ checksum "package-lock.json" }} + - run: + name: Build docker containers if necessary + command: | + if [ ! -d ./optimism ]; then + npx hardhat ops --fresh --build --build-ops + fi; + - save_cache: + key: v5-optimism-build-{{ checksum "package-lock.json" }} + paths: + - ./optimism - run: name: Start docker chains background: true command: | docker --version - npx hardhat node - # npx hardhat ops --start + npx hardhat ops --start - cmd-wait-for-port: port: 8545 - # - cmd-wait-for-port: - # port: 9545 + - cmd-wait-for-port: + port: 9545 - run: name: Run isolated layer 1 integration tests command: | - # npx hardhat test:integration:l1 --compile --deploy --provider-port 9545 - npx hardhat test:integration:l1 --compile --deploy - # TODO: Disabled until the ops tool becomes more stable - # - run: - # name: Run isolated layer 2 integration tests - # command: | - # npx hardhat test:integration:l2 --compile --deploy - # - run: - # name: Run dual layer 1 and layer 2 integration tests - # command: | - # npx hardhat test:integration:dual --deploy + npx hardhat test:integration:l1 --compile --deploy --provider-port 9545 + - run: + name: Run isolated layer 2 integration tests + command: | + npx hardhat test:integration:l2 --compile --deploy + - run: + name: Run dual layer 1 and layer 2 integration tests + command: | + npx hardhat test:integration:dual --deploy diff --git a/.circleci/src/snippets/job-header-machine.yml b/.circleci/src/snippets/job-header-machine.yml index 6c7744e330..3324e59b9b 100644 --- a/.circleci/src/snippets/job-header-machine.yml +++ b/.circleci/src/snippets/job-header-machine.yml @@ -1,4 +1,4 @@ working_directory: ~/repo machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2004:202104-01 docker_layer_caching: true diff --git a/.circleci/src/workflows/workflow-all.yml b/.circleci/src/workflows/workflow-all.yml index 4ebf1ce4c8..6d4906c489 100644 --- a/.circleci/src/workflows/workflow-all.yml +++ b/.circleci/src/workflows/workflow-all.yml @@ -34,7 +34,7 @@ jobs: # Integration tests # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - job-integration-tests: - name: job-integration-tests-simplified + name: job-integration-tests {{> require-prepare.yml}} # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/test/integration/utils/bootstrap.js b/test/integration/utils/bootstrap.js index ef1effdc5d..0aa33706c2 100644 --- a/test/integration/utils/bootstrap.js +++ b/test/integration/utils/bootstrap.js @@ -85,7 +85,7 @@ function bootstrapDual({ ctx }) { ctx.l2.provider = _setupProvider({ url: `${hre.config.providerUrl}:${hre.config.providerPortL2}`, }); - ctx.provider.getGasPrice = () => ethers.utils.parseUnits(OVM_GAS_PRICE_GWEI, 'gwei'); + ctx.l2.provider.getGasPrice = () => ethers.utils.parseUnits(OVM_GAS_PRICE_GWEI, 'gwei'); await setupOptimismWatchers({ ctx, providerUrl: hre.config.providerUrl });