This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: allow tests to run in parallel
- Loading branch information
1 parent
f88e09d
commit 9785a6a
Showing
12 changed files
with
242 additions
and
76 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 |
---|---|---|
|
@@ -8,7 +8,8 @@ branches: | |
stages: | ||
- check | ||
- test | ||
- tag | ||
- release-rc | ||
- test-external | ||
|
||
node_js: | ||
- '10' | ||
|
@@ -35,6 +36,10 @@ addons: | |
- dpkg | ||
chrome: stable | ||
|
||
before_install: | ||
# prevents windows error: npm ERR! ... git-sh-setup: file not found | ||
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export PATH=/c/PROGRA~1/Git/usr/bin:/c/PROGRA~1/Git/mingw64/libexec/git-core:$PATH ; fi | ||
|
||
script: npx nyc -s npx aegir test -t node --timeout 10000 --bail | ||
after_success: | ||
- npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov | ||
|
@@ -118,46 +123,6 @@ jobs: | |
script: | ||
- npm run test:interop:electron-renderer -- --bail --timeout 10000 | ||
|
||
- stage: test | ||
name: external - ipfs-webui | ||
script: | ||
- E2E_IPFSD_TYPE=js npm run test:external -- https://github.com/ipfs-shipyard/ipfs-webui.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test | ||
name: external - ipfs-companion | ||
script: | ||
- npm run test:external -- https://github.com/ipfs-shipyard/ipfs-companion.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test | ||
name: external - npm-on-ipfs | ||
script: | ||
- npm run test:external -- https://github.com/ipfs-shipyard/npm-on-ipfs.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test | ||
name: external - peer-base | ||
script: | ||
- npm run test:external -- https://github.com/achingbrain/peer-base.git --branch upgrade-to-latest-ipfs-rc --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test | ||
name: external - service-worker-gateway | ||
script: | ||
- npm run test:external -- https://github.com/ipfs-shipyard/service-worker-gateway.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test | ||
name: external - orbit-db | ||
script: | ||
- npm run test:external -- https://github.com/orbitdb/orbit-db.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test | ||
name: external - ipfs-log | ||
script: | ||
- npm run test:external -- https://github.com/orbitdb/ipfs-log.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test | ||
name: external - sidetree | ||
script: | ||
- npm run test:external -- https://github.com/decentralized-identity/sidetree.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test | ||
name: example - browser-add-readable-stream | ||
script: | ||
|
@@ -302,15 +267,51 @@ jobs: | |
- npm install | ||
- npm run test -- traverse-ipld-graphs | ||
|
||
- stage: tag | ||
# only run on changes to master | ||
if: branch = master AND type = push AND fork = false | ||
name: update-last-successful-build | ||
- stage: release-rc | ||
name: release rc | ||
script: | ||
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc | ||
- npm run release:rc -- --yes | ||
|
||
- stage: test-external | ||
name: external - ipfs-webui | ||
script: | ||
- E2E_IPFSD_TYPE=js npm run test:external -- https://github.com/ipfs-shipyard/ipfs-webui.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test-external | ||
name: external - ipfs-companion | ||
script: | ||
- npm run test:external -- https://github.com/ipfs-shipyard/ipfs-companion.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test-external | ||
name: external - npm-on-ipfs | ||
script: | ||
- npm run test:external -- https://github.com/ipfs-shipyard/npm-on-ipfs.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test-external | ||
name: external - peer-base | ||
script: | ||
- npm run test:external -- https://github.com/achingbrain/peer-base.git --branch upgrade-to-latest-ipfs-rc --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test-external | ||
name: external - service-worker-gateway | ||
script: | ||
- npm run test:external -- https://github.com/ipfs-shipyard/service-worker-gateway.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test-external | ||
name: external - orbit-db | ||
script: | ||
- git config --global user.email "[email protected]" | ||
- git config --global user.name "Travis CI" | ||
- git remote set-url origin https://$TRAVIS_GITHUB_USER:[email protected]/ipfs/js-ipfs.git | ||
- npx aegir update-last-successful-build | ||
- npm run test:external -- https://github.com/orbitdb/orbit-db.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test-external | ||
name: external - ipfs-log | ||
script: | ||
- npm run test:external -- https://github.com/orbitdb/ipfs-log.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
- stage: test-external | ||
name: external - sidetree | ||
script: | ||
- npm run test:external -- https://github.com/decentralized-identity/sidetree.git --deps=ipfs@github:ipfs/js-ipfs#"${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" | ||
|
||
notifications: | ||
email: false |
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,3 @@ | ||
# Contributor Code of Conduct | ||
|
||
The `js-ipfs` project follows the [`IPFS Community Code of Conduct`](https://github.com/ipfs/community/blob/master/code-of-conduct.md) |
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,5 @@ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
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,19 @@ | ||
The MIT License (MIT) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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,130 @@ | ||
<p align="center"> | ||
<a href="https://js.ipfs.io" title="JS IPFS"> | ||
<img src="https://ipfs.io/ipfs/Qme6KJdKcp85TYbLxuLV7oQzMiLremD7HMoXLZEmgo6Rnh/js-ipfs-sticker.png" alt="IPFS in JavaScript logo" width="244" /> | ||
</a> | ||
</p> | ||
|
||
<h3 align="center">The JavaScript implementation of the IPFS protocol.</h3> | ||
|
||
<p align="center"> | ||
<a href="http://protocol.ai"><img src="https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat" /></a> | ||
<a href="http://ipfs.io/"><img src="https://img.shields.io/badge/project-IPFS-blue.svg?style=flat" /></a> | ||
</p> | ||
|
||
<p align="center"> | ||
<a href="https://riot.im/app/#/room/#ipfs-dev:matrix.org"><img src="https://img.shields.io/badge/matrix-%23ipfs%3Amatrix.org-blue.svg?style=flat" /> </a> | ||
<a href="http://webchat.freenode.net/?channels=%23ipfs"><img src="https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat" /></a> | ||
<a href="https://discord.gg/24fmuwR"><img src="https://img.shields.io/discord/475789330380488707?color=blueviolet&label=discord&style=flat" /></a> | ||
<a href="https://github.com/ipfs/team-mgmt/blob/master/MGMT_JS_CORE_DEV.md"><img src="https://img.shields.io/badge/team-mgmt-blue.svg?style=flat" /></a> | ||
</p> | ||
|
||
<p align="center"> | ||
<a href="https://github.com/ipfs/interface-ipfs-core"><img src="https://img.shields.io/badge/interface--ipfs--core-API%20Docs-blue.svg"></a> | ||
<a href="https://travis-ci.com/ipfs/js-ipfs?branch=master"><img src="https://badgen.net/travis/ipfs/js-ipfs?branch=master" /></a> | ||
<a href="https://codecov.io/gh/ipfs/js-ipfs"><img src="https://badgen.net/codecov/c/github/ipfs/js-ipfs" /></a> | ||
<br> | ||
</p> | ||
|
||
> **Upgrading from <=0.40 to 0.41?** See the [release notes](https://github.com/ipfs/js-ipfs/issues/2656) for the list of API changes and the [migration guide](https://gist.github.com/alanshaw/04b2ddc35a6fff25c040c011ac6acf26). | ||
### Project status - `Alpha` <!-- omit in toc --> | ||
|
||
We've come a long way, but this project is still in Alpha, lots of development is happening, API might change, beware of the Dragons 🐉. | ||
|
||
**Want to get started?** Check our [examples folder](/examples) to learn how to spawn an IPFS node in Node.js and in the Browser. | ||
|
||
**Please read this:** The [DHT](https://en.wikipedia.org/wiki/Distributed_hash_table), a fundamental piece for automatic content and peer discovery is not yet complete. There are multiple applications that can be built without this service but nevertheless it is fundamental to getting that magic IPFS experience. The current status is that implementation is done and merged and we're working on performance issues. Expect the DHT to be available in a release very soon. | ||
|
||
[**`Weekly Core Implementations Call`**](https://github.com/ipfs/team-mgmt/issues/992) | ||
|
||
## Tech Lead <!-- omit in toc --> | ||
|
||
[David Dias](https://github.com/daviddias) | ||
|
||
## Lead Maintainer <!-- omit in toc --> | ||
|
||
[Alan Shaw](https://github.com/alanshaw) | ||
|
||
## Table of Contents <!-- omit in toc --> | ||
|
||
- [Structure](#structure) | ||
- [Development](#development) | ||
- [Clone and install dependencies](#clone-and-install-dependencies) | ||
- [Run tests](#run-tests) | ||
- [Lint](#lint) | ||
- [Build a dist version](#build-a-dist-version) | ||
- [Contribute](#contribute) | ||
- [Want to hack on IPFS?](#want-to-hack-on-ipfs) | ||
- [License](#license) | ||
|
||
## Structure | ||
|
||
This project is broken into several modules, their purposes are: | ||
|
||
* [`/packages/ipfs`](./packages/ipfs) The core implementation | ||
* [`/packages/ipfs-http-client`](./packages/ipfs-http-client) A client for the RPC-over-HTTP API presented by both js-ipfs and go-ipfs | ||
* [`/packages/interface-ipfs-core`](./packages/interface-ipfs-core) Tests to ensure adherance of an implementation to the spec | ||
|
||
## Development | ||
|
||
### Clone and install dependencies | ||
|
||
```sh | ||
> git clone https://github.com/ipfs/js-ipfs.git | ||
> cd js-ipfs | ||
> npm install | ||
``` | ||
|
||
### Run tests | ||
|
||
```sh | ||
# run all the unit tests | ||
> npm test | ||
|
||
# run individual tests (findprovs) | ||
> npm run test -- --grep findprovs | ||
|
||
# run just IPFS tests in Node.js | ||
> npm run test:node | ||
|
||
# run just IPFS tests in a browser | ||
> npm run test:browser | ||
|
||
# run just IPFS tests in a webworker | ||
> npm run test:webworker | ||
``` | ||
|
||
More granular test suites can be run from each submodule. | ||
|
||
Please see the `package.json` in each submodule for available commands. | ||
|
||
### Lint | ||
|
||
**Conforming to linting rules is a prerequisite to commit to js-ipfs.** | ||
|
||
```sh | ||
> npm run lint | ||
``` | ||
|
||
### Build a dist version | ||
|
||
```sh | ||
> npm run build | ||
``` | ||
|
||
## Contribute | ||
|
||
IPFS implementation in JavaScript is a work in progress. As such, there's a few things you can do right now to help out: | ||
|
||
- Go through the modules below and **check out existing issues**. This would be especially useful for modules in active development. Some knowledge of IPFS may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically. | ||
- **Perform code reviews**. More eyes will help (a) speed the project along, (b) ensure quality, and (c) reduce possible future bugs. | ||
- Take a look at go-ipfs and some of the planning repositories or issues: for instance, the [libp2p spec](https://github.com/ipfs/specs/pull/19). Contributions here that would be most helpful are **top-level comments** about how it should look based on our understanding. Again, the more eyes the better. | ||
- **Add tests**. There can never be enough tests. | ||
|
||
### Want to hack on IPFS? | ||
|
||
[](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md) | ||
|
||
## License | ||
|
||
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fipfs%2Fjs-ipfs?ref=badge_large) |
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
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
Oops, something went wrong.