File tree Expand file tree Collapse file tree 3 files changed +7
-25
lines changed
tests/accuracy/sdk/accuracy-snapshot-storage Expand file tree Collapse file tree 3 files changed +7
-25
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,10 @@ jobs:
1717 (github.event_name == 'pull_request' && github.event.label.name == 'accuracy-tests')
1818 env :
1919 MDB_OPEN_AI_API_KEY : ${{ secrets.ACCURACY_OPEN_AI_API_KEY }}
20- MDB_GEMINI_API_KEY : ${{ secrets.MDB_GEMINI_API_KEY }}
21- MDB_AZURE_OPEN_AI_API_KEY : ${{ secrets.MDB_AZURE_OPEN_AI_API_KEY }}
22- MDB_AZURE_OPEN_AI_API_URL : ${{ secrets.MDB_AZURE_OPEN_AI_API_URL }}
20+ MDB_GEMINI_API_KEY : ${{ secrets.ACCURACY_GEMINI_API_KEY }}
21+ MDB_AZURE_OPEN_AI_API_KEY : ${{ secrets.ACCURACY_AZURE_OPEN_AI_API_KEY }}
22+ MDB_AZURE_OPEN_AI_API_URL : ${{ secrets.ACCURACY_AZURE_OPEN_AI_API_URL }}
2323 MDB_ACCURACY_MDB_URL : ${{ secrets.ACCURACY_MDB_CONNECTION_STRING }}
24- MDB_ACCURACY_MDB_DB : ${{ vars.ACCURACY_MDB_DB }}
25- MDB_ACCURACY_MDB_COLLECTION : ${{ vars.ACCURACY_MDB_COLLECTION }}
2624 MDB_ACCURACY_BASELINE_COMMIT : ${{ github.event.pull_request.base.sha || '' }}
2725 steps :
2826 - uses : GitHubSecurityLab/actions-permissions/monitor@v1
Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ export MDB_ACCURACY_RUN_ID=$(npx uuid v4)
1010
1111# For providing a mongodb based storage to store accuracy snapshots
1212# export MDB_ACCURACY_MDB_URL=""
13- # export MDB_ACCURACY_MDB_DB=""
14- # export MDB_ACCURACY_MDB_COLLECTION=""
1513
1614# By default we run all the tests under tests/accuracy folder unless a path is
1715# specified in the command line. Such as:
Original file line number Diff line number Diff line change @@ -10,17 +10,9 @@ import {
1010export class MongoDBSnapshotStorage implements AccuracySnapshotStorage {
1111 private readonly client : MongoClient ;
1212 private readonly snapshotCollection : Collection ;
13- private constructor ( {
14- mongodbUrl,
15- database,
16- collection,
17- } : {
18- mongodbUrl : string ;
19- database : string ;
20- collection : string ;
21- } ) {
13+ private constructor ( mongodbUrl : string ) {
2214 this . client = new MongoClient ( mongodbUrl ) ;
23- this . snapshotCollection = this . client . db ( database ) . collection ( collection ) ;
15+ this . snapshotCollection = this . client . db ( "mongodb-mcp-server" ) . collection ( "accuracy-tests" ) ;
2416 }
2517
2618 async createSnapshotEntry (
@@ -81,16 +73,10 @@ export class MongoDBSnapshotStorage implements AccuracySnapshotStorage {
8173
8274 static getStorage ( ) : MongoDBSnapshotStorage | null {
8375 const mongodbUrl = process . env . MDB_ACCURACY_MDB_URL ;
84- const database = process . env . MDB_ACCURACY_MDB_DB ;
85- const collection = process . env . MDB_ACCURACY_MDB_COLLECTION ;
86- if ( ! mongodbUrl || ! database || ! collection ) {
76+ if ( ! mongodbUrl ) {
8777 return null ;
8878 }
8979
90- return new MongoDBSnapshotStorage ( {
91- mongodbUrl,
92- database,
93- collection,
94- } ) ;
80+ return new MongoDBSnapshotStorage ( mongodbUrl ) ;
9581 }
9682}
You can’t perform that action at this time.
0 commit comments