Skip to content

Commit 93af48a

Browse files
authored
ci: Add ability to exclude tests via ID in testExclusionList.json (#8774)
1 parent 5462834 commit 93af48a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

spec/.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"equal": true,
1616
"expectAsync": true,
1717
"notEqual": true,
18+
"it_id": true,
1819
"it_only_db": true,
1920
"it_only_mongodb_version": true,
2021
"it_only_postgres_version": true,

spec/helper.js

+23
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,29 @@ global.it_exclude_dbs = excluded => {
428428
}
429429
};
430430

431+
let testExclusionList = [];
432+
try {
433+
// Fetch test exclusion list
434+
testExclusionList = require('./testExclusionList.json');
435+
console.log(`Using test exclusion list with ${testExclusionList.length} entries`);
436+
} catch(error) {
437+
if(error.code !== 'MODULE_NOT_FOUND') {
438+
throw error;
439+
}
440+
}
441+
442+
// Disable test if its UUID is found in testExclusionList
443+
global.it_id = (id, func) => {
444+
if (testExclusionList.includes(id)) {
445+
return xit;
446+
} else {
447+
if(func === undefined)
448+
return it;
449+
else
450+
return func;
451+
}
452+
};
453+
431454
global.it_only_db = db => {
432455
if (
433456
process.env.PARSE_SERVER_TEST_DB === db ||

0 commit comments

Comments
 (0)