use custom docker image for circlci
Use the custom docker image defined in the Dockerfile for testing
There seems to be an error. If the tests are run on circleci, test.js can not connect to localhost.
test.js should also fail if an unhandled promise rejection occurs.
What I did (outside the docker) to run the tests on localhost was to run the microdraw server in background, give the server 5 seconds to start, and then launch the tests.
From the .circleci/congif.yml file:
- run:
name: Run server in background
command: 'npm start'
background: true
- run: sleep 5
- run:
name: Query host
command: 'node host.js'
- run:
name: Test server
command: 'npm test'
imagehash is used. The test calculates the average hash for every generated image and its reference image. It fails if the difference of the hashes is larger than 10.
The values for hash_size and the allowed difference have been arbitrarily selected and can be changed.
I believe the reason for the failed test is how the existing commit behave when github-keys.json is missing.
this PR merges #118 hence will also fix #99
this PR... we close it? keep it? merge it?
Oh wow, a blast from the past.
I think using image hash to compare the result is probably more scalable than asking contributors to run test on their machine and check the result manually.
I think we can close this for now, but perhaps we can leave an issue? I am hoping that I can get to adapting the code phillip pushed in the new repo.