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

Eliminate duplicate profiles being added to runner #141

Merged
merged 2 commits into from
Jul 11, 2017

Conversation

adamleff
Copy link
Contributor

@adamleff adamleff commented Jul 8, 2017

If a cookbook has an InSpec profile at test/integration/default and adds the profile to verifier.inspec_tests, kitchen-inspec would collect the profile twice and add both entries to the runner. This would cause a profile to be run twice.

This change refactors #resolve_config_inspec_tests to:

  • expand any paths to an absolute path
  • replace path strings that exist on the filesystem with a hash for
    consistency with what local_suite_files returns (so deduplication works)
  • eliminate any unnecessary keys from each inspec_tests entry to ensure
    items can be deduplicated properly

If a cookbook has an InSpec profile at `test/integration/default` and adds the
profile to `verifier.inspec_tests`, kitchen-inspec would collect the profile
twice and add both entries to the runner. This would cause a profile to be run
twice.

This change refactors `#resolve_config_inspec_tests` to:
 * expand any paths to an absolute path
 * replace path strings that exist on the filesystem with a hash for
   consistency with what local_suite_files returns (so deduplication works)
 * eliminate any unnecessary keys from each inspec_tests entry to ensure
   items can be deduplicated properly

Signed-off-by: Adam Leff <adam@leff.co>
Signed-off-by: Adam Leff <adam@leff.co>
Copy link
Collaborator

@arlimus arlimus left a comment

Choose a reason for hiding this comment

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

Awesome improvement, this is a great catch!! Kudos @adamleff

@arlimus arlimus merged commit c2b094c into master Jul 11, 2017
@arlimus arlimus deleted the adamleff/no-duplicate-paths branch July 11, 2017 19:38
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