Skip to content

Make responseEndpoint optional #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

johnttompkins
Copy link
Contributor

Issue #, if available: #122

Description of changes: While working on #120, went from completely removing responseEndpoint on the first iteration to adding it back in the next time around. Ideally, this should be marked as optional, as it is still sent from CloudFormation's backend. This should work with both cfn test and stack provisioning. Will fully test out in the morning before releasing.

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

Copy link

@wbingli wbingli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@johnttompkins
Copy link
Contributor Author

Tested this morning and cfn test works successfully with this change:

test-python-plugin jotompki$ cfn test -vv -- -k contract_create_delete
Logging set up successfully
Running test: Namespace(cloudformation_endpoint_url=None, command=<function test at 0x106fdb158>, endpoint='http://127.0.0.1:3001', enforce_timeout='30', function_name='TypeFunction', passed_to_pytest=['-k', 'contract_create_delete'], region='us-east-1', role_arn=None, subparser_name='test', verbose=2, version=False)
Root directory: /Users/jotompki/workplace/test-python-plugin
Loading project file '/Users/jotompki/workplace/test-python-plugin/.rpdk-config'
Validating your resource schema...
Rewriting refs in '<BASE>' (file:///Users/jotompki/workplace/test-python-plugin/test-python-plugin.json)
Override file '/Users/jotompki/workplace/test-python-plugin/overrides.json' not found. No overrides will be applied
temporary pytest.ini path: /var/folders/w_/842t19210v7fhhmlq5mlh_cjj90hb8/T/pytest_z5dynma_.ini
extra args: ['-k', 'contract_create_delete']
pytest args: ['-c', '/private/var/folders/w_/842t19210v7fhhmlq5mlh_cjj90hb8/T/pytest_z5dynma_.ini', '-m', '', '-k', 'contract_create_delete']
=========================================================================== test session starts ============================================================================
platform darwin -- Python 3.7.0, pytest-6.0.2, py-1.9.0, pluggy-0.13.1 -- /Users/jotompki/workplace/cloudformation-cli-python-plugin/env/bin/python3
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/Users/jotompki/workplace/test-python-plugin/.hypothesis/examples')
Test order randomisation NOT enabled. Enable with --random-order or --random-order-bucket=<bucket_type>
rootdir: /Users/jotompki/workplace/test-python-plugin, configfile: ../../../../private/var/folders/w_/842t19210v7fhhmlq5mlh_cjj90hb8/T/pytest_z5dynma_.ini
plugins: hypothesis-5.35.3, localserver-0.5.0, random-order-1.0.4, cov-2.10.1
collected 16 items / 15 deselected / 1 selected                                                                                                                            

handler_create.py::contract_create_delete PASSED                                                                                                                     [100%]

============================================================================= warnings summary =============================================================================
handler_create.py::contract_create_delete
  /Users/jotompki/workplace/cloudformation-cli-python-plugin/env/lib/python3.7/site-packages/hypothesis/strategies/_internal/strategies.py:273: NonInteractiveExampleWarning: The `.example()` method is good for exploring strategies, but should only be used interactively.  We recommend using `@given` for tests - it performs better, saves and replays failures to avoid flakiness, and reports minimal examples. (strategy: fixed_dictionaries({'TestCode': one_of(just('NOT_STARTED'), just('CANCELLED')),
   'Title': text(alphabet=characters(blacklist_categories=('Cc', 'Cs'), min_codepoint=1), max_size=250, min_size=20)}))
    NonInteractiveExampleWarning,

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=============================================================== 1 passed, 15 deselected, 1 warning in 6.41s ================================================================
Finished test

@johnttompkins johnttompkins marked this pull request as ready for review September 16, 2020 18:59
@johnttompkins johnttompkins merged commit 5b80d11 into aws-cloudformation:master Sep 16, 2020
@johnttompkins johnttompkins deleted the response-endpoint branch September 16, 2020 19:02
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.

3 participants