[
https://issues.apache.org/jira/browse/BEAM-5303?focusedWorklogId=195900&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-195900
]
ASF GitHub Bot logged work on BEAM-5303:
----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Feb/19 19:37
Start Date: 07/Feb/19 19:37
Worklog Time Spent: 10m
Work Description: youngoli commented on pull request #7768: [BEAM-5303]
Adding Python VR tests for Java Reference Runner.
URL: https://github.com/apache/beam/pull/7768#discussion_r254838112
##########
File path:
sdks/python/apache_beam/runners/portability/java_reference_runner_test.py
##########
@@ -0,0 +1,163 @@
+#
+# 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.
+#
+
+# This file is an entry point for running validatesRunner tests with the Python
+# SDK and the Java Reference Runner. Executing this file starts up an instance
+# of the Java Reference Runner's job server before executing tests and teardown
+# the job server afterwards.
+from __future__ import absolute_import
+
+import argparse
+import logging
+import sys
+import unittest
+
+import apache_beam as beam
+from apache_beam.options.pipeline_options import DebugOptions
+from apache_beam.options.pipeline_options import PortableOptions
+from apache_beam.runners.portability import portable_runner
+from apache_beam.runners.portability import portable_runner_test
+from apache_beam.testing.util import assert_that
+from apache_beam.testing.util import equal_to
+
+if __name__ == '__main__':
+ # Run as
+ #
+ # python -m apache_beam.runners.portability.java_reference_runner_test \
+ # --job_server_jar=/path/to/job_server.jar \
+ # --environment_type=docker \
+ # [Test.test_method, ...]
+
+ parser = argparse.ArgumentParser(add_help=True)
+ parser.add_argument('--job_server_jar',
+ help='Job server jar to submit jobs.')
+ parser.add_argument('--environment_type', default='docker',
+ help='Environment type. docker or process')
+ parser.add_argument('--environment_config', help='Environment config.')
+
+ known_args, args = parser.parse_known_args(sys.argv)
+ sys.argv = args
+
+ job_server_jar = known_args.job_server_jar
+ environment_type = known_args.environment_type.lower()
+ environment_config = (
+ known_args.environment_config if known_args.environment_config else None)
+
+ # This is defined here to only be run when we invoke this file explicitly.
+ class JavaReferenceRunnerTest(portable_runner_test.PortableRunnerTest):
+ _use_grpc = True
+ _use_subprocesses = True
+
+ @classmethod
+ def _subprocess_command(cls, port):
+ return [
+ 'java',
+ #'-Dorg.slf4j.simpleLogger.defaultLogLevel=info'
+ '-jar', job_server_jar,
+ '--port', str(port),
+ ]
+
+ @classmethod
+ def get_runner(cls):
+ return portable_runner.PortableRunner()
+
+ def create_options(self):
+ options = super(JavaReferenceRunnerTest, self).create_options()
+ options.view_as(DebugOptions).experiments = ['beam_fn_api']
+ options._all_options['parallelism'] = 1
Review comment:
Leaving this off seems to cause a test_sdf to fail. I haven't looked into
the specifics of why yet (I'll do that when I get to implementing SDF), but the
option seems necessary for now.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 195900)
Time Spent: 1h 10m (was: 1h)
> Get ULR ValidatesRunner tests passing
> -------------------------------------
>
> Key: BEAM-5303
> URL: https://issues.apache.org/jira/browse/BEAM-5303
> Project: Beam
> Issue Type: Sub-task
> Components: runner-direct
> Reporter: Daniel Oliveira
> Assignee: Daniel Oliveira
> Priority: Major
> Labels: triaged
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> The ULR validatesRunner tests currently fail for the vast majority of tests.
> This bug is for tracking progress on getting all the tests to pass.
> Gradle command to run the tests:
> ./gradlew -p runners/direct-java validatesPortableRunner
> If you get any errors related to docker, make sure you have a docker
> container built:
> ./gradlew -p sdks/java/container docker
> Bugs encountered while working on this should be tracked either as new
> sub-tasks to the parent issue or as seperate bugs that are marked as blocking
> this.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)