Merge pull request #18833 from calixteman/gulp_testfilter
Add an option to gulp makeref/browsertest to only run tests with specific ids
This commit is contained in:
commit
4a0c508689
36
gulpfile.mjs
36
gulpfile.mjs
@ -687,6 +687,13 @@ function runTests(testsName, { bot = false, xfaOnly = false } = {}) {
|
|||||||
args.push("--xfaOnly");
|
args.push("--xfaOnly");
|
||||||
}
|
}
|
||||||
args.push("--manifestFile=" + PDF_TEST);
|
args.push("--manifestFile=" + PDF_TEST);
|
||||||
|
collectArgs(
|
||||||
|
{
|
||||||
|
names: ["-t", "--testfilter"],
|
||||||
|
hasValue: true,
|
||||||
|
},
|
||||||
|
args
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case "unit":
|
case "unit":
|
||||||
args.push("--unitTest");
|
args.push("--unitTest");
|
||||||
@ -724,6 +731,28 @@ function runTests(testsName, { bot = false, xfaOnly = false } = {}) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function collectArgs(options, args) {
|
||||||
|
if (!Array.isArray(options)) {
|
||||||
|
options = [options];
|
||||||
|
}
|
||||||
|
for (let i = 0, ii = process.argv.length; i < ii; i++) {
|
||||||
|
const arg = process.argv[i];
|
||||||
|
const option = options.find(opt => opt.names.includes(arg));
|
||||||
|
if (!option) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!option.hasValue) {
|
||||||
|
args.push(arg);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const next = process.argv[i + 1];
|
||||||
|
if (next && !next.startsWith("-")) {
|
||||||
|
args.push(arg, next);
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function makeRef(done, bot) {
|
function makeRef(done, bot) {
|
||||||
console.log();
|
console.log();
|
||||||
console.log("### Creating reference images");
|
console.log("### Creating reference images");
|
||||||
@ -748,6 +777,13 @@ function makeRef(done, bot) {
|
|||||||
if (process.argv.includes("--headless")) {
|
if (process.argv.includes("--headless")) {
|
||||||
args.push("--headless");
|
args.push("--headless");
|
||||||
}
|
}
|
||||||
|
collectArgs(
|
||||||
|
{
|
||||||
|
names: ["-t", "--testfilter"],
|
||||||
|
hasValue: true,
|
||||||
|
},
|
||||||
|
args
|
||||||
|
);
|
||||||
|
|
||||||
const testProcess = startNode(args, { cwd: TEST_DIR, stdio: "inherit" });
|
const testProcess = startNode(args, { cwd: TEST_DIR, stdio: "inherit" });
|
||||||
testProcess.on("close", function (code) {
|
testProcess.on("close", function (code) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user