Skip to content

botocore 1.23 breaks tests #1850

Closed
@dotlambda

Description

@dotlambda

boto/botocore@e0e8e1c breaks tests/unit/test_awsclient.py:

============================= test session starts ==============================
platform linux -- Python 3.9.9, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /build/source
plugins: hypothesis-6.27.1
collecting ... HYPOTHESIS PROFILE: None
collected 1378 items / 7 deselected / 1371 selected

tests/functional/test_awsclient.py ..................................... [  2%]
........................................................................ [  7%]
........................................................................ [ 13%]
......                                                                   [ 13%]
tests/functional/test_deployer.py ....................                   [ 15%]
tests/functional/test_local.py ......                                    [ 15%]
tests/functional/test_package.py ....................................... [ 18%]
...........                                                              [ 19%]
tests/functional/test_utils.py ........                                  [ 19%]
tests/functional/api/test_package.py ....                                [ 20%]
tests/functional/cdk/test_construct.py sss                               [ 20%]
tests/functional/cli/test_cli.py .....................................   [ 22%]
tests/functional/cli/test_factory.py ..............................      [ 25%]
tests/functional/cli/test_reloader.py ..........                         [ 25%]
tests/unit/test_analyzer.py ............................................ [ 29%]
.....................                                                    [ 30%]
tests/unit/test_app.py ................................................. [ 34%]
........................................................................ [ 39%]
........................................................................ [ 44%]
...........................                                              [ 46%]
tests/unit/test_awsclient.py FF.FF.................                      [ 48%]
tests/unit/test_config.py .............................................. [ 51%]
....                                                                     [ 51%]
tests/unit/test_invoke.py .........                                      [ 52%]
tests/unit/test_local.py ............................................... [ 56%]
..............................................                           [ 59%]
tests/unit/test_logs.py ...............                                  [ 60%]
tests/unit/test_package.py ............................................. [ 63%]
..................................................                       [ 67%]
tests/unit/test_pipeline.py ......................                       [ 69%]
tests/unit/test_policy.py ...........                                    [ 69%]
tests/unit/test_test.py ......................                           [ 71%]
tests/unit/test_utils.py ....................................            [ 74%]
tests/unit/cli/test_cli.py ..                                            [ 74%]
tests/unit/cli/test_newproj.py ..............                            [ 75%]
tests/unit/cli/filewatch/test_eventbased.py .......                      [ 75%]
tests/unit/cli/filewatch/test_stat.py .                                  [ 75%]
tests/unit/deploy/test_appgraph.py ............................          [ 77%]
tests/unit/deploy/test_deployer.py ..................................... [ 80%]
....................                                                     [ 81%]
tests/unit/deploy/test_executor.py .................................     [ 84%]
tests/unit/deploy/test_models.py .......                                 [ 84%]
tests/unit/deploy/test_packager.py ........................              [ 86%]
tests/unit/deploy/test_planner.py ...................................... [ 89%]
.................................................................        [ 94%]
tests/unit/deploy/test_swagger.py ................................       [ 96%]
tests/unit/deploy/test_validate.py .............................         [ 98%]
tests/unit/vendored/botocore/test_regions.py ...................         [100%]

=================================== FAILURES ===================================
________________ test_resolve_endpoint[sns-us-east-1-endpoint0] ________________

stubbed_session = <tests.conftest.StubbedSession object at 0x7ffff39e5dc0>
service = 'sns', region = 'us-east-1'
endpoint = OrderedDict([('partition', 'aws'), ('endpointName', 'us-east-1'), ('protocols', ['http', 'https']), ('hostname', 'sns.us-east-1.amazonaws.com'), ('signatureVersions', ['v4']), ('dnsSuffix', 'amazonaws.com')])

    @pytest.mark.parametrize('service,region,endpoint', [
        ('sns', 'us-east-1',
         OrderedDict([('partition', 'aws'),
                      ('endpointName', 'us-east-1'),
                      ('protocols', ['http', 'https']),
                      ('hostname', 'sns.us-east-1.amazonaws.com'),
                      ('signatureVersions', ['v4']),
                      ('dnsSuffix', 'amazonaws.com')])),
        ('sqs', 'cn-north-1',
         OrderedDict([('partition', 'aws-cn'),
                      ('endpointName', 'cn-north-1'),
                      ('protocols', ['http', 'https']),
                      ('sslCommonName', 'cn-north-1.queue.amazonaws.com.cn'),
                      ('hostname', 'sqs.cn-north-1.amazonaws.com.cn'),
                      ('signatureVersions', ['v4']),
                      ('dnsSuffix', 'amazonaws.com.cn')])),
        ('dynamodb', 'mars-west-1', None)
    ])
    def test_resolve_endpoint(stubbed_session, service, region, endpoint):
        awsclient = TypedAWSClient(stubbed_session)
