benWize commented on a change in pull request #16154:
URL: https://github.com/apache/beam/pull/16154#discussion_r794954239
##########
File path:
sdks/python/apache_beam/examples/complete/game/hourly_team_score_it_test.py
##########
@@ -90,6 +90,35 @@ def test_hourly_team_score_it(self):
self.test_pipeline.get_full_options_as_args(**extra_opts),
save_main_session=False)
+ @pytest.mark.examples_postcommit
+ def test_hourly_team_score_output_checksum_on_small_input(self):
+ # Small dataset to prevent OOM when running in local runners
Review comment:
Comment changed
##########
File path: sdks/python/apache_beam/examples/complete/estimate_pi_test.py
##########
@@ -51,6 +54,20 @@ def test_basics(self):
# trials.
assert_that(result, in_between(3.125, 3.155))
+ @pytest.mark.examples_postcommit
+ def test_estimate_pi_output_file(self):
+ temp_folder = tempfile.mkdtemp()
+ estimate_pi.run(
+ ['--output', os.path.join(temp_folder, 'result'), '--tries', '5000'],
+ save_main_session=False)
+ # Load result file and compare.
+ with open_shards(os.path.join(temp_folder, 'result-*-of-*')) as
result_file:
+ result = json.loads(result_file.read().strip())[2]
Review comment:
Changed it
##########
File path: sdks/python/apache_beam/examples/complete/estimate_pi.py
##########
@@ -101,21 +101,27 @@ def expand(self, pcoll):
| 'Sum' >> beam.CombineGlobally(combine_results).without_defaults())
-def run(argv=None):
+def run(argv=None, save_main_session=True):
parser = argparse.ArgumentParser()
parser.add_argument(
'--output', required=True, help='Output file to write results to.')
+ parser.add_argument(
Review comment:
Ok, changed it
##########
File path: sdks/python/apache_beam/examples/complete/autocomplete_test.py
##########
@@ -37,7 +41,11 @@ class AutocompleteTest(unittest.TestCase):
KINGLEAR_HASH_SUM = 268011785062540
KINGLEAR_INPUT = 'gs://dataflow-samples/shakespeare/kinglear.txt'
- @pytest.mark.examples_postcommit
+ def create_file(self, path, contents):
Review comment:
Done
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]