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

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

                Author: ASF GitHub Bot
            Created on: 08/Jan/20 19:48
            Start Date: 08/Jan/20 19:48
    Worklog Time Spent: 10m 
      Work Description: chamikaramj commented on pull request #10051: 
[BEAM-7961] Add tests for all runner native transforms for XLang
URL: https://github.com/apache/beam/pull/10051#discussion_r364407654
 
 

 ##########
 File path: sdks/python/apache_beam/transforms/validate_runner_xlang_test.py
 ##########
 @@ -0,0 +1,195 @@
+#
+# 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 os
+import typing
+import unittest
+
+from nose.plugins.attrib import attr
+from past.builtins import unicode
+
+import apache_beam as beam
+from apache_beam.options.pipeline_options import DebugOptions
+from apache_beam.testing.test_pipeline import TestPipeline
+from apache_beam.testing.util import assert_that
+from apache_beam.testing.util import equal_to
+
+TEST_PREFIX_URN = "beam:transforms:xlang:test:prefix"
+TEST_MULTI_URN = "beam:transforms:xlang:test:multi"
+TEST_GBK_URN = "beam:transforms:xlang:test:gbk"
+TEST_CGBK_URN = "beam:transforms:xlang:test:cgbk"
+TEST_COMGL_URN = "beam:transforms:xlang:test:comgl"
+TEST_COMPK_URN = "beam:transforms:xlang:test:compk"
+TEST_FLATTEN_URN = "beam:transforms:xlang:test:flatten"
+TEST_PARTITION_URN = "beam:transforms:xlang:test:partition"
+
+
+@attr('UsesCrossLanguageTransforms')
[email protected](
+    os.environ.get('EXPANSION_JAR'),
+    "EXPANSION_JAR environment variable is not set.")
[email protected](
+    os.environ.get('EXPANSION_PORT'),
+    "EXPANSION_PORT environment var is not provided.")
+class ValidateRunnerXlangTest(unittest.TestCase):
+  expansion_service = 'localhost:%s' % os.environ.get('EXPANSION_PORT')
+  expansion_jar = os.environ.get('EXPANSION_JAR')
+
+  def test_simple(self):
+    test_pipeline = TestPipeline()
+    test_pipeline.get_pipeline_options().view_as(
+        DebugOptions).experiments.append(
+            'jar_packages='+ValidateRunnerXlangTest.expansion_jar)
+    test_pipeline.not_use_test_runner_api = True
+    with test_pipeline as p:
+      res = (
+          p
+          | beam.Create(['a', 'b']).with_output_types(unicode)
+          | beam.ExternalTransform(
+              TEST_PREFIX_URN,
+              b'0',
+              ValidateRunnerXlangTest.expansion_service))
+      assert_that(res, equal_to(['0a', '0b']))
+
+  def test_multi(self):
 
 Review comment:
   Please add comments describing tests that are not obvious by name.
 
----------------------------------------------------------------
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: 368375)
    Time Spent: 15h  (was: 14h 50m)

> Add tests for all runner native transforms and some widely used composite 
> transforms to cross-language validates runner test suite
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-7961
>                 URL: https://issues.apache.org/jira/browse/BEAM-7961
>             Project: Beam
>          Issue Type: Improvement
>          Components: testing
>            Reporter: Heejong Lee
>            Assignee: Heejong Lee
>            Priority: Major
>          Time Spent: 15h
>  Remaining Estimate: 0h
>
> Add tests for all runner native transforms and some widely used composite 
> transforms to cross-language validates runner test suite



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to