-
Notifications
You must be signed in to change notification settings - Fork 109
Testing in the JS IPFS Project #406
Comments
Thanks for writing this analysis, @travisperson! I'm really excited to have some help on enhancing our testing game to boost dev productivity! (Please save my days from release dances!)
The original goal was to extract the sharness tests on go-ipfs and create it as a separate package so that those tests become part of the "compliance and hardness tests" of an IPFS implementation, testing it from the CLI API. @chriscool started that work and @victorbjelkholm had a OKR last quarter with some developments (0.4). @victorbjelkholm mind sharing what was achieved so that no duplicated work is done?
It depends on "what gets done first". Let me explain: Context:
What I mean by "what gets done first":
What I see happening in the future:
However, here is a simple goal that can give us a lot bang for a few buck, parallelize test runs. Right now, CI tests in CLI+HTTP+Core+Browser all in one worker for the different runtimes. This Matrix should be expanded because the CLI/HTTP/Core/Browser tests don't depend on each other, they can all be parallelized, reducing test time to the test suite that takes more time. Also, as you point out, the tests that take 180s are just tests to check daemon kill, these should even run in a separate container, so that users don't have to wait for those to get feedback from all the other tests.
Not really, what I want is the sharness tests to be shared among implementations. |
Yeah the sharness tests have been extracted from go-ipfs and put in this repo: https://github.com/chriscool/ipfs-sharness-tests The goal is to run those tests in this repo each time a commit is made in either the go-ipfs or the js-ipfs repo. |
Few WIP branches for making tests in js-ipfs faster:
|
What's the state of:
|
Per @chriscool, there is a repo on his account for the extracted sharness tests. We will need to move / fork the project into the IPFS organization though. I started to work pretty extensively on the sharness tests and got everything working last week, but it looks like @chriscool also did quite a bit of work towards that at the same time. @chriscool it would probably be good for us to sync up sometime this week if you have time. |
Re parallel tests, being worked on here: ipfs-inactive/jenkins#93 (comment) |
This issue is quite stale, our testing regime has altered significantly since it was opened. Please open an issue on ipfs/js-ipfs if further exploration is needed. |
I want to start a discussion around testing, particularly around some of the JavaScript projects (
js-ipfs
interface-ipfs-core
js-ipfs-api
), really anything that requires the use of an IPFS daemon running (consumesjs-ipfsd-ctl
).I'm curious if there are any particular testing strategies someone is trying to drive in the
js-ipfs
project at the moment, or if it's more adhoc and we can start to discuss the way we want to approach testing here in this issue.In the
js-ipfs
project there are four main testing suites that cover the four main interfaces of the project.core
http
gateway
cli
I want to ultimately help contributors know when they should write tests in each suite, and provide documentation and tools to help everyone write great tests that provide value to the community and project.
All of the tests suites currently require running a full node by either instantiating the core module, or starting a daemon and talking to it through
js-ipfs-api
.A great depiction of this can be found in the
js-ipfs
readme.I took some time and benchmarked the
node:*
test commands for thejs-ipfs
project.From the table above we can see that the
cli
tests take the large majority of the time (though about 180s of this time is consumed by three tests, more info @ ipfs/jenkins#93).The high test time makes sense given some details about what the cli tests are doing.
Some questions
The
js-ipfs
project has some sharness tests, though they haven't really been touched for years. It would appear that running cli test through node is the standard for the project. Should we remove the sharness tests?Both the http-api and core are primarily tested through the
interface-ipfs-core
project. There are also some independent tests written out in thecore
andhttp-api
folders. Should we strive to migrate these tests to theinterface-ipfs-core
project over time as features settle?Do we see value in the
cli
tests as they are written at the moment, and do we believe we want to keep moving forward with the general approach currently loosely laid out in the tests?/cc @diasdavid @victorbjelkholm
I will be responding shortly to this issue with some of my own thoughts.
The text was updated successfully, but these errors were encountered: