You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/10 08:35:08 UTC

[GitHub] [airflow] turbaszek commented on a diff in pull request #24830: Migrate Google firestore example to new design AIP-47

turbaszek commented on code in PR #24830:
URL: https://github.com/apache/airflow/pull/24830#discussion_r917360889


##########
tests/system/providers/google/cloud/gcs/example_firestore.py:
##########
@@ -132,12 +132,39 @@
         },
     )
 
-    chain(
-        # Firestore
-        export_database_to_gcs,
-        # BigQuery
-        create_dataset,
-        create_external_table_multiple_types,
-        read_data_from_gcs_multiple_types,
-        delete_dataset,
+    delete_dataset = BigQueryDeleteDatasetOperator(
+        task_id="delete_dataset",
+        dataset_id=DATASET_NAME,
+        project_id=GCP_PROJECT_ID,
+        delete_contents=True,
+        trigger_rule=TriggerRule.ALL_DONE,
     )
+
+    delete_bucket = GCSDeleteBucketOperator(
+        task_id="delete_bucket", bucket_name=BUCKET_NAME, trigger_rule=TriggerRule.ALL_DONE
+    )
+
+    (
+        # TEST SETUP
+        create_bucket
+        >> create_dataset
+        # TEST BODY
+        >> export_database_to_gcs
+        >> create_external_table_multiple_types
+        >> read_data_from_gcs_multiple_types
+        # TEST TEARDOWN
+        >> delete_dataset
+        >> delete_bucket
+    )
+
+    from tests.system.utils.watcher import watcher
+
+    # This test needs watcher in order to properly mark success/failure
+    # when "tearDown" task with trigger rule is part of the DAG
+    list(dag.tasks) >> watcher()
+
+
+from tests.system.utils import get_test_run  # noqa: E402
+
+# Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest)

Review Comment:
   Should this be placed in L166?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org