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

Open
wants to merge 8 commits into
base: alpha
Choose a base branch
from

Conversation

ddrechse
Copy link
Contributor

@ddrechse ddrechse commented Jan 10, 2024

Pull Request

Issue

Closes: #8788

Approach

Add support to dynamically import an external database adapter to run tests.

Tasks

n/a

Copy link

parse-github-assistant bot commented Jan 10, 2024

Thanks for opening this pull request!

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 93.80%. Comparing base (f1469c6) to head (0462693).
Report is 8 commits behind head on alpha.

Files Patch % Lines
src/cli/utils/runner.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #8883      +/-   ##
==========================================
- Coverage   94.13%   93.80%   -0.34%     
==========================================
  Files         186      186              
  Lines       14687    14724      +37     
==========================================
- Hits        13826    13812      -14     
- Misses        861      912      +51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mtrezza mtrezza changed the title Add databaseAdapter support for tests, REDACT databaseAdapter info wh… ci: Add test support for external database adapter Jan 14, 2024
spec/helper.js Outdated Show resolved Hide resolved
@mtrezza
Copy link
Member

mtrezza commented Jan 19, 2024

@ddrechse Since I guess we cannot easily add a test for this; do you have an example that shows that this works?

@ddrechse
Copy link
Contributor Author

I do
I have added the adapter support to the repo here
https://github.com/oracle-samples/oracleadapter-parse

This is an example config.json for the Oracle Storage Adapter running against Free23c locally

{
  "appId": "APPLICATION_ID",
  "masterKey": "MASTER_KEY",
  "port": 1338,
  "logLevel": "info",
  "verbose": false,
  "mountGraphQL": true,
  "mountPlayground": true,
  "graphQLPath": "/graphql",
  "filesAdapter": {
    "module": "@parse/fs-files-adapter"
  },
  "databaseAdapter": {
    "module": "../Adapters/Storage/Oracle/OracleStorageAdapter",
    "options": {
      "databaseURI": "oracledb://pdbadmin:Welcome12345@localhost:1521/freepdb1",
      "collectionPrefix": ""
    }
  }
}  

@mtrezza

@mtrezza
Copy link
Member

mtrezza commented Jan 19, 2024

Could you test this out by using the branch of this PR in parse-community/parse-server-database-adapter-template#4? Looking at the CI there, it's using a Parse Server version tag when installing Parse Server, so it doesn't have the feature of this PR yet and the CI there actually runs with the MongoDB storage adapter, right? If you could change it to use the branch of this PR, then passing the env vars in the CI should run the CI with Oracle DB adapter, and once we see that works, we can merge this PR, does that make sense?

@ddrechse
Copy link
Contributor Author

Yes it does

@dplewis
Copy link
Member

dplewis commented Apr 5, 2024

@mtrezza @ddrechse is this ready to merge? I have a MySQL adapter that can use this. MySQL and PostgreSQL are similar so moving PG to another repo would be easier

@mtrezza
Copy link
Member

mtrezza commented Apr 5, 2024

@dplewis this is still ongoing development, partly outside of this org. Once we know it all works, we will merge and publish a repo template that you can use for your SQL adapter.

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please check the coverage? Not sure if it's possible to write a simple test for this, otherwise we merge as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create dummy DB adapter repo that runs Parse Sever tests
3 participants