>       assert endpoint == awsclient.resolve_endpoint(service, region)
E       AssertionError: assert OrderedDict([...zonaws.com')]) == OrderedDict([...zonaws.com')])
E         Omitting 6 identical items, use -vv to show
E         Right contains 1 more item:
E         {'variants': [OrderedDict([('hostname', 'sns-fips.us-east-1.amazonaws.com'),
E                                    ('tags', ['fips'])])]}
E         Use -v to get the full diff

tests/unit/test_awsclient.py:28: AssertionError
------------------------------ Captured log setup ------------------------------
DEBUG    botocore.hooks:hooks.py:420 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-call.apigateway to before-call.api-gateway
DEBUG    botocore.hooks:hooks.py:420 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
DEBUG    botocore.hooks:hooks.py:420 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
------------------------------ Captured log call -------------------------------
DEBUG    botocore.loaders:loaders.py:175 Loading JSON file: /nix/store/sx74hxvfjdza013p1jwinyk1hxsybry7-python3.9-botocore-1.23.14/lib/python3.9/site-packages/botocore/data/endpoints.json
_______________ test_resolve_endpoint[sqs-cn-north-1-endpoint1] ________________

stubbed_session = <tests.conftest.StubbedSession object at 0x7ffff32ecd30>
service = 'sqs', region = 'cn-north-1'
endpoint = OrderedDict([('partition', 'aws-cn'), ('endpointName', 'cn-north-1'), ('protocols', ['http', 'https']), ('sslCommonNam...'), ('hostname', 'sqs.cn-north-1.amazonaws.com.cn'), ('signatureVersions', ['v4']), ('dnsSuffix', 'amazonaws.com.cn')])

    @pytest.mark.parametrize('service,region,endpoint', [
        ('sns', 'us-east-1',
         OrderedDict([('partition', 'aws'),
                      ('endpointName', 'us-east-1'),
                      ('protocols', ['http', 'https']),
                      ('hostname', 'sns.us-east-1.amazonaws.com'),
                      ('signatureVersions', ['v4']),
                      ('dnsSuffix', 'amazonaws.com')])),
        ('sqs', 'cn-north-1',
         OrderedDict([('partition', 'aws-cn'),
                      ('endpointName', 'cn-north-1'),
                      ('protocols', ['http', 'https']),
                      ('sslCommonName', 'cn-north-1.queue.amazonaws.com.cn'),
                      ('hostname', 'sqs.cn-north-1.amazonaws.com.cn'),
                      ('signatureVersions', ['v4']),
                      ('dnsSuffix', 'amazonaws.com.cn')])),
        ('dynamodb', 'mars-west-1', None)
    ])
    def test_resolve_endpoint(stubbed_session, service, region, endpoint):
        awsclient = TypedAWSClient(stubbed_session)
