mik-laj commented on a change in pull request #6299: [AIRFLOW-5631] Change way 
of running GCP system tests
URL: https://github.com/apache/airflow/pull/6299#discussion_r336888129
 
 

 ##########
 File path: tests/gcp/operators/test_cloud_sql_system.py
 ##########
 @@ -17,42 +17,34 @@
 # specific language governing permissions and limitations
 # under the License.
 import os
-import unittest
 
 from airflow import AirflowException
 from tests.gcp.operators.test_cloud_sql_system_helper import 
CloudSqlQueryTestHelper
-from tests.gcp.utils.base_gcp_system_test_case import SKIP_TEST_WARNING, 
TestDagGcpSystem
 from tests.gcp.utils.gcp_authenticator import GCP_CLOUDSQL_KEY
+from tests.test_utils.gcp_system_helpers import GCP_DAG_FOLDER, 
provide_gcp_context, skip_gcp_system
+from tests.test_utils.system_tests_class import SystemTest
 
 GCP_PROJECT_ID = os.environ.get('GCP_PROJECT_ID', 'project-id')
 
 SQL_QUERY_TEST_HELPER = CloudSqlQueryTestHelper()
 
 
[email protected](TestDagGcpSystem.skip_check(GCP_CLOUDSQL_KEY), 
SKIP_TEST_WARNING)
-class CloudSqlExampleDagsIntegrationTest(TestDagGcpSystem):
-    def __init__(self, method_name='runTest'):
-        super().__init__(
-            method_name,
-            dag_id='example_gcp_sql',
-            gcp_key=GCP_CLOUDSQL_KEY)
-
+@skip_gcp_system(GCP_CLOUDSQL_KEY, require_local_executor=True)
+class CloudSqlExampleDagsIntegrationTest(SystemTest):
+    @provide_gcp_context(GCP_CLOUDSQL_KEY)
     def tearDown(self):
         # Delete instances just in case the test failed and did not cleanup 
after itself
-        self.gcp_authenticator.gcp_authenticate()
-        try:
-            
SQL_QUERY_TEST_HELPER.delete_instances(instance_suffix="-failover-replica")
-            
SQL_QUERY_TEST_HELPER.delete_instances(instance_suffix="-read-replica")
-            SQL_QUERY_TEST_HELPER.delete_instances()
-            SQL_QUERY_TEST_HELPER.delete_instances(instance_suffix="2")
-            SQL_QUERY_TEST_HELPER.delete_service_account_acls()
-        finally:
-            self.gcp_authenticator.gcp_revoke_authentication()
+        
SQL_QUERY_TEST_HELPER.delete_instances(instance_suffix="-failover-replica")
 
 Review comment:
   In other places, the helper is set as a class property. Do you have 
recommendations about it?

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


With regards,
Apache Git Services

Reply via email to