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

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

                Author: ASF GitHub Bot
            Created on: 05/Aug/19 22:35
            Start Date: 05/Aug/19 22:35
    Worklog Time Spent: 10m 
      Work Description: ihji commented on pull request #8174: [BEAM-6683] add 
createCrossLanguageValidatesRunner task
URL: https://github.com/apache/beam/pull/8174#discussion_r310818656
 
 

 ##########
 File path: sdks/python/apache_beam/io/external/generate_sequence_test.py
 ##########
 @@ -0,0 +1,64 @@
+#
+# 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.
+#
+
+"""Unit tests for cross-language generate sequence."""
+
+from __future__ import absolute_import
+from __future__ import print_function
+
+import logging
+import os
+import re
+import unittest
+
+from nose.plugins.attrib import attr
+
+from apache_beam.io.external.generate_sequence import GenerateSequence
+from apache_beam.testing.test_pipeline import TestPipeline
+from apache_beam.testing.util import assert_that
+from apache_beam.testing.util import equal_to
+
+
+@attr('UsesCrossLanguageTransforms')
+@unittest.skipUnless(
+    os.environ.get('EXPANSION_PORT'),
+    "EXPANSION_PORT environment var is not provided.")
+class XlangGenerateSequenceTest(unittest.TestCase):
+  def test_generate_sequence(self):
+    test_pipeline = TestPipeline()
+    port = os.environ.get('EXPANSION_PORT')
+    address = 'localhost:%s' % port
+
+    try:
+      with test_pipeline as p:
+        res = (
+            p
+            | GenerateSequence(start=1, stop=10,
+                               expansion_service=address)
+        )
+
+        assert_that(res, equal_to([i for i in range(1, 10)]))
+    except RuntimeError as e:
+      if re.search(GenerateSequence.URN, str(e)):
+        print("looks like URN not implemented in expansion service, skipping.")
 
 Review comment:
   `generate_sequence_test` is not only used with Java cross-language 
transforms but also with Python (and possibly Go) cross-language transforms. If 
we don't handle those errors, the test will fail in Python-using-Python, 
Python-using-Go test combinations.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 289237)
    Time Spent: 21h 20m  (was: 21h 10m)

> Add an integration test suite for cross-language transforms for Flink runner
> ----------------------------------------------------------------------------
>
>                 Key: BEAM-6683
>                 URL: https://issues.apache.org/jira/browse/BEAM-6683
>             Project: Beam
>          Issue Type: Test
>          Components: testing
>            Reporter: Chamikara Jayalath
>            Assignee: Heejong Lee
>            Priority: Major
>          Time Spent: 21h 20m
>  Remaining Estimate: 0h
>
> We should add an integration test suite that covers following.
> (1) Currently available Java IO connectors that do not use UDFs work for 
> Python SDK on Flink runner.
> (2) Currently available Python IO connectors that do not use UDFs work for 
> Java SDK on Flink runner.
> (3) Currently available Java/Python pipelines work in a scalable manner for 
> cross-language pipelines (for example, try 10GB, 100GB input for 
> textio/avroio for Java and Python). 
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to