Live data from Hacker News

Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

victorbjelkholm.github.io

51–60 of 69 posts

Re: Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

#51

Have you thought of running this as a service? Would be nice to just through an NPM module at it and make sure it will run across multiple versions. Without having to install docker, etc. Not sure I'd pay for it, but maybe somebody would...

Other languages have this sort of test service available for open-source modules. One example is cpantesters.org, which is integrated into Perl's package repository. Not only is it easy to check what passes in your environment, it also makes it easy for module authors to fix bugs in environments that the author has no (other) access to.

Re: Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

#52

Earlier quoted context omitted.

yeah -- perhaps there's a lot of negative things to be said about node, but the fact that they've released multiple versions? really? https://clojure.org/community/downloads_older http://www.scala-lang.org/download/all.html https://www.python.org/downloads/ etc...

I don't think the issue is that they've released multiple versions, it's more that they've had so many backward-incompatible releases. Python and OCaml have had 3 each. Libc has had 6. 32 for something that's been around less than a decade is a bit excessive. Are all these 32 actually backwards-incompatible?

If you fix a bug that I'm relying on for the correct behavior of my code then it's not strictly backwards compatible.

These versions include a lot of minor and patch releases. Chances are most code will run just fine on most of these versions, but if you can automate testing them all then why not do it?

Re: Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

#53

Earlier quoted context omitted.

yeah -- perhaps there's a lot of negative things to be said about node, but the fact that they've released multiple versions? really? https://clojure.org/community/downloads_older http://www.scala-lang.org/download/all.html https://www.python.org/downloads/ etc...

I don't think the issue is that they've released multiple versions, it's more that they've had so many backward-incompatible releases. Python and OCaml have had 3 each. Libc has had 6. 32 for something that's been around less than a decade is a bit excessive. Are all these 32 actually backwards-incompatible?

There have only been 3 major releases with known backwards-incompatible changes. The reason you would want to test your code in so many versions of Node would be to check that you aren't depending on newer features that aren't in older versions that you want to still support.

Testing across 32 versions is probably very overkill for most people though.

Re: Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

#54
post #3

This is a utility I build to be able to make sure my JS CLI's actually work across the version I want to support. Right now, the tool also works across any language where there is docker images with versions, not just for JavaScript/NodeJS. It's enough with having a Dockerfile with $VERSION (that will be replaced by the tool) and changing the test command. I will make this easier in the future. Thanks for taking a lo…

Just out of curiosity, can't this be implemented with `nvm` and some sand boxing? Why did you choose to use docker?

Re: Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

#55
post #20
post #19

Very nice project. I built something similar for PHP: https://github.com/vectorface/dunit

Oh, that's very nice. Thanks for sharing this here, always nice to see how different people implement the same thing basically :)

I've implemented something similar to be able to run tests with different MongoDB versions: https://github.com/variety/variety/blob/master/test.sh

Re: Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

#56

This is why I hate ES6. JavaScript used to be a write once, run anywhere language. We sacrificed that for syntactic sugar.

JavaScript was never 'write once, run anywhere'. There were quite a few differences between the Netscape and MSIE implementations during the first few years of its existence and things didn't stabilise until the IE5 era.

Yeah this comment literally made me LOL; life was hard in the late 90s

Re: Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

#57

Earlier quoted context omitted.

I don't think the issue is that they've released multiple versions, it's more that they've had so many backward-incompatible releases. Python and OCaml have had 3 each. Libc has had 6. 32 for something that's been around less than a decade is a bit excessive. Are all these 32 actually backwards-incompatible?

They're not strictly backward incompatible: one should ideally only have to test across the major versions (nodejs is currently on major version 5, though that's not strictly reflective given the fork to iojs, and the change in versioning system on merge back) Testing across all 32 (or 303) versions is still going to be useful for catching bugs and quirks between minor versions (as opposed to deliberate, documented b…

actually for the sake of correctness, you should also test version 4 which is lts (if you are a library author) (https://github.com/nodejs/LTS) I mean v0.10 and v0.12 are also LTS but I doubt that if you have a bigger library that its nearly impossible to support all four

Re: Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

#58
post #3

This is a utility I build to be able to make sure my JS CLI's actually work across the version I want to support. Right now, the tool also works across any language where there is docker images with versions, not just for JavaScript/NodeJS. It's enough with having a Dockerfile with $VERSION (that will be replaced by the tool) and changing the test command. I will make this easier in the future. Thanks for taking a lo…

Just out of curiosity, can't this be implemented with `nvm` and some sand boxing? Why did you choose to use docker?

Yes, it can indeed. I have three reasons for not doing it though.

The first is that nvm is nodejs specific and since I knew I wanted it to eventually work with multiple languages, nvm is out.

Second is that docker has a API I can work with (via Dockerode in this case), makes it easier to use/debug and such.

Third is the easy of isolation. It's basically what docker is about while nvm is more for just managing versions.

I still use nvm locally, when developing. But when I want to rapidly test in multiple versions, I use docker with autochecker.

Re: Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

#59

Have you thought of running this as a service? Would be nice to just through an NPM module at it and make sure it will run across multiple versions. Without having to install docker, etc. Not sure I'd pay for it, but maybe somebody would...

Other languages have this sort of test service available for open-source modules. One example is cpantesters.org, which is integrated into Perl's package repository. Not only is it easy to check what passes in your environment, it also makes it easy for module authors to fix bugs in environments that the author has no (other) access to.

Funny you should say so, the origin of the idea behind autochecker, is actually CPAN's and CRAN's way of automatically test packages.

Re: Show HN: Test your JavaScript modules simultaneously in 32 different versions of Node.js

#60

Have you thought of running this as a service? Would be nice to just through an NPM module at it and make sure it will run across multiple versions. Without having to install docker, etc. Not sure I'd pay for it, but maybe somebody would...

If I could do it open-source and still earn money on it to cover cost of hosting, I'll try. Still haven't figured out a way though.

Someone else is working on something like that: https://twitter.com/bahmutov/status/720316267173810176

Post reply on HN