ci: enable more tests on Postgres adapter (#7641)

This commit is contained in:
Corey
2021-10-18 10:51:56 -04:00
committed by GitHub
parent 80bf578cbd
commit b5fc0d59db
6 changed files with 113 additions and 111 deletions

View File

@@ -1,7 +1,6 @@
const TestObject = Parse.Object.extend('TestObject');
const MongoStorageAdapter = require('../lib/Adapters/Storage/Mongo/MongoStorageAdapter').default;
const mongoURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDatabase';
const request = require('../lib/request');
const TestUtils = require('../lib/TestUtils');
const defaultHeaders = {
'X-Parse-Application-Id': 'test',
'X-Parse-Rest-API-Key': 'rest',
@@ -210,7 +209,7 @@ describe('Parse.Polygon testing', () => {
describe('with location', () => {
if (process.env.PARSE_SERVER_TEST_DB !== 'postgres') {
beforeEach(() => require('../lib/TestUtils').destroyAllDataPermanently());
beforeEach(async () => await TestUtils.destroyAllDataPermanently());
}
it('polygonContain query', done => {
@@ -425,7 +424,15 @@ describe('Parse.Polygon testing', () => {
});
describe_only_db('mongo')('Parse.Polygon testing', () => {
beforeEach(() => require('../lib/TestUtils').destroyAllDataPermanently());
const Config = require('../lib/Config');
let config;
beforeEach(async () => {
if (process.env.PARSE_SERVER_TEST_DB !== 'postgres') {
await TestUtils.destroyAllDataPermanently();
}
config = Config.get('test');
config.schemaCache.clear();
});
it('support 2d and 2dsphere', done => {
const coords = [
[0, 0],
@@ -437,7 +444,7 @@ describe_only_db('mongo')('Parse.Polygon testing', () => {
// testings against REST API, use raw formats
const polygon = { __type: 'Polygon', coordinates: coords };
const location = { __type: 'GeoPoint', latitude: 10, longitude: 10 };
const databaseAdapter = new MongoStorageAdapter({ uri: mongoURI });
const databaseAdapter = config.database.adapter;
return reconfigureServer({
appId: 'test',
restAPIKey: 'rest',