Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: swarm.peers latency value when unknown (#2336)
Browse files Browse the repository at this point in the history
go-ipfs returns "n/a" when latency is unknown. This change restores compatibility.

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
Alan Shaw authored Aug 6, 2019
1 parent 128efec commit 6248ec1
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"execa": "^2.0.3",
"form-data": "^2.5.0",
"hat": "0.0.3",
"interface-ipfs-core": "~0.107.3",
"interface-ipfs-core": "^0.109.1",
"ipfsd-ctl": "^0.43.0",
"libp2p-websocket-star": "~0.10.2",
"ncp": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/core/components/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = function swarm (self) {
peer: peer.id
}
if (verbose) {
tupple.latency = 'unknown'
tupple.latency = 'n/a'
}

peers.push(tupple)
Expand Down
27 changes: 22 additions & 5 deletions test/core/interface.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@ describe('interface-ipfs-core tests', function () {
tests.bootstrap(defaultCommonFactory)

tests.config(defaultCommonFactory, {
skip: [{
name: 'should set a number',
reason: 'Failing - needs to be fixed'
}]
skip: [
{
name: 'should set a number',
reason: 'Failing - needs to be fixed'
},
{
name: 'should output changes but not save them for dry run',
reason: 'TODO unskip when https://github.com/ipfs/js-ipfs/pull/2165 is merged'
},
{
name: 'should set a config profile',
reason: 'TODO unskip when https://github.com/ipfs/js-ipfs/pull/2165 is merged'
}
]
})

tests.dag(defaultCommonFactory)
Expand Down Expand Up @@ -119,7 +129,14 @@ describe('interface-ipfs-core tests', function () {
}
}))

tests.object(defaultCommonFactory)
tests.object(defaultCommonFactory, {
skip: [
{
name: 'should respect timeout option',
reason: 'js-ipfs doesn\'t support timeout yet'
}
]
})

tests.pin(defaultCommonFactory)

Expand Down
27 changes: 22 additions & 5 deletions test/http-api/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@ describe('interface-ipfs-core over ipfs-http-client tests', () => {
tests.bootstrap(defaultCommonFactory)

tests.config(defaultCommonFactory, {
skip: [{
name: 'should set a number',
reason: 'Failing - needs to be fixed'
}]
skip: [
{
name: 'should set a number',
reason: 'Failing - needs to be fixed'
},
{
name: 'should output changes but not save them for dry run',
reason: 'TODO unskip when https://github.com/ipfs/js-ipfs/pull/2165 is merged'
},
{
name: 'should set a config profile',
reason: 'TODO unskip when https://github.com/ipfs/js-ipfs/pull/2165 is merged'
}
]
})

tests.dag(defaultCommonFactory, {
Expand Down Expand Up @@ -122,7 +132,14 @@ describe('interface-ipfs-core over ipfs-http-client tests', () => {
}
}))

tests.object(defaultCommonFactory)
tests.object(defaultCommonFactory, {
skip: [
{
name: 'should respect timeout option',
reason: 'js-ipfs doesn\'t support timeout yet'
}
]
})

tests.pin(defaultCommonFactory)

Expand Down

0 comments on commit 6248ec1

Please sign in to comment.