ci: Add ability to exclude tests via ID in testExclusionList.json (#8774)
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
"equal": true,
|
"equal": true,
|
||||||
"expectAsync": true,
|
"expectAsync": true,
|
||||||
"notEqual": true,
|
"notEqual": true,
|
||||||
|
"it_id": true,
|
||||||
"it_only_db": true,
|
"it_only_db": true,
|
||||||
"it_only_mongodb_version": true,
|
"it_only_mongodb_version": true,
|
||||||
"it_only_postgres_version": true,
|
"it_only_postgres_version": true,
|
||||||
|
|||||||
@@ -428,6 +428,29 @@ global.it_exclude_dbs = excluded => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let testExclusionList = [];
|
||||||
|
try {
|
||||||
|
// Fetch test exclusion list
|
||||||
|
testExclusionList = require('./testExclusionList.json');
|
||||||
|
console.log(`Using test exclusion list with ${testExclusionList.length} entries`);
|
||||||
|
} catch(error) {
|
||||||
|
if(error.code !== 'MODULE_NOT_FOUND') {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable test if its UUID is found in testExclusionList
|
||||||
|
global.it_id = (id, func) => {
|
||||||
|
if (testExclusionList.includes(id)) {
|
||||||
|
return xit;
|
||||||
|
} else {
|
||||||
|
if(func === undefined)
|
||||||
|
return it;
|
||||||
|
else
|
||||||
|
return func;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
global.it_only_db = db => {
|
global.it_only_db = db => {
|
||||||
if (
|
if (
|
||||||
process.env.PARSE_SERVER_TEST_DB === db ||
|
process.env.PARSE_SERVER_TEST_DB === db ||
|
||||||
|
|||||||
Reference in New Issue
Block a user