beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Work logged] (BEAM-5365) Migrate integration tests for bigquery_tornadoes
Date Thu, 13 Sep 2018 23:46:00 GMT

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

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

                Author: ASF GitHub Bot
            Created on: 13/Sep/18 23:45
            Start Date: 13/Sep/18 23:45
    Worklog Time Spent: 10m 
      Work Description: yifanzou closed pull request #6380: Do Not Merge, [BEAM-5365] adding
more tests in bigquery_tornadoes_it
URL: https://github.com/apache/beam/pull/6380
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sdks/python/apache_beam/examples/cookbook/bigquery_tornadoes_it_test.py b/sdks/python/apache_beam/examples/cookbook/bigquery_tornadoes_it_test.py
index b7e90839ffa..428b2f2da33 100644
--- a/sdks/python/apache_beam/examples/cookbook/bigquery_tornadoes_it_test.py
+++ b/sdks/python/apache_beam/examples/cookbook/bigquery_tornadoes_it_test.py
@@ -72,6 +72,40 @@ def test_bigquery_tornadoes_it(self):
         test_pipeline.get_full_options_as_args(**extra_opts))
 
 
+  @attr('IT')
+  def test_bigquery_tornadoes_from_query_it(self):
+    test_pipeline = TestPipeline(is_integration_test=True)
+
+    # Set extra options to the pipeline for test purpose
+    project = test_pipeline.get_option('project')
+
+    INPUT_QUERY = ('SELECT month, COUNT(month) AS tornado_count FROM '
+                   '[clouddataflow-readonly:samples.weather_stations] '
+                   'WHERE tornado=true GROUP BY month')
+
+    dataset = 'BigQueryTornadoesIT'
+    table = 'monthly_tornadoes_from_query_%s' % int(round(time.time() * 1000))
+    output_table = '.'.join([dataset, table])
+    query = 'SELECT month, tornado_count FROM [%s]' % output_table
+
+    pipeline_verifiers = [PipelineStateMatcher(),
+                          BigqueryMatcher(
+                              project=project,
+                              query=query,
+                              checksum=self.DEFAULT_CHECKSUM)]
+    extra_opts = {'input': INPUT_QUERY,
+                  'output': output_table,
+                  'on_success_matcher': all_of(*pipeline_verifiers)}
+
+    # Register cleanup before pipeline execution.
+    self.addCleanup(utils.delete_bq_table, project, dataset, table)
+
+    # Get pipeline options from command argument: --test-pipeline-options,
+    # and start pipeline job by calling pipeline main function.
+    bigquery_tornadoes.run(
+        test_pipeline.get_full_options_as_args(**extra_opts))
+
+
 if __name__ == '__main__':
   logging.getLogger().setLevel(logging.INFO)
   unittest.main()


 

----------------------------------------------------------------
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:
users@infra.apache.org


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

    Worklog Id:     (was: 144138)
    Time Spent: 1h 20m  (was: 1h 10m)

> Migrate integration tests for bigquery_tornadoes
> ------------------------------------------------
>
>                 Key: BEAM-5365
>                 URL: https://issues.apache.org/jira/browse/BEAM-5365
>             Project: Beam
>          Issue Type: Bug
>          Components: testing
>            Reporter: yifan zou
>            Assignee: yifan zou
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>




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

Mime
View raw message