>       assert endpoint == awsclient.resolve_endpoint(service, region)
E       AssertionError: assert OrderedDict([...aws.com.cn')]) == OrderedDict([...aws.com.cn')])
E         Omitting 7 identical items, use -vv to show
E         Right contains 1 more item:
E         {'variants': [OrderedDict([('dnsSuffix', 'amazonaws.com.cn'),
E                                    ('hostname', '{service}-fips.{region}.{dnsSuffix}'),
E                                    ('tags', ['fips'])]),
E                       OrderedDict([('dnsSuffix', 'api.amazonwebservices.com.cn'),
E                                    ('hostname', '{service}-fips.{region}.{dnsSuffix}'),...
E
E         ...Full output truncated (6 lines hidden), use '-vv' to show

tests/unit/test_awsclient.py:28: AssertionError
------------------------------ Captured log setup ------------------------------
DEBUG    botocore.hooks:hooks.py:420 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-call.apigateway to before-call.api-gateway
DEBUG    botocore.hooks:hooks.py:420 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
DEBUG    botocore.hooks:hooks.py:420 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
------------------------------ Captured log call -------------------------------
DEBUG    botocore.loaders:loaders.py:175 Loading JSON file: /nix/store/sx74hxvfjdza013p1jwinyk1hxsybry7-python3.9-botocore-1.23.14/lib/python3.9/site-packages/botocore/data/endpoints.json
____ test_endpoint_from_arn[arn:aws:sns:us-east-1:123456:MyTopic-endpoint0] ____

stubbed_session = <tests.conftest.StubbedSession object at 0x7ffff4443580>
arn = 'arn:aws:sns:us-east-1:123456:MyTopic'
endpoint = OrderedDict([('partition', 'aws'), ('endpointName', 'us-east-1'), ('protocols', ['http', 'https']), ('hostname', 'sns.us-east-1.amazonaws.com'), ('signatureVersions', ['v4']), ('dnsSuffix', 'amazonaws.com')])

    @pytest.mark.parametrize('arn,endpoint', [
        ('arn:aws:sns:us-east-1:123456:MyTopic',
         OrderedDict([('partition', 'aws'),
                      ('endpointName', 'us-east-1'),
                      ('protocols', ['http', 'https']),
                      ('hostname', 'sns.us-east-1.amazonaws.com'),
                      ('signatureVersions', ['v4']),
                      ('dnsSuffix', 'amazonaws.com')])),
        ('arn:aws-cn:sqs:cn-north-1:444455556666:queue1',
         OrderedDict([('partition', 'aws-cn'),
                      ('endpointName', 'cn-north-1'),
                      ('protocols', ['http', 'https']),
                      ('sslCommonName', 'cn-north-1.queue.amazonaws.com.cn'),
                      ('hostname', 'sqs.cn-north-1.amazonaws.com.cn'),
                      ('signatureVersions', ['v4']),
                      ('dnsSuffix', 'amazonaws.com.cn')])),
        ('arn:aws:dynamodb:mars-west-1:123456:table/MyTable', None)
    ])
    def test_endpoint_from_arn(stubbed_session, arn, endpoint):
        awsclient = TypedAWSClient(stubbed_session)
>       assert endpoint == awsclient.endpoint_from_arn(arn)
E       AssertionError: assert OrderedDict([...zonaws.com')]) == OrderedDict([...zonaws.com')])
E         Omitting 6 identical items, use -vv to show
E         Right contains 1 more item:
E         {'variants': [OrderedDict([('hostname', 'sns-fips.us-east-1.amazonaws.com'),
E                                    ('tags', ['fips'])])]}
E         Use -v to get the full diff

tests/unit/test_awsclient.py:51: AssertionError
------------------------------ Captured log setup ------------------------------
DEBUG    botocore.hooks:hooks.py:420 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-call.apigateway to before-call.api-gateway
DEBUG    botocore.hooks:hooks.py:420 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
DEBUG    botocore.hooks:hooks.py:420 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
------------------------------ Captured log call -------------------------------
DEBUG    botocore.loaders:loaders.py:175 Loading JSON file: /nix/store/sx74hxvfjdza013p1jwinyk1hxsybry7-python3.9-botocore-1.23.14/lib/python3.9/site-packages/botocore/data/endpoints.json
_ test_endpoint_from_arn[arn:aws-cn:sqs:cn-north-1:444455556666:queue1-endpoint1] _

stubbed_session = <tests.conftest.StubbedSession object at 0x7ffff4c36d60>
arn = 'arn:aws-cn:sqs:cn-north-1:444455556666:queue1'
endpoint = OrderedDict([('partition', 'aws-cn'), ('endpointName', 'cn-north-1'), ('protocols', ['http', 'https']), ('sslCommonNam...'), ('hostname', 'sqs.cn-north-1.amazonaws.com.cn'), ('signatureVersions', ['v4']), ('dnsSuffix', 'amazonaws.com.cn')])

    @pytest.mark.parametrize('arn,endpoint', [
        ('arn:aws:sns:us-east-1:123456:MyTopic',
         OrderedDict([('partition', 'aws'),
                      ('endpointName', 'us-east-1'),
                      ('protocols', ['http', 'https']),
                      ('hostname', 'sns.us-east-1.amazonaws.com'),
                      ('signatureVersions', ['v4']),
                      ('dnsSuffix', 'amazonaws.com')])),
        ('arn:aws-cn:sqs:cn-north-1:444455556666:queue1',
         OrderedDict([('partition', 'aws-cn'),
                      ('endpointName', 'cn-north-1'),
                      ('protocols', ['http', 'https']),
                      ('sslCommonName', 'cn-north-1.queue.amazonaws.com.cn'),
                      ('hostname', 'sqs.cn-north-1.amazonaws.com.cn'),
                      ('signatureVersions', ['v4']),
                      ('dnsSuffix', 'amazonaws.com.cn')])),
        ('arn:aws:dynamodb:mars-west-1:123456:table/MyTable', None)
    ])
    def test_endpoint_from_arn(stubbed_session, arn, endpoint):
        awsclient = TypedAWSClient(stubbed_session)
>       assert endpoint == awsclient.endpoint_from_arn(arn)
E       AssertionError: assert OrderedDict([...aws.com.cn')]) == OrderedDict([...aws.com.cn')])
E         Omitting 7 identical items, use -vv to show
E         Right contains 1 more item:
E         {'variants': [OrderedDict([('dnsSuffix', 'amazonaws.com.cn'),
E                                    ('hostname', '{service}-fips.{region}.{dnsSuffix}'),
E                                    ('tags', ['fips'])]),
E                       OrderedDict([('dnsSuffix', 'api.amazonwebservices.com.cn'),
E                                    ('hostname', '{service}-fips.{region}.{dnsSuffix}'),...
E
E         ...Full output truncated (6 lines hidden), use '-vv' to show

tests/unit/test_awsclient.py:51: AssertionError
------------------------------ Captured log setup ------------------------------
DEBUG    botocore.hooks:hooks.py:420 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-call.apigateway to before-call.api-gateway
DEBUG    botocore.hooks:hooks.py:420 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
DEBUG    botocore.hooks:hooks.py:420 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
DEBUG    botocore.hooks:hooks.py:420 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
DEBUG    botocore.hooks:hooks.py:420 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
------------------------------ Captured log call -------------------------------
DEBUG    botocore.loaders:loaders.py:175 Loading JSON file: /nix/store/sx74hxvfjdza013p1jwinyk1hxsybry7-python3.9-botocore-1.23.14/lib/python3.9/site-packages/botocore/data/endpoints.json
=============================== warnings summary ===============================
tests/functional/test_deployer.py: 1 warning
tests/unit/deploy/test_deployer.py: 2 warnings
tests/unit/deploy/test_validate.py: 8 warnings
  /build/source/chalice/deploy/validate.py:46: UserWarning: You are currently running python3.9, but the closest supported version on AWS Lambda is python3.8
  Please use python3.8, otherwise you may run into deployment issues.
    validate_python_version(config)

tests/functional/cli/test_cli.py::test_create_new_project_creates_app
tests/functional/cli/test_cli.py::test_create_project_with_prompted_app_name
tests/functional/cli/test_cli.py::test_can_load_project_config_after_project_creation
tests/functional/cli/test_cli.py::test_default_new_project_adds_index_route
tests/functional/cli/test_cli.py::test_cli_with_absolute_path[None]
tests/functional/cli/test_cli.py::test_cli_with_absolute_path[.]
tests/functional/cli/test_cli.py::test_cli_with_absolute_path[getcwd]
tests/functional/cli/test_cli.py::test_chalice_cli_mode_env_var_always_set
  /build/source/chalice/cli/__init__.py:424: UserWarning: You are currently running python3.9, but the closest supported version on AWS Lambda is python3.8
  Please use python3.8, otherwise you may run into deployment issues.
    validate_python_version(Config.create())

tests/unit/test_local.py::TestLocalBuiltinAuthorizers::test_can_understand_cognito_token
  /build/source/chalice/local.py:352: UserWarning: CognitoUserPoolAuthorizer is not a supported in local mode. All requests made against a route will be authorized to allow local testing.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/unit/test_awsclient.py::test_resolve_endpoint[sns-us-east-1-endpoint0]
FAILED tests/unit/test_awsclient.py::test_resolve_endpoint[sqs-cn-north-1-endpoint1]
FAILED tests/unit/test_awsclient.py::test_endpoint_from_arn[arn:aws:sns:us-east-1:123456:MyTopic-endpoint0]
FAILED tests/unit/test_awsclient.py::test_endpoint_from_arn[arn:aws-cn:sqs:cn-north-1:444455556666:queue1-endpoint1]
= 4 failed, 1364 passed, 3 skipped, 7 deselected, 20 warnings in 73.11s (0:01:13) =

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions