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

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

                Author: ASF GitHub Bot
            Created on: 11/Oct/18 22:49
            Start Date: 11/Oct/18 22:49
    Worklog Time Spent: 10m 
      Work Description: jasonkuster commented on a change in pull request 
#6642: [BEAM-5701] port datastore_write Python integration tests to Beam
URL: https://github.com/apache/beam/pull/6642#discussion_r224627668
 
 

 ##########
 File path: sdks/python/apache_beam/io/gcp/datastore_write_it_test.py
 ##########
 @@ -0,0 +1,70 @@
+#
+# 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.
+#
+
+"""An integration test for datastore_write
+
+This test creates entities and writes them to Cloud Datastore. Subsequently,
+these entities are read from Cloud Datastore, compared to the expected value
+for the entity, and deleted.
+
+There is no output; instead, we use `assert_that` transform to verify the
+results in the pipeline.
+"""
+
+from __future__ import absolute_import
+
+import logging
+import random
+import unittest
+from datetime import datetime
+
+from hamcrest.core.core.allof import all_of
+from nose.plugins.attrib import attr
+
+from apache_beam.io.gcp import datastore_write
+from apache_beam.testing.pipeline_verifiers import PipelineStateMatcher
+from apache_beam.testing.test_pipeline import TestPipeline
+
+
+class DatastoreWriteIT(unittest.TestCase):
+
+  NUM_ENTITIES = 1001
+  LIMIT = 500
+
+  def run_datastore_write(self, limit=None):
+    test_pipeline = TestPipeline(is_integration_test=True)
+    current_time = datetime.now().strftime("%m%d%H%M%S")
+    seed = random.randint(0, 100000)
+    kind = 'testkind%s%d' % (current_time, seed)
+    pipeline_verifiers = [PipelineStateMatcher()]
+    extra_opts = {'kind': kind,
+                  'num_entities': self.NUM_ENTITIES,
+                  'on_success_matcher': all_of(*pipeline_verifiers)}
+    if limit is not None:
+      extra_opts['limit'] = limit
+
+    datastore_write.run(test_pipeline.get_full_options_as_args(
+        **extra_opts))
+
+  @attr('IT')
+  def test_datastore_write_limit(self):
 
 Review comment:
   Nevermind.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 153725)
    Time Spent: 3h 20m  (was: 3h 10m)

> Port Python IT test to Github: datastore_write
> ----------------------------------------------
>
>                 Key: BEAM-5701
>                 URL: https://issues.apache.org/jira/browse/BEAM-5701
>             Project: Beam
>          Issue Type: Bug
>          Components: testing
>            Reporter: yifan zou
>            Assignee: yifan zou
>            Priority: Major
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>




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

Reply via email to