Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
8f85a105
Commit
8f85a105
authored
Apr 29, 2021
by
Liam Horne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: enable auto start of docker-compose services in integration tests
parent
4837aaed
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
87 additions
and
4 deletions
+87
-4
README.md
README.md
+0
-1
package.json
integration-tests/package.json
+3
-1
basic-l1-l2-communication.spec.ts
integration-tests/test/basic-l1-l2-communication.spec.ts
+6
-0
erc20.spec.ts
integration-tests/test/erc20.spec.ts
+6
-0
fee-payment.spec.ts
integration-tests/test/fee-payment.spec.ts
+5
-0
native-eth.spec.ts
integration-tests/test/native-eth.spec.ts
+6
-0
ovmcontext.spec.ts
integration-tests/test/ovmcontext.spec.ts
+6
-0
queue-ingestion.spec.ts
integration-tests/test/queue-ingestion.spec.ts
+5
-0
read-proxy-event.spec.ts
integration-tests/test/read-proxy-event.spec.ts
+6
-0
rpc.spec.ts
integration-tests/test/rpc.spec.ts
+6
-0
docker-compose.ts
integration-tests/test/shared/docker-compose.ts
+29
-0
yarn.lock
yarn.lock
+9
-2
No files found.
README.md
View file @
8f85a105
...
@@ -69,7 +69,6 @@ cd ops
...
@@ -69,7 +69,6 @@ cd ops
export
COMPOSE_DOCKER_CLI_BUILD
=
1
export
COMPOSE_DOCKER_CLI_BUILD
=
1
export
DOCKER_BUILDKIT
=
1
export
DOCKER_BUILDKIT
=
1
docker-compose build
docker-compose build
docker-compose up
-d
cd
../integration-tests
cd
../integration-tests
yarn build:integration
yarn build:integration
yarn
test
:integration
yarn
test
:integration
...
...
integration-tests/package.json
View file @
8f85a105
...
@@ -23,12 +23,14 @@
...
@@ -23,12 +23,14 @@
"@nomiclabs/hardhat-ethers"
:
"^2.0.2"
,
"@nomiclabs/hardhat-ethers"
:
"^2.0.2"
,
"chai"
:
"^4.3.3"
,
"chai"
:
"^4.3.3"
,
"chai-as-promised"
:
"^7.1.1"
,
"chai-as-promised"
:
"^7.1.1"
,
"docker-compose"
:
"^0.23.8"
,
"envalid"
:
"^7.1.0"
,
"envalid"
:
"^7.1.0"
,
"ethereum-waffle"
:
"^3.3.0"
,
"ethereum-waffle"
:
"^3.3.0"
,
"ethers"
:
"^5.0.32"
,
"ethers"
:
"^5.0.32"
,
"hardhat"
:
"^2.2.1"
,
"hardhat"
:
"^2.2.1"
,
"hardhat-gas-reporter"
:
"^1.0.4"
,
"hardhat-gas-reporter"
:
"^1.0.4"
,
"mocha"
:
"^8.3.1"
,
"mocha"
:
"^8.3.1"
,
"rimraf"
:
"^3.0.2"
"rimraf"
:
"^3.0.2"
,
"shelljs"
:
"^0.8.4"
}
}
}
}
integration-tests/test/basic-l1-l2-communication.spec.ts
View file @
8f85a105
...
@@ -8,6 +8,12 @@ import { Direction } from './shared/watcher-utils'
...
@@ -8,6 +8,12 @@ import { Direction } from './shared/watcher-utils'
import
l1SimpleStorageJson
from
'
../artifacts/contracts/SimpleStorage.sol/SimpleStorage.json
'
import
l1SimpleStorageJson
from
'
../artifacts/contracts/SimpleStorage.sol/SimpleStorage.json
'
import
l2SimpleStorageJson
from
'
../artifacts-ovm/contracts/SimpleStorage.sol/SimpleStorage.json
'
import
l2SimpleStorageJson
from
'
../artifacts-ovm/contracts/SimpleStorage.sol/SimpleStorage.json
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
DockerComposeNetwork
}
from
'
./shared/docker-compose
'
before
(
async
()
=>
{
await
new
DockerComposeNetwork
().
up
()
})
describe
(
'
Basic L1<>L2 Communication
'
,
async
()
=>
{
describe
(
'
Basic L1<>L2 Communication
'
,
async
()
=>
{
let
Factory__L1SimpleStorage
:
ContractFactory
let
Factory__L1SimpleStorage
:
ContractFactory
...
...
integration-tests/test/erc20.spec.ts
View file @
8f85a105
...
@@ -3,6 +3,12 @@ import { ethers } from 'hardhat'
...
@@ -3,6 +3,12 @@ import { ethers } from 'hardhat'
import
{
expect
}
from
'
chai
'
import
{
expect
}
from
'
chai
'
import
{
GWEI
}
from
'
./shared/utils
'
import
{
GWEI
}
from
'
./shared/utils
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
DockerComposeNetwork
}
from
'
./shared/docker-compose
'
before
(
async
()
=>
{
await
new
DockerComposeNetwork
().
up
()
})
describe
(
'
Basic ERC20 interactions
'
,
async
()
=>
{
describe
(
'
Basic ERC20 interactions
'
,
async
()
=>
{
const
initialAmount
=
1000
const
initialAmount
=
1000
...
...
integration-tests/test/fee-payment.spec.ts
View file @
8f85a105
...
@@ -3,6 +3,11 @@ import chaiAsPromised from 'chai-as-promised'
...
@@ -3,6 +3,11 @@ import chaiAsPromised from 'chai-as-promised'
chai
.
use
(
chaiAsPromised
)
chai
.
use
(
chaiAsPromised
)
import
{
BigNumber
,
utils
}
from
'
ethers
'
import
{
BigNumber
,
utils
}
from
'
ethers
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
DockerComposeNetwork
}
from
'
./shared/docker-compose
'
before
(
async
()
=>
{
await
new
DockerComposeNetwork
().
up
()
})
describe
(
'
Fee Payment Integration Tests
'
,
async
()
=>
{
describe
(
'
Fee Payment Integration Tests
'
,
async
()
=>
{
let
env
:
OptimismEnv
let
env
:
OptimismEnv
...
...
integration-tests/test/native-eth.spec.ts
View file @
8f85a105
...
@@ -2,9 +2,15 @@ import { expect } from 'chai'
...
@@ -2,9 +2,15 @@ import { expect } from 'chai'
import
{
Wallet
,
utils
,
BigNumber
}
from
'
ethers
'
import
{
Wallet
,
utils
,
BigNumber
}
from
'
ethers
'
import
{
Direction
}
from
'
./shared/watcher-utils
'
import
{
Direction
}
from
'
./shared/watcher-utils
'
import
{
DockerComposeNetwork
}
from
'
./shared/docker-compose
'
import
{
PROXY_SEQUENCER_ENTRYPOINT_ADDRESS
}
from
'
./shared/utils
'
import
{
PROXY_SEQUENCER_ENTRYPOINT_ADDRESS
}
from
'
./shared/utils
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
before
(
async
()
=>
{
await
new
DockerComposeNetwork
().
up
()
})
describe
(
'
Native ETH Integration Tests
'
,
async
()
=>
{
describe
(
'
Native ETH Integration Tests
'
,
async
()
=>
{
let
env
:
OptimismEnv
let
env
:
OptimismEnv
let
l1Bob
:
Wallet
let
l1Bob
:
Wallet
...
...
integration-tests/test/ovmcontext.spec.ts
View file @
8f85a105
...
@@ -8,9 +8,15 @@ import {
...
@@ -8,9 +8,15 @@ import {
getAddressManager
,
getAddressManager
,
}
from
'
./shared/utils
'
}
from
'
./shared/utils
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
DockerComposeNetwork
}
from
'
./shared/docker-compose
'
import
{
getContractFactory
}
from
'
@eth-optimism/contracts
'
import
{
getContractFactory
}
from
'
@eth-optimism/contracts
'
import
{
Contract
,
ContractFactory
,
Wallet
,
BigNumber
}
from
'
ethers
'
import
{
Contract
,
ContractFactory
,
Wallet
,
BigNumber
}
from
'
ethers
'
before
(
async
()
=>
{
await
new
DockerComposeNetwork
().
up
()
})
/**
/**
* These tests cover the OVM execution contexts. In the OVM execution
* These tests cover the OVM execution contexts. In the OVM execution
* of a L1 to L2 transaction, both `block.number` and `block.timestamp`
* of a L1 to L2 transaction, both `block.number` and `block.timestamp`
...
...
integration-tests/test/queue-ingestion.spec.ts
View file @
8f85a105
...
@@ -2,11 +2,16 @@
...
@@ -2,11 +2,16 @@
import
{
injectL2Context
}
from
'
@eth-optimism/core-utils
'
import
{
injectL2Context
}
from
'
@eth-optimism/core-utils
'
import
{
sleep
}
from
'
./shared/utils
'
import
{
sleep
}
from
'
./shared/utils
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
DockerComposeNetwork
}
from
'
./shared/docker-compose
'
/* Imports: External */
/* Imports: External */
import
{
providers
}
from
'
ethers
'
import
{
providers
}
from
'
ethers
'
import
{
expect
}
from
'
chai
'
import
{
expect
}
from
'
chai
'
before
(
async
()
=>
{
await
new
DockerComposeNetwork
().
up
()
})
// This test ensures that the transactions which get `enqueue`d get
// This test ensures that the transactions which get `enqueue`d get
// added to the L2 blocks by the Sync Service (which queries the DTL)
// added to the L2 blocks by the Sync Service (which queries the DTL)
describe
(
'
Queue Ingestion
'
,
()
=>
{
describe
(
'
Queue Ingestion
'
,
()
=>
{
...
...
integration-tests/test/read-proxy-event.spec.ts
View file @
8f85a105
...
@@ -4,6 +4,12 @@ import { ethers } from 'hardhat'
...
@@ -4,6 +4,12 @@ import { ethers } from 'hardhat'
/* Imports: External */
/* Imports: External */
import
{
Contract
,
Wallet
}
from
'
ethers
'
import
{
Contract
,
Wallet
}
from
'
ethers
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
DockerComposeNetwork
}
from
'
./shared/docker-compose
'
before
(
async
()
=>
{
await
new
DockerComposeNetwork
().
up
()
})
describe
(
'
Reading events from proxy contracts
'
,
()
=>
{
describe
(
'
Reading events from proxy contracts
'
,
()
=>
{
let
l2Wallet
:
Wallet
let
l2Wallet
:
Wallet
...
...
integration-tests/test/rpc.spec.ts
View file @
8f85a105
import
{
injectL2Context
}
from
'
@eth-optimism/core-utils
'
import
{
injectL2Context
}
from
'
@eth-optimism/core-utils
'
import
{
Wallet
,
BigNumber
}
from
'
ethers
'
import
{
Wallet
,
BigNumber
}
from
'
ethers
'
import
chai
,
{
expect
}
from
'
chai
'
import
chai
,
{
expect
}
from
'
chai
'
import
{
sleep
,
l2Provider
,
GWEI
}
from
'
./shared/utils
'
import
{
sleep
,
l2Provider
,
GWEI
}
from
'
./shared/utils
'
import
chaiAsPromised
from
'
chai-as-promised
'
import
chaiAsPromised
from
'
chai-as-promised
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
OptimismEnv
}
from
'
./shared/env
'
import
{
DockerComposeNetwork
}
from
'
./shared/docker-compose
'
chai
.
use
(
chaiAsPromised
)
chai
.
use
(
chaiAsPromised
)
before
(
async
()
=>
{
await
new
DockerComposeNetwork
().
up
()
})
describe
(
'
Basic RPC tests
'
,
()
=>
{
describe
(
'
Basic RPC tests
'
,
()
=>
{
let
env
:
OptimismEnv
let
env
:
OptimismEnv
...
...
integration-tests/test/shared/docker-compose.ts
0 → 100644
View file @
8f85a105
import
*
as
compose
from
'
docker-compose
'
import
*
as
shell
from
'
shelljs
'
import
*
as
path
from
'
path
'
type
ServiceNames
=
'
batch_submitter
'
|
'
dtl
'
|
'
l2geth
'
|
'
relayer
'
const
OPS_DIRECTORY
=
path
.
join
(
process
.
cwd
(),
'
../ops
'
)
const
DEFAULT_SERVICES
:
ServiceNames
[]
=
[
'
batch_submitter
'
,
'
dtl
'
,
'
l2geth
'
,
'
relayer
'
]
export
class
DockerComposeNetwork
{
constructor
(
private
readonly
services
:
ServiceNames
[]
=
DEFAULT_SERVICES
)
{}
async
up
()
{
const
out
=
await
compose
.
upMany
(
this
.
services
,
{
cwd
:
OPS_DIRECTORY
})
const
{
err
,
exitCode
}
=
out
;
if
(
!
err
||
exitCode
)
{
console
.
error
(
err
)
throw
new
Error
(
'
Unexpected error when starting docker-compose network, dumping output
'
)
}
if
(
err
.
includes
(
'
Creating
'
))
{
console
.
info
(
'
🐳 Tests required starting containers. Waiting for sequencer to ready.
'
)
shell
.
exec
(
`
${
OPS_DIRECTORY
}
/scripts/wait-for-sequencer.sh`
,
{
cwd
:
OPS_DIRECTORY
})
}
}
}
yarn.lock
View file @
8f85a105
...
@@ -5058,6 +5058,13 @@ directory-tree@^2.2.7:
...
@@ -5058,6 +5058,13 @@ directory-tree@^2.2.7:
resolved "https://registry.yarnpkg.com/directory-tree/-/directory-tree-2.2.7.tgz#4617c794ee89d5618f03fffb7486c7e49df52ad2"
resolved "https://registry.yarnpkg.com/directory-tree/-/directory-tree-2.2.7.tgz#4617c794ee89d5618f03fffb7486c7e49df52ad2"
integrity sha512-fgTad/YdV6Y2njsCRK4fl4ZUlGhmb5xj1qrZUIMjvnrKvghVqh8dkB+OUssjYVvb/Q2L+5+8XG0l5uTGI9/8iQ==
integrity sha512-fgTad/YdV6Y2njsCRK4fl4ZUlGhmb5xj1qrZUIMjvnrKvghVqh8dkB+OUssjYVvb/Q2L+5+8XG0l5uTGI9/8iQ==
docker-compose@^0.23.8:
version "0.23.8"
resolved "https://registry.yarnpkg.com/docker-compose/-/docker-compose-0.23.8.tgz#475b1e1294821d380316c54277ad350074186c6f"
integrity sha512-uUxjnz77oU+HBwwRYKO/O5a1IywSZbWNayC1+q4e4t3HzKwBHi+5pmIpESjpsEvIVl/HWAC3mPB89NjUNEBWuQ==
dependencies:
yaml "^1.10.2"
dom-walk@^0.1.0:
dom-walk@^0.1.0:
version "0.1.2"
version "0.1.2"
resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84"
resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84"
...
@@ -11663,7 +11670,7 @@ shebang-regex@^3.0.0:
...
@@ -11663,7 +11670,7 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
shelljs@^0.8.3:
shelljs@^0.8.3
, shelljs@^0.8.4
:
version "0.8.4"
version "0.8.4"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
...
@@ -14063,7 +14070,7 @@ yallist@^4.0.0:
...
@@ -14063,7 +14070,7 @@ yallist@^4.0.0:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
yaml@^1.10.0:
yaml@^1.10.0
, yaml@^1.10.2
:
version "1.10.2"
version "1.10.2"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment