nuclearpinguin commented on a change in pull request #6811: [RFC][AIRFLOW-6245] Add custom waiters for AWS batch jobs URL: https://github.com/apache/airflow/pull/6811#discussion_r360658778
########## File path: tests/providers/amazon/aws/hooks/test_batch_client.py ########## @@ -0,0 +1,314 @@ +# -*- 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 unittest + +import botocore.exceptions +from parameterized import parameterized + +from airflow.exceptions import AirflowException +from airflow.providers.amazon.aws.hooks.batch_client import AwsBatchClient +from tests.compat import mock + +# clear any existing AWS credentials +AWS_REGION = "eu-west-1" Review comment: I think that tests fail due to some side effects. What makes me to think so: - all failed tests are related to AWS - most of failures seems to be related to configuration - and ``` _______________ TestS3Hook.test_create_bucket_us_standard_region _______________ 3241 3242self = <tests.hooks.test_s3_hook.TestS3Hook testMethod=test_create_bucket_us_standard_region> 3243 3244 @mock_s3 3245 def test_create_bucket_us_standard_region(self): 3246 hook = S3Hook(aws_conn_id=None) 3247 hook.create_bucket(bucket_name='new_bucket', region_name='us-east-1') 3248 bucket = hook.get_bucket('new_bucket') 3249 self.assertIsNotNone(bucket) 3250 region = bucket.meta.client.get_bucket_location(Bucket=bucket.name).get('LocationConstraint', None) 3251> self.assertEqual(region, 'us-east-1') 3252E AssertionError: 'eu-west-1' != 'us-east-1' 3253E - eu-west-1 3254E + us-east-1 3255 3256tests/hooks/test_s3_hook.py:91: AssertionError ``` ---------------------------------------------------------------- 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
