Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
interoperability tests for IPFS
Browse files Browse the repository at this point in the history
* port tests

* remove non used files

* remove non used deps

* kick CI

* add badges

* new circle

* timeout

* no coverage please
  • Loading branch information
daviddias authored Dec 18, 2017
1 parent ebe0054 commit 2cd707c
Show file tree
Hide file tree
Showing 28 changed files with 1,787 additions and 8 deletions.
36 changes: 36 additions & 0 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
'use strict'

const parallel = require('async/parallel')
const ads = require('./test/utils/another-daemon-spawner')
const js = ads.spawnJsNode
const go = ads.spawnGoNode
const stop = ads.stopNodes

/*
* spawns a daemon with ports numbers starting in 10 and ending in `num`
*/
function start (done) {
const base = '/ip4/127.0.0.1/tcp'
parallel([
(cb) => go([`${base}/10027`, `${base}/20027/ws`], true, 33027, 44027, cb),
(cb) => go([`${base}/10028`, `${base}/20028/ws`], true, 33028, 44028, cb),
(cb) => go([`${base}/10031`, `${base}/20031/ws`], true, 33031, 44031, cb),
(cb) => go([`${base}/10032`, `${base}/20032/ws`], true, 33032, 44032, cb)
], done)
}

module.exports = {
karma: {
files: [{
pattern: 'node_modules/interface-ipfs-core/test/fixtures/**/*',
watched: false,
served: true,
included: false,
singleRun: false
}]
},
hooks: {
pre: start,
post: stop
}
}
23 changes: 16 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
**/node_modules/
**/*.log
test/repo-tests*
**/bundle.js
docs
# Logs
logs
*.log
npm-debug.log*

coverage

# Runtime data
pids
Expand All @@ -20,14 +26,17 @@ coverage
# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
build

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

# Optional npm cache directory
.npm
lib
dist
test/test-data/go-ipfs-repo/LOCK
test/test-data/go-ipfs-repo/LOG
test/test-data/go-ipfs-repo/LOG.old

# Optional REPL history
.node_repl_history
# while testing npm5
package-lock.json
34 changes: 34 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
**/node_modules/
**/*.log
test/repo-tests*

# Logs
logs
*.log

coverage

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

build

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

test
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
sudo: false
language: node_js

matrix:
include:
- node_js: 6
env: CXX=g++-4.8
- node_js: 8
env: CXX=g++-4.8

script:
- npm run lint
- npm run test
- make test

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

addons:
firefox: 'latest'
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,51 @@
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![circle](https://circleci.com/gh/ipfs/interop/tree/master.svg?style=svg)](https://circleci.com/gh/ipfs/interop/tree/master)
[![travis](https://travis-ci.org/ipfs/interop.svg?branch=port-tests)](https://travis-ci.org/ipfs/interop)
[![appveyor](https://ci.appveyor.com/api/projects/status/fvth3vq3h0rd9rf5/branch/master?svg=true)](https://ci.appveyor.com/project/wubalubadubdub/interop/branch/master)

> Interoperability tests for IPFS Implementations
This repository will be used for interop tests. Please jump into the issues if you'd like to help out setting this up!

## Usage

### Install

```
> git clone git@github.com:ipfs/interop.git
> cd interop
> npm install
```

### Run the tests

```
> npm test
```

### Test with a non yet released version of js-ipfs

```
# Do the steps in the install section, then
> cd ..
> git clone git@github.com:ipfs/js-ipfs.git
> cd js-ipfs
> npm install
> npm link
> cd ../interop
> npm link ipfs
> npm test
```

### Test with a non yet released version of go-ipfs

```
> Do the steps in the install section, then
> IPFS_EXEC=<path to the go-ipfs version you want to try> npm test
```

## Contribute

Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/ipfs-interop/issues)!
Expand All @@ -19,4 +59,4 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c

## License

MIT
[MIT](./LICENSE)
28 changes: 28 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "{build}"

environment:
matrix:
- nodejs_version: "6"
- nodejs_version: "8"

matrix:
fast_finish: true

install:
# Install Node.js
- ps: Install-Product node $env:nodejs_version

# Upgrade npm
- npm install -g npm

# Output our current versions for debugging
- node --version
- npm --version

# Install our package dependencies
- npm install

test_script:
- npm run test:node

build: off
14 changes: 14 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
machine:
node:
version: stable

dependencies:
pre:
- google-chrome --version
- curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i google-chrome.deb || true
- sudo apt-get update
- sudo apt-get install -f
- sudo apt-get install --only-upgrade lsb-base
- sudo dpkg -i google-chrome.deb
- google-chrome --version
71 changes: 71 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "interop-ipfs",
"version": "0.0.0",
"description": "Interoperability Tests for IPFS",
"main": "",
"browser": {
"./src/core/components/init-assets.js": false,
"./src/core/runtime/config-nodejs.json": "./src/core/runtime/config-browser.json",
"./src/core/runtime/libp2p-nodejs.js": "./src/core/runtime/libp2p-browser.js",
"./src/core/runtime/repo-nodejs.js": "./src/core/runtime/repo-browser.js",
"./test/utils/create-repo-nodejs.js": "./test/utils/create-repo-browser.js",
"stream": "readable-stream"
},
"engines": {
"node": ">=6.0.0",
"npm": ">=3.0.0"
},
"scripts": {
"lint": "aegir lint",
"test": "aegir test -t node",
"test:nodejs": "aegir test -t node -f test/node.js",
"test:browser": "aegir test -t browser -f test/browser.js"
},
"pre-commit": [
"lint"
],
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/interop.git"
},
"keywords": [
"IPFS"
],
"author": "David Dias <daviddias@ipfs.io>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ipfs/interop/issues"
},
"homepage": "https://github.com/ipfs/interop#readme",
"devDependencies": {
"aegir": "^12.2.0",
"async": "^2.6.0",
"bl": "^1.2.1",
"bs58": "^4.0.1",
"buffer-loader": "0.0.1",
"chai": "^4.1.2",
"cids": "^0.5.2",
"detect-node": "^2.0.3",
"dir-compare": "^1.4.0",
"dirty-chai": "^2.0.1",
"eslint-plugin-react": "^7.5.1",
"expose-loader": "^0.7.4",
"form-data": "^2.3.1",
"hat": "0.0.3",
"ipfs": "^0.27.5",
"ipfs-api": "^17.2.4",
"ipfsd-ctl": "~0.26.0",
"left-pad": "^1.2.0",
"lodash": "^4.17.4",
"mocha": "^4.0.1",
"ncp": "^2.0.0",
"pre-commit": "^1.2.2",
"pretty-bytes": "^4.0.2",
"random-fs": "^1.0.3",
"rimraf": "^2.6.2",
"stream-to-promise": "^2.2.0",
"transform-loader": "^0.2.4"
},
"dependencies": {},
"contributors": []
}
1 change: 1 addition & 0 deletions test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
10 changes: 10 additions & 0 deletions test/browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* eslint-env mocha */
'use strict'

describe('browser interop tests', () => {
it('need to get written', function (done) {
this.timeout(10 * 1000)
// for teardown time
setTimeout(done, 5 * 1000)
})
})
Loading

0 comments on commit 2cd707c

Please sign in to comment.