Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
We are planning to move Parse Server database adapters into their own repositories, out of the Parse Server repository. The goal is to reduce the weight of the repository and reducing vulnerabilities for developers who do not user certain adapters. It also allows to develop additional DB adapters without having to touch the Parse Server repository.
The CI of a separate DB adapter repository should run all Parse Server tests, using the specific DB adapter. Since not every DB adapter supports all DB related tests, we need to a mechanism to exclude specific tests. This is currently done on the server side with only_db
or exlude_db
. With external adapters, the adapter itself needs to define which tests to exclude. This also helps when developing new adapters.
Feature / Enhancement Description
Overload the jasmine it
test method to add an ID to the test, and skip the test if that ID is in an exclusion list. On Parse Server, this exclusion list will be empty, but in the external adapter repo this exclusion list can contain all the IDs of tests that the DB adapter does not support (yet).
As ID a UUIDv4 must be used to ensure uniqueness; no hand typed strings.
Example Use Case
Jasmine test method overload in helper.js
:
// Fetch test exclusion list
const testExclusionList = require('./testExclusionList.json');
// Overload test method
global.it_id = id => {
if (testExclusionList.includes(id)) {
return xit;
} else {
return it;
}
};
Test defintion:
it_id('bbd9e2f6-7f61-458f-98f2-4a563586cd8d')('example test', async () => {
});
Alternatives / Workarounds
- Exclude a test by it's jasmine path (
describe.describe.it
) or test name, so that an additional ID doesn't need to be introduced --> this is not a robust solution as tests may be restructured or renamed which would break all adapter tests.