derrickaw commented on code in PR #38376:
URL: https://github.com/apache/beam/pull/38376#discussion_r3288664475


##########
sdks/python/apache_beam/yaml/integration_tests.py:
##########
@@ -200,6 +201,53 @@ def temp_bigtable_table(project, prefix='yaml_bt_it_'):
     _LOGGER.warning("Failed to clean up instance")
 
 
[email protected]
+def temp_mongodb_table():
+  """
+  provides a temporary MongoDB instance.
+
+  starts a MongoDB container, creates a unique database
+  and collection name for test isolation, and yields them as a dictionary.
+
+  This allows YAML test files to get connection details without hardcoding 
them.
+  Example usage in a YAML test file's fixture section:
+
+  fixtures:
+    - name: mongo_vars
+      type: path.to.this.file.mongodb_fixture
+
+  Then, in the pipeline definition, you can use placeholders like:
+  - uri: ${mongo_vars.URI}
+  - database: ${mongo_vars.DATABASE}
+  - collection: ${mongo_vars.COLLECTION}
+  """
+  _LOGGER.info("Setting up MongoDB fixture...")
+  mongo_container = MongoDbContainer("mongo:7.0.7")

Review Comment:
   Done, thanks



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to