Skip to content
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

Fix matcher output when the args to the matcher are a hash for two resources #3044

Merged
merged 1 commit into from
May 16, 2018

Conversation

clintoncwolfe
Copy link
Contributor

Fixes #2925

2925 indicated that reporters would output an empty hash when a matcher that accepted hash arguments was used. It turned out that works fine - it's just that two resources, aws_iam_security_group and aws_iam_policy were both using Hash#delete to whitelist criteria in matchers, without duping the Hash. So, if all went well, the input hash would be emptied; and the reporter would faithfully include an empty hash in the test description.

This fix simply adds dup calls to the matcher hash arguments. To test, run the AWS integration tests and observe test output for the two affected resources.

…ut dup'ing

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
@clintoncwolfe clintoncwolfe added Type: Bug Feature not working as expected Platform: AWS Amazon Web Services-related issues Component: Reporters Output formatting systems: Progress, JSON, JUnit, etc. Component: Core Resources Resources shipped with InSpec. labels May 13, 2018
@clintoncwolfe clintoncwolfe requested a review from a team as a code owner May 13, 2018 18:02
Copy link
Contributor

@jquick jquick left a comment

Choose a reason for hiding this comment

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

@jquick jquick merged commit a765afd into master May 16, 2018
@jquick jquick deleted the cw/hash-output-in-reporters branch May 16, 2018 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Resources Resources shipped with InSpec. Component: Reporters Output formatting systems: Progress, JSON, JUnit, etc. Platform: AWS Amazon Web Services-related issues Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some reporters display an empty Hash for matchers that take Hash arguments
3 participants