Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add test support for external database adapter #8883

Merged
merged 11 commits into from
May 14, 2024
6 changes: 5 additions & 1 deletion spec/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ process.noDeprecation = true;
const cache = require('../lib/cache').default;
const defaults = require('../lib/defaults').default;
const ParseServer = require('../lib/index').ParseServer;
const loadAdapter = require('../lib/Adapters/AdapterLoader').loadAdapter;
const path = require('path');
const TestUtils = require('../lib/TestUtils');
const GridFSBucketAdapter = require('../lib/Adapters/Files/GridFSBucketAdapter')
Expand All @@ -53,7 +54,10 @@ let databaseAdapter;
let databaseURI;
// need to bind for mocking mocha

if (process.env.PARSE_SERVER_TEST_DB === 'postgres') {
if (process.env.PARSE_SERVER_DATABASE_ADAPTER) {
databaseAdapter = JSON.parse(process.env.PARSE_SERVER_DATABASE_ADAPTER);
databaseAdapter = loadAdapter(databaseAdapter);
} else if (process.env.PARSE_SERVER_TEST_DB === 'postgres') {
databaseURI = process.env.PARSE_SERVER_TEST_DATABASE_URI || postgresURI;
databaseAdapter = new PostgresStorageAdapter({
uri: databaseURI,
Expand Down
7 changes: 1 addition & 6 deletions src/cli/utils/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
return;
}
// Keys that may include sensitive information that will be redacted in logs
const keysToRedact = [
'databaseURI',
'masterKey',
'maintenanceKey',
'push',
];
const keysToRedact = ['databaseAdapter', 'databaseURI', 'masterKey', 'maintenanceKey', 'push'];

Check warning on line 8 in src/cli/utils/runner.js

View check run for this annotation

Codecov / codecov/patch

src/cli/utils/runner.js#L8

Added line #L8 was not covered by tests
mtrezza marked this conversation as resolved.
Show resolved Hide resolved
for (const key in options) {
let value = options[key];
if (keysToRedact.includes(key)) {
Expand Down