potiuk commented on a change in pull request #4493: [AIRFLOW-3680] Consistency update in tests for All GCP-related operators URL: https://github.com/apache/airflow/pull/4493#discussion_r247300107
########## File path: tests/contrib/operators/test_gcp_bigtable_operator_system_helper.py ########## @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import os + +import argparse + +from tests.contrib.utils.gcp_authenticator import GcpAuthenticator, GCP_SPANNER_KEY +from tests.contrib.utils.logging_command_executor import LoggingCommandExecutor + +ITEST_PROJECT_ID = os.environ.get('GCP_PROJECT_ID', 'example-project') +ITEST_INSTANCE = os.environ.get('CBT_INSTANCE_ID', 'testinstance') + + +class GCPBigtableTestHelper(LoggingCommandExecutor): + + def delete_instance(self): + self.execute_cmd([ + 'gcloud', 'bigtable', '--project', ITEST_PROJECT_ID, Review comment: Those tests are skipped on Travis. All the system tests check for presence of (now) GCP_CONFIG_DIR variable and presence of the appropriate service account key (for example compute keys expect GCP_CONFIG_DIR/keys/gcp_compute.json). There is this common "skipIf" function used across all the system tests. This is similar to some other tests in airflow that do not run if there is no Mysql environment etc. That's why we named the tests "SystemTests" eventually - they are not unit tests technically even if we use (for convenience) pythons unit test framework to run them. It's simply very convenient to use IDE integration with unit tests to run them this way. ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
