Skip to content

Conversation

aahung
Copy link
Contributor

@aahung aahung commented Nov 2, 2022

Issue #, if available

Description of changes

Description of how you validated changes

Checklist

  • Add/update unit tests using:
  • Add/update integration tests
  • Update documentation
  • Verify transformed template deploys and application functions as expected
  • Do these changes include any template validations?
    • Did the newly validated properties support intrinsics prior to adding the validations? (If unsure, please review Intrinsic Functions before proceeding).
      • Does the pull request ensure that intrinsics remain functional with the new validations?

Examples?

Please reach out in the comments, if you want to add an example. Examples will be
added to sam init through https://github.com/awslabs/aws-sam-cli-app-templates/

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@aahung
Copy link
Contributor Author

aahung commented Nov 2, 2022

First attempt to run integ tests:

$ pytest --no-cov integration/ -n auto
...
=============================================================================================== short test summary info ================================================================================================
FAILED integration/combination/test_api_settings.py::TestApiSettings::test_implicit_api_settings - integration.helpers.deployer.exceptions.exceptions.DeployFailedError: Failed to create/update the stack: sam-integ...
FAILED integration/combination/test_function_with_alias.py::TestFunctionWithAlias::test_function_with_alias_with_intrinsics - AssertionError: Lists differ: ['1', '2'] != ['1']
FAILED integration/combination/test_api_settings.py::TestApiSettings::test_method_settings - integration.helpers.deployer.exceptions.exceptions.DeployFailedError: Failed to create/update the stack: sam-integ-stack...
FAILED integration/single/test_basic_application.py::TestBasicApplication::test_basic_application_sar_location_with_intrinsics - FileNotFoundError: [Errno 2] No such file or directory: '/Users/xinhol/Projects/serv...
FAILED integration/single/test_basic_application.py::TestBasicApplication::test_basic_application_sar_location - FileNotFoundError: [Errno 2] No such file or directory: '/Users/xinhol/Projects/serverless-applicati...
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
ERROR integration/combination/test_function_with_self_managed_kafka.py::TestFunctionWithSelfManagedKafka - AttributeError: 'MarkDecorator' object has no attribute '__qualname__'
================================================================ 5 failed, 159 passed, 7 skipped, 30 warnings, 12 errors, 5 rerun in 2378.80s (0:39:38) ================================================================

@aahung
Copy link
Contributor Author

aahung commented Nov 2, 2022

Re-run integration/combination/test_api_settings.py::TestApiSettings::test_implicit_api_settings after re-creating the companion stack:

[gw0] [100%] PASSED integration/combination/test_api_settings.py::TestApiSettings::test_implicit_api_settings 

@aahung
Copy link
Contributor Author

aahung commented Nov 3, 2022

Re-run integration/combination/test_function_with_alias.py::TestFunctionWithAlias::test_function_with_alias_with_intrinsics, still failed:

____________________________________________________________________________ TestFunctionWithAlias.test_function_with_alias_with_intrinsics ____________________________________________________________________________
[gw0] darwin -- Python 3.7.2 /Users/xinhol/.pyenv/versions/3.7.2/envs/samtranslator37/bin/python3.7

self = <integration.combination.test_function_with_alias.TestFunctionWithAlias testMethod=test_function_with_alias_with_intrinsics>

    def test_function_with_alias_with_intrinsics(self):
        parameters = self.get_default_test_template_parameters()
        self.create_and_verify_stack("combination/function_with_alias_intrinsics", parameters)
        alias_name = "Live"
    
        function_name = self.get_physical_id_by_type("AWS::Lambda::Function")
        version_ids = get_function_versions(function_name, self.client_provider.lambda_client)
        self.assertEqual(["1"], version_ids)
    
        alias = self.get_alias(function_name, alias_name)
        self.assertEqual("1", alias["FunctionVersion"])
    
        # Let's change Key by updating the template parameter, but keep template same
        # This should create a new version and leave existing version intact
        parameters[1]["ParameterValue"] = "code2.zip"
    
        self.update_stack(parameters)
        version_ids = get_function_versions(function_name, self.client_provider.lambda_client)
>       self.assertEqual(["1", "2"], version_ids)
E       AssertionError: Lists differ: ['1', '2'] != ['1']
E       
E       First list contains 1 additional elements.
E       First extra element 1:
E       '2'
E       
E       - ['1', '2']
E       + ['1']

@GavinZZ GavinZZ marked this pull request as ready for review November 18, 2022 19:29
@GavinZZ GavinZZ requested a review from a team as a code owner November 18, 2022 19:29
@GavinZZ GavinZZ marked this pull request as draft November 18, 2022 19:29
@GavinZZ
Copy link
Contributor

GavinZZ commented Nov 18, 2022

Closing this PR as it's outdated. For the latest formatting change, see #2617

@GavinZZ GavinZZ closed this Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants