JamieMason / shrinkpack

Fast, resilient, reproducible builds with npm install.
https://www.npmjs.com/package/shrinkpack
MIT License
793 stars 38 forks source link

chore(tests): drop docker, and use travis/ava to test in multiple versions of node and npm #63

Closed DrewML closed 8 years ago

DrewML commented 8 years ago

It works! Currently have it testing against npm versions 3.8.7 and 3.10.5 in node 5 and 6, but we can easily update .travis.yml to add more at any time.

Work done:

  1. Converted test cases in runtests.sh to test cases in test.js
  2. Setup ava for testing
  3. Removed docker-related config
  4. Enabled testing in TravisCI, with multiple versions of node and npm

Opinionated Changes (might be worth discussing):

  1. I wrote some code for the sinopia setup, but I ended up stopping because I'm questioning how much value it provides. Based on this PR, it seems like this was added to reduce the dependency on npm. But, unless I'm mistaken, sinopia is still going to be proxying out to npm for dependencies, unless they're stored in the repo and linked to sinopia's storage. (If we do decide to drop sinopia, I have some commented out code I'll need to remove).
  2. I renamed the test folder to testing. This was purely to get around some conflicts with ava's automatic discovery of test files that match a certain pattern. Renaming the directory seemed like the path of least resistance, but we can also override the pattern ava uses to discover test files, if you prefer.
  3. I added the execa package to make life a bit easier when working with child_process and promises.
  4. Some of the utilities in testutil.js could also be shell scripts, but my thought process was, if done this way (cross-platform utils), we might be able to get testing setup on Windows using Appveyor at some point if it was desired.

I'm open to any feedback you have to offer :). If you do decide to accept the PR, I'll need to update CONTRIBUTING.md with updated instructions for testing locally.

JamieMason commented 8 years ago

Thanks so much @DrewML, running this now.

JamieMason commented 8 years ago

Great work @DrewML, being able to run all kinds of node/npm combinations on Travis will be a huge help.

I've gone through and made a TODO list, but they're basically either just things I agree about or minor points about the coding style I like to keep in this project;

I'm free at the moment so am happy to pick this up. Thanks a lot,

Jamie

DrewML commented 8 years ago

I'm free at the moment so am happy to pick this up. Thanks a lot,

Totally up to you. If not, I can clean all these up tonight.

JamieMason commented 8 years ago

I just pushed up your work with the above changes applied to it, to https://github.com/JamieMason/shrinkpack/commits/DrewML-travis-tests. Please let me know of anything you'd like to add or change, and thanks again for this big improvement to the project.

DrewML commented 8 years ago

@JamieMason Nice! Changes look good to me

JamieMason commented 8 years ago

Released in 0.16.1 🎆