diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-07 06:19:12 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-08 06:47:43 +0800 |
commit | a8b8d53d9d91f5fe5ceb623db188757f568e6ecc (patch) | |
tree | a5e225aad454e193c8122db80f0dd9ab60636292 | |
parent | 78d8526e4102fb8e2e1f74e7eb8af15f407335b4 (diff) | |
download | dexon-sol-tools-a8b8d53d9d91f5fe5ceb623db188757f568e6ecc.tar.gz dexon-sol-tools-a8b8d53d9d91f5fe5ceb623db188757f568e6ecc.tar.zst dexon-sol-tools-a8b8d53d9d91f5fe5ceb623db188757f568e6ecc.zip |
Run contracts tests against Geth in CI
-rw-r--r-- | .circleci/config.yml | 41 | ||||
-rwxr-xr-x | packages/devnet/run.sh | 2 |
2 files changed, 24 insertions, 19 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index a4f3e7a91..ebbb9b59e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,7 @@ jobs: key: repo-{{ .Environment.CIRCLE_SHA1 }} paths: - ~/repo - test-1: + test-contracts-ganache: docker: - image: circleci/node:9 working_directory: ~/repo @@ -43,26 +43,20 @@ jobs: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn wsrun test:circleci @0xproject/contract-wrappers - - run: yarn wsrun test:circleci @0xproject/sol-compiler - - save_cache: - key: coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/contract-wrappers/coverage/lcov.info - - save_cache: - key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/sol-compiler/coverage/lcov.info - test-contracts: + - run: yarn wsrun test:circleci contracts + test-contracts-geth: docker: - image: circleci/node:9 + - image: albrow/0x-devnet working_directory: ~/repo steps: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn wsrun test:circleci contracts - test-2: + # HACK(albrow): we need to sleep 15 seconds to ensure the devnet is + # initialized + - run: sleep 15 && TEST_PROVIDER=geth yarn wsrun test contracts + test-rest: docker: - image: circleci/node:9 working_directory: ~/repo @@ -70,6 +64,8 @@ jobs: - restore_cache: keys: - repo-{{ .Environment.CIRCLE_SHA1 }} + - run: yarn wsrun test:circleci @0xproject/contract-wrappers + - run: yarn wsrun test:circleci @0xproject/sol-compiler - run: yarn wsrun test:circleci @0xproject/assert - run: yarn wsrun test:circleci @0xproject/connect - run: yarn wsrun test:circleci @0xproject/dev-utils @@ -78,6 +74,14 @@ jobs: - run: yarn wsrun test:circleci @0xproject/sol-cov - run: yarn wsrun test:circleci @0xproject/metacoin - save_cache: + key: coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }} + paths: + - ~/repo/packages/contract-wrappers/coverage/lcov.info + - save_cache: + key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }} + paths: + - ~/repo/packages/sol-compiler/coverage/lcov.info + - save_cache: key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }} paths: - ~/repo/packages/assert/coverage/lcov.info @@ -162,13 +166,13 @@ workflows: main: jobs: - build - - test-1: + - test-contracts-ganache: requires: - build - - test-2: + - test-contracts-geth: requires: - build - - test-contracts: + - test-rest: requires: - build - static-tests: @@ -176,5 +180,4 @@ workflows: - build - submit-coverage: requires: - - test-1 - - test-2 + - test-rest diff --git a/packages/devnet/run.sh b/packages/devnet/run.sh index 85d223c61..d5c67303f 100755 --- a/packages/devnet/run.sh +++ b/packages/devnet/run.sh @@ -35,7 +35,9 @@ sleep 10 # to break when there are fewer than 3 blocks in the chain. (We have no idea # why, but it was consistently reproducible). /geth --datadir node0/ attach --exec 'eth.sendTransaction({"from": "0x5409ED021D9299bf6814279A6A1411A7e866A631", "to": "0x84bd1cfa409cb0bb9b23b8b1a33515b4ac00a0af", "value": "0x1"})' +sleep 2 /geth --datadir node0/ attach --exec 'eth.sendTransaction({"from": "0x5409ED021D9299bf6814279A6A1411A7e866A631", "to": "0x84bd1cfa409cb0bb9b23b8b1a33515b4ac00a0af", "value": "0x1"})' +sleep 2 /geth --datadir node0/ attach --exec 'eth.sendTransaction({"from": "0x5409ED021D9299bf6814279A6A1411A7e866A631", "to": "0x84bd1cfa409cb0bb9b23b8b1a33515b4ac00a0af", "value": "0x1"})' # Use tail to re-attach to the log file and actually see the output. |