This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable hoisting and integration tests (#1041)
* Sync @babel/core * Sync @babel/preset-env * Sync @babel/register * Sync nodemon * Sync EnvKey * Sync bignumber.js * Sync @babel/cli * Sync chai-bignumber * Sync ajv * Sync sequelize * Sync cors * Sync webpack * Sync express * Sync dotenv * Sync react-scripts * Sync redux * Add package-lock for mobile * Sync react * Sync form-data * Sync logplease * Sync moment * Sync babel-loader * Sync html-webpack-plugin * Sync reeact-dom * Sync react-router-dom * Update root package lock * Remove relative imports from origin-contracts * Sync web3 * Update docker ignore * Use single image for origin-box * Add missing package locks * Update to always use --ci * Add --progress flag * Update lock files * Add root package lock * Add Dockerfile * Update lockfiles for hoist * Update packages * Update lock files * Hoisted package lock * Fixes * Ganache-core upgrade * Fixes * Remove debug console log * Put call back * Travis test * Test should be matrix * Unset CI for hoist * CI test * Test workaround * Test CI * Test --abort-on-container-exit flag * Add stderr redirect * Container fixes * Add tests package * Fix syntax * Fix Ganache version * Pin web3 to beta.34 everywhere * Add linting to tests * Sync deps * Update command to start integration tests * Fix paths in docker compose * Move tests to top level directory * Add compose test file * Add chai, mocha, eslint as top level dependencies * Fix script copy * Mount more directories inside containers for development * Fix env vars for origin container update * Update sequelize versions * Add first integration test for origin-box * Add Docker caching * Add missing docker file reference * Delay for event-listener to process blocks * Use assert.equal * Only cache origin container * Remove relative import for origin-js test * Add --cache-from argument * Remove debugging log * Try parallel tests * Add --quiet-pull flag * Fix --quiet flag * CI test * Linting fixes * Make linting work with dev only dependencies * Minor fixes * Improve efficiency of unit test install * Fix path * Fix filter * Separate out unit tests * Add mocha * Remove caching * TravisCI tweaks * Remove unused faucet * Test links * Convert to package again * Remove prepare step * Revert "Remove prepare step" This reverts commit 5088cf5. * Fix import * Make postinstall script work * Fix package locks * Rename test folder * Remove unncessary contract build * Fixes for volume paths * Lock file change * Rename files * Rename container * Revert "Remove unncessary contract build" This reverts commit 37b60e6. * Rename test * Fix import * Move integration tests to the top of TravisCI file so they run first * Documentation * Fixes for contracts * Add wait for event listener * Fix timing * Update docs * Increase time for event-listener * Updates to deployment containers * Remove unnecessary contract compile * Remove build step for contracts when NODE_ENV=production * Move lerna to production dependencies * Make ipfs-proxy handle ctrl+c * Update lockfile * Revert experimental package files * Sync packages * More package syncing * Package lock for discovery * Remove stray blank line * Update dockerignore * Remove unused import * Change license to MIT * Fix duplicate volume entry * Package upgrades * Add todo * Increase wait for event-listener
- Loading branch information
Tom Linton
committed
Dec 6, 2018
1 parent
6dc7bf4
commit d001796
Showing
81 changed files
with
7,114 additions
and
189,241 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
**/node_modules | ||
|
||
# build folders | ||
origin-dapp/build | ||
origin-js/dist | ||
origin-messaging/dist |
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,60 @@ | ||
module.exports = { | ||
'root': true, | ||
'parser': 'babel-eslint', | ||
'parserOptions': { | ||
'ecmaVersion': 6, | ||
'sourceType': 'module', | ||
'ecmaFeatures': { | ||
'jsx': true, | ||
'impliedStrict': true | ||
} | ||
}, | ||
'env': { | ||
'browser': true, | ||
'node': true, | ||
'es6': true, | ||
'mocha': true | ||
}, | ||
'extends': [ | ||
'eslint:recommended' | ||
], | ||
'rules': { | ||
'computed-property-spacing': [ | ||
'error' | ||
], | ||
'jsx-quotes': [ | ||
'error' | ||
], | ||
'key-spacing': [ | ||
'error' | ||
], | ||
'no-case-declarations': [ | ||
'off' | ||
], | ||
'no-console': [ | ||
'off' | ||
], | ||
'no-var': [ | ||
'error' | ||
], | ||
'object-curly-spacing': [ | ||
'error', | ||
'always' | ||
], | ||
'prefer-const': [ | ||
'error' | ||
], | ||
'quotes': [ | ||
'error', | ||
'single', | ||
{ | ||
'avoidEscape': true, | ||
'allowTemplateLiterals': true | ||
} | ||
], | ||
'semi': [ | ||
'error', | ||
'never' | ||
] | ||
} | ||
} |
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,42 @@ | ||
FROM node:10 | ||
|
||
WORKDIR /app | ||
|
||
# Copy utility scripts | ||
COPY ./development/scripts/* /usr/local/bin/ | ||
|
||
COPY ./scripts/ ./scripts/ | ||
|
||
# Copy all package files for dependency installs, this is done here to allow | ||
# Docker to cache the npm install steps if none of the dependencies have changed | ||
COPY ./lerna.json ./ | ||
COPY ./package*.json ./ | ||
COPY ./ipfs-proxy/package*.json ./ipfs-proxy/ | ||
COPY ./origin-dapp/package*.json ./origin-dapp/ | ||
COPY ./origin-discovery/package*.json ./origin-discovery/ | ||
COPY ./origin-js/package*.json ./origin-js/ | ||
COPY ./origin-messaging/package*.json ./origin-messaging/ | ||
COPY ./origin-notifications/package*.json ./origin-notifications/ | ||
COPY ./origin-tests/package*.json ./origin-tests/ | ||
|
||
# Complete contracts source needs to be available so that `truffle compile contracts` | ||
# which is calleed by the prepare script can succeed | ||
COPY ./origin-contracts ./origin-contracts | ||
|
||
# Running of postinstall script requires --unsafe-perm | ||
RUN npm install --unsafe-perm | ||
|
||
# Copy all the source files for the packages | ||
COPY ./ipfs-proxy ./ipfs-proxy | ||
COPY ./origin-dapp ./origin-dapp | ||
COPY ./origin-discovery ./origin-discovery | ||
COPY ./origin-js ./origin-js | ||
COPY ./origin-messaging ./origin-messaging | ||
COPY ./origin-notifications ./origin-notifications | ||
COPY ./origin-tests ./origin-tests | ||
|
||
RUN ln -s ../../node_modules/scrypt origin-js/node_modules/scrypt | ||
RUN ln -s ../../node_modules/got origin-js/node_modules/got | ||
|
||
# Build origin-js for event-listener | ||
RUN npm run build --prefix origin-js |
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,33 @@ | ||
![origin_github_banner](https://user-images.githubusercontent.com/673455/37314301-f8db9a90-2618-11e8-8fee-b44f38febf38.png) | ||
|
||
Head to https://www.originprotocol.com/developers to learn more about what we're building and how to get involved. | ||
|
||
# Testing | ||
|
||
This describes Origin's automated test setup. Linting, unit testing, and integration testing is run by TravisCI on each push or pull request. | ||
|
||
## Linting | ||
|
||
Linting is handled by `eslint`. The root of the repository contains a base eslint config in `.eslintrc.js` which can be imported and extended by the Origin packages. For an example of extending this base config to support React see `origin-dapp/.eslintrc.js`. | ||
|
||
## Unit Testing | ||
|
||
Each package implements its own unit tests that should be runnable by using `lerna run test --scope <package_name>` from root or `npm run test` from within the package directory. | ||
|
||
## Integration Testing | ||
|
||
Integration testing is provided by the `origin-tests` package. It uses the Docker Compose setup to run Origin components and then executes tests against those services. The available services and their addresses are: | ||
|
||
``` | ||
- ipfs-proxy on http://ipfs-proxy:9999 (also localhost) | ||
- origin-bridge on http://origin-bridge:5000 (also localhost) | ||
- origin-dapp on http://origin-dapp:3000 (also localhost) | ||
- origin-discovery (event-listener) | ||
- origin-discovery (apollo server on http://localhost:4000) | ||
- origin-messaging on http://origin-messaging:9012 (also localhost) | ||
- origin-notifications on http://origin-notifications:3456 (also localhost) | ||
- ipfs at http://origin:5002 (gateway) and http://origin:8080 (api) | ||
- ganache at http://origin:8545 (also localhost) | ||
- postgresql at postgres://origin:origin@postgres/origin | ||
- elasticsearch on http://elasticearch:9200 (also localhost) | ||
``` |
Oops, something went wrong.