parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

ci: Add test support for external database adapter

Open ddrechse opened this issue 1 year ago • 6 comments

Pull Request

Issue

Closes: https://github.com/parse-community/parse-server/issues/8788

Approach

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

Tasks

n/a

ddrechse avatar Jan 10 '24 18:01 ddrechse

Thanks for opening this pull request!

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #8883      +/-   ##
==========================================
- Coverage   94.13%   93.79%   -0.35%     
==========================================
  Files         186      186              
  Lines       14687    14724      +37     
==========================================
- Hits        13826    13810      -16     
- Misses        861      914      +53     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 10 '24 18:01 codecov[bot]

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

mtrezza avatar Jan 19 '24 12:01 mtrezza

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

ddrechse avatar Jan 19 '24 14:01 ddrechse

Could you test this out by using the branch of this PR in https://github.com/parse-community/parse-server-database-adapter-template/pull/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?

mtrezza avatar Jan 19 '24 19:01 mtrezza

Yes it does

ddrechse avatar Jan 19 '24 20:01 ddrechse

@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

dplewis avatar Apr 05 '24 23:04 dplewis

@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.

mtrezza avatar Apr 05 '24 23:04 mtrezza

🎉 This change has been released in version 7.1.0-alpha.7

parseplatformorg avatar May 16 '24 11:05 parseplatformorg

🎉 This change has been released in version 7.1.0-beta.1

parseplatformorg avatar Jun 30 '24 02:06 parseplatformorg

🎉 This change has been released in version 7.1.0

parseplatformorg avatar Jun 30 '24 02:06 parseplatformorg