Skip to content

Commit

Permalink
Migrate from truffle to test-environment (#2007)
Browse files Browse the repository at this point in the history
* Sketch

* Migrate all tests to test-env

* Finish migration to test-env

* Add config

* Work on GSN tests

* Migrate to newer test-env version and loader syntax

* Add GSN setup

* Finish test-env migration

* Setup coverage using test-env

* Migrate to npm package

* Fix package.json

* Add compile step to CI

* Add comment on coverage setup

* Remove dependency on @truffle/contract

* Fix package-lock merge

* Fix linter errors

* Upgrade test-environment, depend locally on ganche-coverage

* Improve coverage script

* Improve sign.js API

* Move accounts destructuring to describe block

* Switch to prebuilt ethereumjs-vm package

* Upgrade test-enviroment version

* use workspace in circleci config

* remove unnecessary npx
  • Loading branch information
nventuro authored and frangio committed Nov 28, 2019
1 parent ca6a5dc commit 5f92adc
Show file tree
Hide file tree
Showing 87 changed files with 27,524 additions and 4,467 deletions.
38 changes: 20 additions & 18 deletions .circleci/config.yml
Expand Up @@ -8,14 +8,6 @@ aliases:
docker:
- image: circleci/node:10

- &npm_install_if_necessary
run:
name: Install npm dependencies
command: |
if [ ! -d node_modules ]; then
npm ci
fi
- &cache_key_node_modules
key: v1-node_modules-{{ checksum "package-lock.json" }}

Expand All @@ -26,7 +18,19 @@ jobs:
- checkout
- restore_cache:
<<: *cache_key_node_modules
- *npm_install_if_necessary
- run:
name: Install npm dependencies and prepare
command: |
if [ ! -d node_modules ]; then
npm ci
else
npm run prepare
fi
- persist_to_workspace:
root: .
paths:
- node_modules
- build
- save_cache:
paths:
- node_modules
Expand All @@ -36,29 +40,27 @@ jobs:
<<: *defaults
steps:
- checkout
- restore_cache:
<<: *cache_key_node_modules
- *npm_install_if_necessary
- attach_workspace:
at: .
- run:
name: Linter
command: npm run lint
test:
<<: *defaults
steps:
- checkout
- restore_cache:
<<: *cache_key_node_modules
- *npm_install_if_necessary
- attach_workspace:
at: .
- run:
name: Unit tests
command: npm run test

coverage:
<<: *defaults
steps:
- checkout
- restore_cache:
<<: *cache_key_node_modules
- *npm_install_if_necessary
- attach_workspace:
at: .
- run:
name: Unit tests with coverage report
command: npm run coverage
Expand Down
1 change: 1 addition & 0 deletions .eslintrc
Expand Up @@ -25,6 +25,7 @@
"strict": ["error", "global"],

// Code style
"array-bracket-spacing": ["off"],
"camelcase": ["error", {"properties": "always"}],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": ["error", {"before": false, "after": true}],
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -48,3 +48,6 @@ openzeppelin-docs
# only used to package @openzeppelin/contracts
contracts/build/
contracts/README.md

# temporary artifact from solidity-coverage
allFiredEvents
4 changes: 2 additions & 2 deletions .solcover.js
@@ -1,7 +1,7 @@
module.exports = {
norpc: true,
testCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle test --network coverage',
compileCommand: 'node --max-old-space-size=4096 ../node_modules/.bin/truffle compile --network coverage',
testCommand: 'npm test',
compileCommand: 'npm run compile',
skipFiles: [
'lifecycle/Migrations.sol',
'mocks'
Expand Down

0 comments on commit 5f92adc

Please sign in to comment.