Skip to content

Commit

Permalink
ci: Add ability to exclude tests via ID in testExclusionList.json (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ddrechse authored Oct 18, 2023
1 parent 5462834 commit 93af48a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"equal": true,
"expectAsync": true,
"notEqual": true,
"it_id": true,
"it_only_db": true,
"it_only_mongodb_version": true,
"it_only_postgres_version": true,
Expand Down
23 changes: 23 additions & 0 deletions spec/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
if (
process.env.PARSE_SERVER_TEST_DB === db ||
Expand Down

0 comments on commit 93af48a

Please sign in to comment.