mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-24 01:00:12 +01:00
try moving to Github Actions from Travis for CI (#1783)
* try moving to Github Actions from Travis for CI * npm install * add apt-get prereqs * Update continuous-integration.yml * Update .github/workflows/continuous-integration.yml Co-authored-by: Barun Acharya <47106543+daemon1024@users.noreply.github.com> * use resemblejs in gif-tests * trying `npm run setup` * fix: use ubuntu latest for github actions Co-authored-by: Barun Acharya <47106543+daemon1024@users.noreply.github.com> * Update .github/workflows/continuous-integration.yml * fix: try more changes - fix: install `libcairo2-dev` explicitly with apt. - fix: use Ubuntu 18.04 * fix<actions>: merge dependency installs in one command * fix<actions>: include more dependencies * GitHub actions running parallel (#1787) * try running tests parallely * setup composite actions * Update continuous-integration.yml * setup all jobs * just install instead of setup * trying ci without ubuntu package deps * cache node modules in ci * remove action.yml * name change for brevity * add recommended deps for tape-run * xvfb-run --auto-servernum npm run core-tests Co-authored-by: Barun Acharya <47106543+daemon1024@users.noreply.github.com> Co-authored-by: daemon1024 <barun1024@gmail.com> Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
const test = require('tape'),
|
||||
base64Img = require('base64-img');
|
||||
|
||||
const compare = require('resemblejs').compare;
|
||||
|
||||
const ImageSequencer = require('../../../src/ImageSequencer');
|
||||
|
||||
const test_gif = require('../images/test.gif.js');
|
||||
@@ -15,19 +17,37 @@ target = 'test_outputs';
|
||||
* @param {String} [input="test_gif"] optional input image. Default is a test gif.
|
||||
*/
|
||||
module.exports = (moduleName, options, benchmark, input) => {
|
||||
let sequencer = ImageSequencer({ui: false});
|
||||
let sequencer = ImageSequencer({ ui: false });
|
||||
sequencer.loadImages(input || test_gif);
|
||||
sequencer.addSteps(moduleName, options);
|
||||
test(`${moduleName} module works correctly`, t => {
|
||||
sequencer.run({mode: 'test'}, () => {
|
||||
test(`${moduleName} module works correctly`, (t) => {
|
||||
sequencer.run({ mode: 'test' }, () => {
|
||||
let result = sequencer.steps[1].output.src;
|
||||
|
||||
base64Img.imgSync(result, target, `${moduleName}-result`);
|
||||
base64Img.imgSync(benchmark, target, `${moduleName}-benchmark`);
|
||||
|
||||
t.equal(result === benchmark, true, `${moduleName} module works correctly with Gif`);
|
||||
let mismatch = 100;
|
||||
compare(
|
||||
result,
|
||||
benchmark,
|
||||
{ returnEarlyThreshold: 5 },
|
||||
(err, { rawMisMatchPercentage }) => {
|
||||
if (err) {
|
||||
console.log('An error while comparing!');
|
||||
} else {
|
||||
mismatch = rawMisMatchPercentage;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
t.equal(
|
||||
mismatch < 5,
|
||||
true,
|
||||
`${moduleName} module works correctly with Gif`
|
||||
);
|
||||
sequencer = null;
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user