Make verifyManifestFiles
fail for non-linked test-cases with a "link": true
-entry
Currently it's possible to accidentally, e.g. by simply copy-and-pasting from an existing test-case, add an unnecessary `"link": true`-entry for locally available PDF files. This leads to inconsistencies in the manifest file, and doesn't feel like a great developer experience. However we can easily fix it by having `verifyManifestFiles` fail in this situation, and doing so actually turned up a couple of existing cases.
This commit is contained in:
parent
d4caa87560
commit
d60cc7200b
@ -142,6 +142,15 @@ function verifyManifestFiles(manifest, callback) {
|
|||||||
verifyNext();
|
verifyNext();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (item.link && !fs.existsSync(item.file + ".link")) {
|
||||||
|
console.error(
|
||||||
|
`WARNING: Unneeded \`"link": true\`-entry for the "${item.id}" test.`
|
||||||
|
);
|
||||||
|
error = true;
|
||||||
|
i++;
|
||||||
|
verifyNext();
|
||||||
|
return;
|
||||||
|
}
|
||||||
calculateMD5(item.file, function (err, md5) {
|
calculateMD5(item.file, function (err, md5) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('WARNING: Unable to open file for reading "' + err + '".');
|
console.log('WARNING: Unable to open file for reading "' + err + '".');
|
||||||
|
@ -3481,7 +3481,6 @@
|
|||||||
"md5": "8039aba56790d3597d2bc8c794a51301",
|
"md5": "8039aba56790d3597d2bc8c794a51301",
|
||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"lastPage": 5,
|
"lastPage": 5,
|
||||||
"link": true,
|
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
{ "id": "text_clip_cff_cid",
|
{ "id": "text_clip_cff_cid",
|
||||||
@ -3555,7 +3554,6 @@
|
|||||||
"file": "pdfs/issue925.pdf",
|
"file": "pdfs/issue925.pdf",
|
||||||
"md5": "f58fe943090aff89dcc8e771bc0db4c2",
|
"md5": "f58fe943090aff89dcc8e771bc0db4c2",
|
||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"link": true,
|
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
{ "id": "issue9291",
|
{ "id": "issue9291",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user