From d14d38dabd0d40d85f4844cb9bbdd5916a26a2d4 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 28 Nov 2018 13:21:04 -0800 Subject: Introduce framework for running basic tests for entities (#1344) * Introduce framework for running basic tests for entities * Add pipeline tests to CircleCI config * Make pipeline tests more configurable and fix CircleCI config * Add coverage dir to pipeline package * Add basic tests for all exchange event entities * Add tests for remaining entities * Create separate test scripts in package.json and add new info to README * Update db_setup.ts to revert migrations even if you are using docker * Automatically pull the postgres image if needed * Add comment about why NumberToBigIntTransformer is needed --- packages/pipeline/package.json | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'packages/pipeline/package.json') diff --git a/packages/pipeline/package.json b/packages/pipeline/package.json index a57fbf5bc..9831517fb 100644 --- a/packages/pipeline/package.json +++ b/packages/pipeline/package.json @@ -7,10 +7,13 @@ "build": "yarn tsc -b", "build:ci": "yarn build", "test": "yarn run_mocha", - "rebuild_and_test": "run-s build test", + "rebuild_and_test": "run-s build test:all", + "test:db": "yarn run_mocha:db", + "test:all": "run-s test test:db", "test:circleci": "yarn test:coverage", - "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --bail --exit", - "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", + "run_mocha": "mocha --require source-map-support/register --require make-promises-safe 'lib/test/!(entities)/**/*_test.js' --bail --exit", + "run_mocha:db": "mocha --require source-map-support/register --require make-promises-safe lib/test/db_global_hooks.js 'lib/test/entities/*_test.js' --bail --exit --timeout 60000", + "test:coverage": "nyc npm run test:all --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "clean": "shx rm -rf lib", "lint": "tslint --project . --format stylish --exclude ./migrations/**/*", @@ -50,8 +53,10 @@ "@0x/types": "^1.2.0", "@0x/utils": "^2.0.3", "@0x/web3-wrapper": "^3.1.0", + "@types/dockerode": "^2.5.9", "async-parallel": "^1.2.3", "axios": "^0.18.0", + "dockerode": "^2.5.7", "ethereum-types": "^1.0.6", "pg": "^7.5.0", "ramda": "^0.25.0", -- cgit