Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
73 changes: 49 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,52 @@ jobs:
- run: npx hardhat compile --optimizer --fail-oversize
- run: rm -rf build # force a clean build
- run: npx hardhat compile --use-ovm --optimizer --fail-oversize
job-integration-tests:
working_directory: ~/repo
machine:
image: ubuntu-2004:202010-01
docker_layer_caching: true
resource_class: large
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Build docker containers
command: |
git clone git@github.com:ethereum-optimism/optimism.git
cd optimism
git fetch
git checkout develop
git pull origin develop
yarn
yarn build
cd ops
export COMPOSE_DOCKER_CLI_BUILD=1
export DOCKER_BUILDKIT=1
docker-compose build --parallel
- run:
name: Start chains
background: true
command: |
cd optimism/ops
docker-compose up -d
- 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
- 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 --connect
job-lint:
working_directory: ~/repo
docker:
Expand Down Expand Up @@ -73,26 +119,6 @@ jobs:
root: .
paths:
- node_modules
job-prod-diff-tests-local-ovm:
working_directory: ~/repo
docker:
- image: synthetixio/docker-node:14.16-focal
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_TOKEN
steps:
- checkout
- attach_workspace:
at: .
- run: node publish build --test-helpers
- run: npx hardhat compile --force
- run:
command: npx hardhat node
background: true
- cmd-wait-for-port:
port: 8545
- run: node publish deploy --network local --fresh-deploy --yes --use-ovm --ignore-safety-checks --ignore-custom-parameters --deployment-path ./publish/deployed/local-ovm
- run: npm run test:prod -- --no-compile --use-ovm --patch-fresh-deployment --deployment-path ./publish/deployed/local-ovm
job-prod-diff-tests-local:
working_directory: ~/repo
docker:
Expand Down Expand Up @@ -384,6 +410,9 @@ workflows:
- job-test-deploy-script:
requires:
- job-prepare
- job-integration-tests:
requires:
- job-prepare
- job-prod-tests:
requires:
- job-prepare
Expand All @@ -395,10 +424,6 @@ workflows:
name: job-prod-diff-tests-local
requires:
- job-prepare
- job-prod-diff-tests-local-ovm:
name: job-prod-diff-tests-local-ovm
requires:
- job-prepare
- job-prod-diff-tests:
name: job-prod-diff-tests-mainnet
requires:
Expand Down
43 changes: 43 additions & 0 deletions .circleci/src/jobs/job-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Starts optimism-integration L1 and L2 local chains and runs Optimism integration tests against them
{{> job-header-machine.yml}}
resource_class: large
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Build docker containers
command: |
git clone git@github.com:ethereum-optimism/optimism.git
cd optimism
git fetch
git checkout develop
git pull origin develop
yarn
yarn build
cd ops
export COMPOSE_DOCKER_CLI_BUILD=1
export DOCKER_BUILDKIT=1
docker-compose build --parallel
- run:
name: Start chains
background: true
command: |
cd optimism/ops
docker-compose up -d
- 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
- 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 --connect
21 changes: 0 additions & 21 deletions .circleci/src/jobs/job-prod-diff-tests-local-ovm.yml

This file was deleted.

9 changes: 6 additions & 3 deletions .circleci/src/workflows/workflow-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
- job-test-deploy-script:
{{> require-prepare.yml}}

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Integration tests
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- job-integration-tests:
{{> require-prepare.yml}}

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Prod tests
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -35,9 +41,6 @@ jobs:
- job-prod-diff-tests-local:
name: job-prod-diff-tests-local
{{> require-prepare.yml}}
- job-prod-diff-tests-local-ovm:
name: job-prod-diff-tests-local-ovm
{{> require-prepare.yml}}
- job-prod-diff-tests:
name: job-prod-diff-tests-mainnet
{{> require-prepare.yml}}
Expand Down
3 changes: 3 additions & 0 deletions hardhat/tasks/task-test-integration-dual.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {

task('test:integration:dual', 'run integrated layer 1 and layer 2 production tests')
.addFlag('deploy', 'Deploy l1 and l2 instances before running the tests')
.addFlag('connect', 'Connect already deployed l1 and l2 instances before running the tests')
.setAction(async (taskArguments, hre) => {
hre.config.paths.tests = './test/integration/dual/';

Expand All @@ -27,7 +28,9 @@ task('test:integration:dual', 'run integrated layer 1 and layer 2 production tes

await compileInstance({ useOvm: true });
await deployInstance({ useOvm: true, providerUrl, providerPort: providerPortL2 });
}

if (taskArguments.connect) {
await connectInstances({ providerUrl, providerPortL1, providerPortL2 });
}

Expand Down
2 changes: 1 addition & 1 deletion hardhat/tasks/task-test-integration-l2.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ task('test:integration:l2', 'run isolated layer 2 production tests')
.addOptionalParam(
'providerPort',
'The target port for the running local chain to test on',
'9545'
'8545'
)
.setAction(async (taskArguments, hre) => {
hre.config.paths.tests = './test/integration/l2/';
Expand Down
Loading