Even faster tests (#4868)

* Various improvements in test name / de-duplications

* Reverts to class by class deletion, introduced fast mode that just delete data for mongo

- Speeds up are incredible Executed 1695 of 1713 specs INCOMPLETE (18 PENDING) in 4 mins 19 secs.

* Adds documentation about the deleteEverything
This commit is contained in:
Florent Vilmart
2018-07-03 11:13:08 -04:00
committed by GitHub
parent ae1a8226d5
commit 960431b92d
18 changed files with 648 additions and 651 deletions

View File

@@ -426,7 +426,7 @@ class DatabaseController {
throw new Parse.Error(Parse.Error.INVALID_KEY_NAME, `Invalid field name for update: ${fieldName}`);
}
});
for (const updateOperation: any in update) {
for (const updateOperation in update) {
if (Object.keys(updateOperation).some(innerKey => innerKey.includes('$') || innerKey.includes('.'))) {
throw new Parse.Error(Parse.Error.INVALID_NESTED_KEY, "Nested keys should not contain the '$' or '.' characters");
}
@@ -654,11 +654,16 @@ class DatabaseController {
}
// Won't delete collections in the system namespace
// Returns a promise.
deleteEverything() {
/**
* Delete all classes and clears the schema cache
*
* @param {boolean} fast set to true if it's ok to just delete rows and not indexes
* @returns {Promise<void>} when the deletions completes
*/
deleteEverything(fast: boolean = false): Promise<void> {
this.schemaPromise = null;
return Promise.all([
this.adapter.dropDatabase(),
this.adapter.deleteAllClasses(fast),
this.schemaCache.clear()
]);
}