-
Notifications
You must be signed in to change notification settings - Fork 15
Interoperability testing for IPFS #2
Comments
What are we missing in terms of interop test? Let's make a list. |
Had a call with @dryajov and to make sure we're all on the same page First, what ipfs/interop is. Shortly, ipfs/interop tests that different Current issues with our ipfs/interop tests:
These problems are not only for ipfs/interop but in general with our tests. Accidental complexity refers to complexity that is not there because it has to First thing to have in mind when creating or modifying existing tests is that Reducing complexity in the test cases, reusing functionality when we can, I think we can solve this by placing focus on having a internal testing DSL, Let's make a example from a existing test case, a very simple one. It simply describe('ascii data', () => {
const data = Buffer.from('hello world')
it('publish from Go, subscribe on Go', (done) => {
const topic = 'pubsub-go-go'
let n = 0
function checkMessage (msg) {
++n
expect(msg.data.toString()).to.equal(data.toString())
expect(msg).to.have.property('seqno')
expect(Buffer.isBuffer(msg.seqno)).to.be.eql(true)
expect(msg).to.have.property('topicIDs').eql([topic])
expect(msg).to.have.property('from', goId)
}
series([
(cb) => goD.api.pubsub.subscribe(topic, checkMessage, cb),
(cb) => goD.api.pubsub.publish(topic, data, cb),
(cb) => waitFor(() => n === 1, cb)
], done)
})
}) A huge piece of code for something so simple. I want us to be able to do this describe('pubsub', () => {
it('can publish and subscribe from same node', () => {
const node = CreateNode()
SendMessage(node, 'hello world')
AssertReceivedMessages(1, 'hello world')
})
}) (since writing this comment, I've made a full example of how it could work [highlighted is the test case itself, the other things are just the testing setup]) Which language implementation we're using, should be hidden and automatically Test run would output something like:
Adding support for multiple nodes should be a
Point being, most code in Regarding isolation. Currently a lot of tests runs on the machines directly, The first and simple measure is to run tests in containers. Then we can run Second and what I'm looking into right now, is Software Defined Networks (SDN). Isolating the tests better will also help with timeouts that happens because Regarding random failures, we have to first figure out if it's because of the Lastly, tests testing more than they should. We're mixing types of tests all We need a clear separation between unit, functional, interop and protocol tests, I've began experimenting with a testing DSL with the purpose of making the tests My suggested action plan:
|
Massive +1 on test isolation! |
@victorbjelkholm this reads to me as a rehashing or continuation of the conversation we had in Lisbon early January. Just to make sure we are still in the same page, I'm all in for improved tests, fast CI and reduced complexity \o/ It is good to have these written down as notes, thank you. However, I believe the motivation behind this discussion with @dryajov was #12 and #11 which could benefit from having the tests structured in this new way, but it shouldn't be a blocker for circuit-testing.
Nothing is stopping you from doing this today, in the end it is up to the test writer. I wouldn't call that example a DSL for testing though, it is just putting a bunch of assertions behind a function call. I can find you tests that are written that way.
That's the job for InterPlanetary Test Lab
Not true anymore since we moved the interop tests to this repo.
Agreed, as discussed on ipfs-inactive/interface-js-ipfs-core#189 There are other things, for example a huge regression was introduced with the new version of ipfsd-ctl -- ipfs/js-ipfsd-ctl#176 -- which removed from every single test the ability to pick the keysize -- ipfs/js-ipfsd-ctl#188 (comment) --, making tests ridiculously slow. This needs to be fixed asap. |
I agree, this is not a blocker to the current circuit testing, but potential ways to improve them in the future. My intent with #12 was to document my general experience and gather ideas on how to improve them in the future - I'm glad that we have a conversation started around it now. 👍 |
…that verify that the go and js ipfs implementations behave the same when adding/removing pins to the datastore. I've found that they produce essentially the same pinsets with the exception of some ordering. There are a few tangential differences that I've noticed such as fresh go repos include the readme files as pinned while the js impl does not. Draft ipfs#2 coming up! Lots of code dedupe
…that verify that the go and js ipfs implementations behave the same when adding/removing pins to the datastore. I've found that they produce essentially the same pinsets with the exception of some ordering. There are a few tangential differences that I've noticed such as fresh go repos include the readme files as pinned while the js impl does not. Draft #2 coming up! Lots of code dedupe
This is a rough draft of a suite of tests to verify that the go and js ipfs implementations behave the same when adding/removing pins to the datastore. I've found that they produce essentially the same pinsets. There are a few secondary differences I've noticed such as: fresh go repos include the readme files as pinned while the js impl does not. Draft #2 coming up! Lots of code to dedupe
* feat: pin interop tests This is a rough draft of a suite of tests to verify that the go and js ipfs implementations behave the same when adding/removing pins to the datastore. I've found that they produce essentially the same pinsets. There are a few secondary differences I've noticed such as: fresh go repos include the readme files as pinned while the js impl does not. Draft #2 coming up! Lots of code to dedupe * docs: update instructions to test against local go-ipfs version * Update package.json * chore: update ipfs
# This is the 1st commit message: feat: add ipns over pubsub tests # This is the commit message #2: test: add ipns pubsub tests
Taking a page from libp2p/interop#1, let's start working on the interop tests for IPFS. Fortunately, in IPFS land we do have a concept of the daemon and we already have a batch of tests that we can import to this repo https://github.com/ipfs/js-ipfs/tree/master/test/interop making things so much simpler! 🎉
The text was updated successfully, but these errors were encountered: