Closed EranSch closed 6 years ago
Hi @Swingline0, I was always thinking to improve this but never had a chance to do it. Thanks for putting this together
You bet, @NimaSoroush! I suppose with the new NPM script, the contribution guidelines could also be updated. All that said, I would love if you could give this command a test on your end just to make sure it all works as expected.
I just tried that script locally. I think we still need another script to trigger the integration test only
...
"jest:integration": "jest --testPathPattern integration.test",
"test:integration": "docker build -t differencify . && docker run --volume \"$(pwd)/src/integration.tests\":/differencify/src/integration.tests -t differencify npm run jest:integration"
...
Long term plan would be great to have everything as docker-compose
Funny, I actually started by creating a docker-compose file because I didn't want to deal with copying files out of the container. I found that I preferred running the container directly because between Jest's console colors being lost and compose's service name eating up horizontal space in the terminal, the test output became difficult to read.
Additionally, I've updated the package.json
script to include the jest:integration
alias via 1e04926.
Ok, I see what you mean by that. Let's stick with docker for now then.
Thanks for updating. All LGTM, will merge
Ahh, We need to update circleCi to not run test:integration and instead run jest:integration
Otherwise CI failing https://circleci.com/gh/NimaSoroush/differencify/179
Updated circleCI script, and bumped the version 😀
Uggghhhh... the paths are different in the detailed output!
So I assume a new PR will all fixes, right?
All good now via bee9df5a86884872712bdd1d2d3eb4b0a5039dba
Yeah. All good now. Thanks a lot @Swingline0
I will just publish the latest changes to npm
Thanks!
During work on #83, I made a few changes that I wanted to share in case they would be useful. Namely:
721ca21 adds a
.dockerignore
file to increase image build efficiency. The biggest impact this has is that it prevents copying the host system's bulkynode_modules
into the Docker context, drastically reducing the time required to build the image.b3928fd adds an NPM script which builds the docker image and runs the integration test command with the snapshots directory mounted into the container. The goal of this change was to shorten the steps required for running and updating tests. I'm not sure the NPM script name,
test:integration-in-docker
, is ideal but happy to update it if you'd like.Thanks!