microdraw icon indicating copy to clipboard operation
microdraw copied to clipboard

use custom docker image for circlci

Open pglock opened this issue 8 years ago • 7 comments

Use the custom docker image defined in the Dockerfile for testing

pglock avatar Nov 10 '17 14:11 pglock

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.

pglock avatar Nov 10 '17 15:11 pglock

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'

r03ert0 avatar Nov 10 '17 16:11 r03ert0

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.

pglock avatar Dec 01 '17 14:12 pglock

I believe the reason for the failed test is how the existing commit behave when github-keys.json is missing.

xgui3783 avatar Dec 02 '17 20:12 xgui3783

this PR merges #118 hence will also fix #99

xgui3783 avatar Dec 18 '17 10:12 xgui3783

this PR... we close it? keep it? merge it?

r03ert0 avatar Jun 02 '20 15:06 r03ert0

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.

xgui3783 avatar Jun 02 '20 16:06 xgui3783