File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
libs/mongodb/tests/integration_tests Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 5151 MONGODB_URI : ${{ secrets.MONGODB_ATLAS_URI }}
5252 OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
5353 run : |
54- [[ "${{ github.repository_owner }}" == "langchain-ai" ]] && make integration_tests || true
54+ if [[ "${{ github.event_name }}" == "push" ]]; then
55+ make integration_tests
56+ fi
5557 working-directory : ${{ inputs.working-directory }}
5658
5759 - name : Ensure the tests did not create any additional files
Original file line number Diff line number Diff line change @@ -22,10 +22,14 @@ def collection() -> Generator:
2222 """Depending on uri, this could point to any type of cluster."""
2323 uri = os .environ .get ("MONGODB_URI" )
2424 client : MongoClient = MongoClient (uri )
25- client [DB_NAME ].create_collection (COLLECTION_NAME )
25+ if COLLECTION_NAME not in client [DB_NAME ].list_collection_names ():
26+ clxn = client [DB_NAME ].create_collection (COLLECTION_NAME )
27+ else :
28+ clxn = client [DB_NAME ][COLLECTION_NAME ]
2629 clxn = client [DB_NAME ][COLLECTION_NAME ]
30+ clxn .delete_many ({})
2731 yield clxn
28- clxn .drop ( )
32+ clxn .delete_many ({} )
2933
3034
3135def test_search_index_drop_add_delete_commands (collection : Collection ) -> None :
You can’t perform that action at this time.
0 commit comments