TobKed commented on a change in pull request #8550:
URL: https://github.com/apache/airflow/pull/8550#discussion_r496723475



##########
File path: tests/providers/google/cloud/operators/test_dataflow_system.py
##########
@@ -26,4 +37,191 @@
 class CloudDataflowExampleDagsSystemTest(GoogleSystemTest):
     @provide_gcp_context(GCP_DATAFLOW_KEY)
     def test_run_example_dag_function(self):
-        self.run_dag('example_gcp_dataflow', CLOUD_DAG_FOLDER)
+        self.run_dag("example_gcp_dataflow", CLOUD_DAG_FOLDER)
+
+
+GCP_PROJECT_ID = os.environ.get("GCP_PROJECT_ID", "example-project")
+GCR_FLEX_TEMPLATE_IMAGE = 
f"gcr.io/{GCP_PROJECT_ID}/samples-dataflow-streaming-beam-sql:latest"
+
+# 
https://github.com/GoogleCloudPlatform/java-docs-samples/tree/954553c/dataflow/flex-templates/streaming_beam_sql
+GCS_TEMPLATE_PARTS = urlparse(GCS_FLEX_TEMPLATE_TEMPLATE_PATH)
+GCS_FLEX_TEMPLATE_BUCKET_NAME = GCS_TEMPLATE_PARTS.netloc
+
+
+EXAMPLE_FLEX_TEMPLATE_REPO = "GoogleCloudPlatform/java-docs-samples"
+EXAMPLE_FLEX_TEMPLATE_COMMIT = "deb0745be1d1ac1d133e1f0a7faa9413dbfbe5fe"
+EXAMPLE_FLEX_TEMPLATE_SUBDIR = "dataflow/flex-templates/streaming_beam_sql"
+
+
[email protected]("mysql", "postgres")
[email protected]_file(GCP_GCS_TRANSFER_KEY)
+class CloudDataflowExampleDagFlexTemplateJavagSystemTest(GoogleSystemTest):
+    @provide_gcp_context(GCP_GCS_TRANSFER_KEY, 
project_id=GoogleSystemTest._project_id())
+    def setUp(self) -> None:
+        # Create a Cloud Storage bucket
+        self.execute_cmd(["gsutil", "mb", 
f"gs://{GCS_FLEX_TEMPLATE_BUCKET_NAME}"])
+
+        # Build image with pipeline
+        with NamedTemporaryFile() as f:
+            f.write(
+                textwrap.dedent(
+                    """\
+                    steps:

Review comment:
       I think it was used for sake of simplicity. It is easier to take a look 
on the multiline string which represents quite simple YAML. Am I right @mik-laj 
?




----------------------------------------------------------------
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]


Reply via email to