This repository has been archived by the owner on Dec 5, 2021. It is now read-only.
forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerize Integration Tests (ethereum-optimism#670)
* test: add docker image for integration tests * feat: add to docker-compose with scale 0 * ci: run and publish integration tests to dockerhub * test: add option to not bring network up for docker integration tests * chore: add --fail --show-error to curl
- Loading branch information
Showing
9 changed files
with
111 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM ethereumoptimism/builder AS builder | ||
|
||
FROM node:14-alpine | ||
|
||
RUN apk add --no-cache git curl python bash jq | ||
|
||
WORKDIR /opt/optimism/ | ||
|
||
COPY --from=builder /optimism/*.json /optimism/yarn.lock ./ | ||
COPY --from=builder /optimism/node_modules ./node_modules | ||
|
||
# copy deps (would have been nice if docker followed the symlinks required) | ||
COPY --from=builder /optimism/packages/core-utils/package.json ./packages/core-utils/package.json | ||
COPY --from=builder /optimism/packages/core-utils/dist ./packages/core-utils/dist | ||
|
||
COPY --from=builder /optimism/packages/hardhat-ovm/package.json ./packages/hardhat-ovm/package.json | ||
COPY --from=builder /optimism/packages/hardhat-ovm/dist ./packages/hardhat-ovm/dist | ||
|
||
COPY --from=builder /optimism/packages/contracts ./packages/contracts | ||
|
||
# get the needed built artifacts | ||
WORKDIR /opt/optimism/integration-tests | ||
COPY --from=builder /optimism/integration-tests ./ | ||
|
||
COPY ./ops/scripts/integration-tests.sh ./ | ||
ENTRYPOINT yarn test:integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
RETRIES=${RETRIES:-60} | ||
JSON='{"jsonrpc":"2.0","id":0,"method":"rollup_getInfo","params":[]}' | ||
|
||
if [[ ! -z "$URL" ]]; then | ||
# get the addrs from the URL provided | ||
ADDRESSES=$(curl --fail --show-error --silent --retry-connrefused --retry $RETRIES --retry-delay 5 $URL) | ||
export ADDRESS_MANAGER=$(echo $ADDRESSES | jq -r '.AddressManager') | ||
fi | ||
|
||
# wait for the sequencer to be up | ||
curl \ | ||
--silent \ | ||
--fail \ | ||
--show-error \ | ||
-H "Content-Type: application/json" \ | ||
--retry-connrefused \ | ||
--retry $RETRIES \ | ||
--retry-delay 3 \ | ||
-d $JSON \ | ||
--output /dev/null \ | ||
$L2_URL | ||
|
||
npx hardhat test --network optimism --no-compile |