Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail when MD5 of test files fails on bots. #9960

Merged
merged 1 commit into from
Aug 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ function getTempFile(prefix, suffix) {
return path;
}

function createTestSource(testsName) {
function createTestSource(testsName, bot) {
var source = stream.Readable({ objectMode: true, });
source._read = function () {
console.log();
Expand Down Expand Up @@ -394,6 +394,9 @@ function createTestSource(testsName) {
return null;
}
args.push('--browserManifestFile=' + PDF_BROWSERS);
if (bot) {
args.push('--strictVerify');
}

var testProcess = spawn('node', args, { cwd: TEST_DIR, stdio: 'inherit', });
testProcess.on('close', function (code) {
Expand All @@ -403,7 +406,7 @@ function createTestSource(testsName) {
return source;
}

function makeRef(done, noPrompts) {
function makeRef(done, bot) {
console.log();
console.log('### Creating reference images');

Expand All @@ -420,8 +423,8 @@ function makeRef(done, noPrompts) {
}

var args = ['test.js', '--masterMode'];
if (noPrompts) {
args.push('--noPrompts');
if (bot) {
args.push('--noPrompts', '--strictVerify');
}
args.push('--browserManifestFile=' + PDF_BROWSERS);
var testProcess = spawn('node', args, { cwd: TEST_DIR, stdio: 'inherit', });
Expand Down Expand Up @@ -980,8 +983,8 @@ gulp.task('test', ['testing-pre', 'generic', 'components'], function() {

gulp.task('bottest', ['testing-pre', 'generic', 'components'], function() {
return streamqueue({ objectMode: true, },
createTestSource('unit'), createTestSource('font'),
createTestSource('browser (no reftest)'));
createTestSource('unit', true), createTestSource('font', true),
createTestSource('browser (no reftest)', true));
});

gulp.task('browsertest', ['testing-pre', 'generic', 'components'], function() {
Expand Down
6 changes: 5 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function parseOptions() {
var yargs = require('yargs')
.usage('Usage: $0')
.boolean(['help', 'masterMode', 'reftest', 'unitTest', 'fontTest',
'noPrompts', 'noDownload', 'downloadOnly'])
'noPrompts', 'noDownload', 'downloadOnly', 'strictVerify'])
.string(['manifestFile', 'browser', 'browserManifestFile',
'port', 'statsFile', 'statsDelay', 'testfilter'])
.alias('browser', 'b').alias('help', 'h').alias('masterMode', 'm')
Expand All @@ -63,6 +63,7 @@ function parseOptions() {
.describe('fontTest', 'Run the font tests.')
.describe('noDownload', 'Skips test PDFs downloading.')
.describe('downloadOnly', 'Download test PDFs without running the tests.')
.describe('strictVerify', 'Error if verifying the manifest files fails.')
.describe('statsFile', 'The file where to store stats.')
.describe('statsDelay', 'The amount of time in milliseconds the browser ' +
'should wait before starting stats.')
Expand Down Expand Up @@ -716,6 +717,9 @@ function ensurePDFsDownloaded(callback) {
'used for testing.');
console.log('Please re-download the files, or adjust the MD5 ' +
'checksum in the manifest for the files listed above.\n');
if (options.strictVerify) {
process.exit(1);
}
}
callback();
});
Expand Down