-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
test: New test group to test for side effects #2046
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2046 +/- ##
===========================================
+ Coverage 93.58% 93.63% +0.04%
===========================================
Files 90 90
Lines 6124 6124
Branches 1260 1260
===========================================
+ Hits 5731 5734 +3
+ Misses 183 181 -2
+ Partials 210 209 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
region = partition_with_region[1] | ||
|
||
for template in testcase[1]: | ||
print(template, partition, region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that a debug left?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is useful when a test fails and you want to know which template/partition/region was responsible.
We already print the output of the transform in _compare_transform
but it doesn't show the name of the template.
Those are only printed if the test fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I would also recommend to format this information better.
* test: New test group to test for side effects * refactor: Updated to use _compare_transform and test CN and GOV partitions
* test: New test group to test for side effects (#2046) * test: New test group to test for side effects * refactor: Updated to use _compare_transform and test CN and GOV partitions * docs: fix dead link (#2045) * Percentage-based Enablement for Feature Toggle (#1952) * Percentage-based Enablement for Feature Toggle * Update Feature Toggle to accept stage, account_id and region during instanciation * remove unnecessary uses of dict.get method * Refactor feature toggle methods * Update test names * black reformat * Update FeatureToggle to require stage, region and account_id to instanciate * Update log message * Implement calculating account percentile based on hash of account_id and feature_name * Refactor _is_feature_enabled_for_region_config * Refactor dialup logic into its own classes * Add comments for dialup classes * Rename NeverEnabledDialup to DisabledDialup * chore(tests): Adding any tests (#2053) * Adding api_request_model any tests * Add any to api_request_model_openapi_3 cases * Add rest of relevant any test cases * Fix hashing to match python2 * add api_with_swagger_authorizer_none to be run * fix py2 hashes in api_with_swagger_authorizer_none tests Co-authored-by: Jacob Fuss <[email protected]> * Add modes support for RestApi (#2055) * Adding Mode passthrough property to RestApi with unit tests. * Adding integration test for Mode * Fixing sam-translate for manual translation. * running black formatting * Running black formatting, again. * Clearing pip-wheel-metadata. * Clearing tmp folder created by integ test. Co-authored-by: Tarun Mall <[email protected]> * chore: bump version to 1.38.0 (#2081) Co-authored-by: Mathieu Grandis <[email protected]> Co-authored-by: Chris Rehn <[email protected]> Co-authored-by: Wing Fung Lau <[email protected]> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Tarun Mall <[email protected]> Co-authored-by: Raymond Wang <[email protected]>
* test: New test group to test for side effects (#2046) * test: New test group to test for side effects * refactor: Updated to use _compare_transform and test CN and GOV partitions * docs: fix dead link (#2045) * Percentage-based Enablement for Feature Toggle (#1952) * Percentage-based Enablement for Feature Toggle * Update Feature Toggle to accept stage, account_id and region during instanciation * remove unnecessary uses of dict.get method * Refactor feature toggle methods * Update test names * black reformat * Update FeatureToggle to require stage, region and account_id to instanciate * Update log message * Implement calculating account percentile based on hash of account_id and feature_name * Refactor _is_feature_enabled_for_region_config * Refactor dialup logic into its own classes * Add comments for dialup classes * Rename NeverEnabledDialup to DisabledDialup * chore(tests): Adding any tests (#2053) * Adding api_request_model any tests * Add any to api_request_model_openapi_3 cases * Add rest of relevant any test cases * Fix hashing to match python2 * add api_with_swagger_authorizer_none to be run * fix py2 hashes in api_with_swagger_authorizer_none tests Co-authored-by: Jacob Fuss <[email protected]> * Add modes support for RestApi (#2055) * Adding Mode passthrough property to RestApi with unit tests. * Adding integration test for Mode * Fixing sam-translate for manual translation. * running black formatting * Running black formatting, again. * Clearing pip-wheel-metadata. * Clearing tmp folder created by integ test. Co-authored-by: Tarun Mall <[email protected]> * chore: bump version to 1.38.0 (#2081) Co-authored-by: Mathieu Grandis <[email protected]> Co-authored-by: Chris Rehn <[email protected]> Co-authored-by: Wing Fung Lau <[email protected]> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Tarun Mall <[email protected]> Co-authored-by: Raymond Wang <[email protected]> Co-authored-by: Mathieu Grandis <[email protected]> Co-authored-by: Chris Rehn <[email protected]> Co-authored-by: Wing Fung Lau <[email protected]> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Tarun Mall <[email protected]> Co-authored-by: Raymond Wang <[email protected]>
Issue #, if available:
Description of changes:
Added a new group test
test_transform_success_no_side_effect
intests/translator/test_translator.py
to test for side effects between translator executionsDescription of how you validated changes:
Checklist:
make pr
passesExamples?
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.