[ 
https://issues.apache.org/jira/browse/BEAM-7586?focusedWorklogId=267297&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-267297
 ]

ASF GitHub Bot logged work on BEAM-7586:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Jun/19 06:37
            Start Date: 26/Jun/19 06:37
    Worklog Time Spent: 10m 
      Work Description: y1chi commented on pull request #8895: [BEAM-7586] Add 
Integration test for python mongodb io
URL: https://github.com/apache/beam/pull/8895#discussion_r297503770
 
 

 ##########
 File path: sdks/python/apache_beam/io/mongodbio_it_test.py
 ##########
 @@ -0,0 +1,54 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+from __future__ import absolute_import
+
+import logging
+import unittest
+
+from hamcrest import all_of
+from nose.plugins.attrib import attr
+from pymongo import MongoClient
+
+from apache_beam.io import mongodbio_pipeline
+from apache_beam.testing.pipeline_verifiers import PipelineStateMatcher
+from apache_beam.testing.test_pipeline import TestPipeline
+
+
+class MongoDBIOIntegrationTest(unittest.TestCase):
+  @attr('IT')
+  def test_mongodbio_read_write(self):
+    default_args = {
+        'mongo_uri': 'mongodb://localhost:27017',
+        'mongo_db': 'beam_mongodbio_it_test',
+    }
+    test_pipeline = TestPipeline(is_integration_test=True)
+    pipeline_verifiers = [
+        PipelineStateMatcher(),
+    ]
+    mongodbio_pipeline.run(
+        test_pipeline.get_full_options_as_args(
+            on_success_matcher=all_of(*pipeline_verifiers), **default_args))
+
+    # clean up
+    with MongoClient(default_args['mongo_db']) as client:
+      client.drop_database(default_args['mongo_db'])
 
 Review comment:
   I can see java sdk uses k8s to setup the mongodb and there's a separate 
jenkins job triggers it.
   python's integration tests seem to run all together? 
   
   Is there a recommended way to start a container for testing purpose?
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 267297)
    Time Spent: 2h 20m  (was: 2h 10m)

> Add Integration Test for MongoDbIO in python sdk 
> -------------------------------------------------
>
>                 Key: BEAM-7586
>                 URL: https://issues.apache.org/jira/browse/BEAM-7586
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Yichi Zhang
>            Assignee: Yichi Zhang
>            Priority: Major
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to