diff options
author | Leonid <logvinov.leon@gmail.com> | 2018-01-18 21:16:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-18 21:16:53 +0800 |
commit | e5eec04f92b51319dc55c46c9be7b9d6fe5a1e48 (patch) | |
tree | 5f3e52435f66ad1b7a73af83f95ccbff8a7cef9a /packages/0x.js | |
parent | 87e3fe725d2070cb89c71361a3107f45336ee3bc (diff) | |
parent | b4375d6f64fc0651c7ba347fcfe36e171fa261fc (diff) | |
download | dexon-sol-tools-e5eec04f92b51319dc55c46c9be7b9d6fe5a1e48.tar dexon-sol-tools-e5eec04f92b51319dc55c46c9be7b9d6fe5a1e48.tar.gz dexon-sol-tools-e5eec04f92b51319dc55c46c9be7b9d6fe5a1e48.tar.bz2 dexon-sol-tools-e5eec04f92b51319dc55c46c9be7b9d6fe5a1e48.tar.lz dexon-sol-tools-e5eec04f92b51319dc55c46c9be7b9d6fe5a1e48.tar.xz dexon-sol-tools-e5eec04f92b51319dc55c46c9be7b9d6fe5a1e48.tar.zst dexon-sol-tools-e5eec04f92b51319dc55c46c9be7b9d6fe5a1e48.zip |
Merge pull request #322 from 0xProject/fix/ci-time
Speed-up CI
Diffstat (limited to 'packages/0x.js')
-rw-r--r-- | packages/0x.js/package.json | 9 | ||||
-rwxr-xr-x | packages/0x.js/scripts/test_umd.sh | 6 | ||||
-rw-r--r-- | packages/0x.js/src/globals.d.ts | 12 | ||||
-rw-r--r-- | packages/0x.js/src/order_watcher/event_watcher.ts | 4 | ||||
-rw-r--r-- | packages/0x.js/test/utils/constants.ts | 2 |
5 files changed, 6 insertions, 27 deletions
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 99da45ffb..1405e1bf7 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -14,21 +14,16 @@ "generate_contract_wrappers": "node ../abi-gen/lib/index.js --abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --templates contract_templates --output src/contract_wrappers/generated", "lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'", - "test:circleci": - "run-s test:coverage report_test_coverage && if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", + "test:circleci": "run-s test:coverage report_test_coverage", "test": "run-s clean test:commonjs", - "test:umd": "./scripts/test_umd.sh", "test:coverage": "nyc npm run test --all", "report_test_coverage": "nyc report --reporter=text-lcov | coveralls", "update_contracts": "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;", "clean": "shx rm -rf _bundles lib test_temp", - "build:umd:dev": "webpack", "build:umd:prod": "NODE_ENV=production webpack", "build:commonjs": "tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts;", "test:commonjs": "run-s build:commonjs run_mocha", - "pretest:umd": "run-s clean build:umd:dev build:commonjs", - "substitute_umd_bundle": "shx mv _bundles/* lib/src", "run_mocha": "mocha lib/test/**/*_test.js --timeout 10000 --bail --exit" }, "config": { @@ -88,11 +83,9 @@ "@0xproject/web3-wrapper": "^0.1.5", "bintrees": "^1.0.2", "bn.js": "^4.11.8", - "compare-versions": "^3.0.1", "ethereumjs-abi": "^0.6.4", "ethereumjs-blockstream": "^2.0.6", "ethereumjs-util": "^5.1.1", - "find-versions": "^2.0.0", "js-sha3": "^0.6.1", "lodash": "^4.17.4", "uuid": "^3.1.0", diff --git a/packages/0x.js/scripts/test_umd.sh b/packages/0x.js/scripts/test_umd.sh deleted file mode 100755 index e3eba088a..000000000 --- a/packages/0x.js/scripts/test_umd.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -# This script runs umd tests and cleans up after them while preserving the `return_code` for CI -# UMD tests should only be run after building the commonjs because they reuse some of the commonjs build artifacts -run-s substitute_umd_bundle run_mocha -return_code=$? -exit $return_code diff --git a/packages/0x.js/src/globals.d.ts b/packages/0x.js/src/globals.d.ts index ff8e00b69..4f4932b6e 100644 --- a/packages/0x.js/src/globals.d.ts +++ b/packages/0x.js/src/globals.d.ts @@ -25,18 +25,6 @@ declare module '*.json' { /* tslint:enable */ } -// find-version declarations -declare function findVersions(version: string): string[]; -declare module 'find-versions' { - export = findVersions; -} - -// compare-version declarations -declare function compareVersions(firstVersion: string, secondVersion: string): number; -declare module 'compare-versions' { - export = compareVersions; -} - declare module 'ethereumjs-abi' { const soliditySHA3: (argTypes: string[], args: any[]) => Buffer; } diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts index 43a60957b..5d05bfb60 100644 --- a/packages/0x.js/src/order_watcher/event_watcher.ts +++ b/packages/0x.js/src/order_watcher/event_watcher.ts @@ -51,6 +51,10 @@ export class EventWatcher { } private async _pollForBlockchainEventsAsync(callback: EventWatcherCallback): Promise<void> { const pendingEvents = await this._getEventsAsync(); + if (_.isUndefined(pendingEvents)) { + // HACK: This should never happen, but happens frequently on CI due to a ganache bug + return; + } if (pendingEvents.length === 0) { // HACK: Sometimes when node rebuilds the pending block we get back the empty result. // We don't want to emit a lot of removal events and bring them back after a couple of miliseconds, diff --git a/packages/0x.js/test/utils/constants.ts b/packages/0x.js/test/utils/constants.ts index 7b6b2ee7b..a9e665c25 100644 --- a/packages/0x.js/test/utils/constants.ts +++ b/packages/0x.js/test/utils/constants.ts @@ -1,6 +1,6 @@ export const constants = { NULL_ADDRESS: '0x0000000000000000000000000000000000000000', - RPC_URL: 'http://localhost:8545/', + RPC_URL: 'http://localhost:8545', ROPSTEN_NETWORK_ID: 3, KOVAN_NETWORK_ID: 42, TESTRPC_NETWORK_ID: 50, |