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

Sort control files before loading to allow results to be predictable #4326

Closed
wants to merge 1 commit into from
Closed

Sort control files before loading to allow results to be predictable #4326

wants to merge 1 commit into from

Conversation

mattray
Copy link
Contributor

@mattray mattray commented Jul 23, 2019

Fixes #3797

Signed-off-by: Matt Ray matthewhray@gmail.com

Description

Sorts the control files for predictable output. This is a frequent request, just submitting a PR for the simplest solution.

Related Issue

#3887
#3840

Types of changes

Simply sorts the control files.

Checklist:

  • I have read the CONTRIBUTING document.

…able

Fixes #3797

Signed-off-by: Matt Ray <matthewhray@gmail.com>
@codeclimate
Copy link

codeclimate bot commented Jul 23, 2019

Code Climate has analyzed commit ce5a609 and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 83.694% when pulling ce5a609 on mattray:sort_controls into 399b1cb on inspec:master.

@zenspider
Copy link
Contributor

I'm against this at a philosophical level. Why is this needed?

Copy link
Contributor

@clintoncwolfe clintoncwolfe left a comment

Choose a reason for hiding this comment

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

It seems straightforward, but my only concern is the lack of testing - not so much because we want to verify that it works, but because we want to discover how control file sorting works under other conditions - such as multiple profiles, on the same command line, inheritance, etc. Also, should this be documented?

@clintoncwolfe
Copy link
Contributor

My understanding is that people want to have setup and teardown files - aaa.rb to initialize, zzz.rb to cleanup, etc.

@mattray
Copy link
Contributor Author

mattray commented Jul 23, 2019

I submitted the patch because the customer said they wanted consistent ordering of test results and this worked for them. If we document it as a feature, then we'll need to put a lot more effort into testing the scenarios @clintoncwolfe mentioned. Would it be acceptable to merge the patch and see if this is sufficient for the other issues that have been raised in the past and revisit it if it is not?

@zenspider
Copy link
Contributor

Consistent ordering of test results is (or can be) different from consistent ordering of test execution.

I think this issue will require some extra discussion. I might need recalibration.

@miah
Copy link
Contributor

miah commented Jul 24, 2019

It feels like this should be a reporter modification.

@aaronlippold
Copy link
Collaborator

aaronlippold commented Jul 25, 2019 via email

@clintoncwolfe
Copy link
Contributor

@mattray can you clarify - what is wanted here? predictable execution order, or predictable results ordering?

@aaronlippold
Copy link
Collaborator

aaronlippold commented Jul 25, 2019 via email

@zenspider
Copy link
Contributor

After discussion and further consideration, I'm going to have to push back on this. It's dangerous (read: leads to false positives caused by test order dependencies) and not something we want to support.

I submitted the patch because the customer said they wanted consistent ordering of test results

This is a perfect description of the problem at hand. This should have become an issue asking for exactly that. What this PR is is a prescription of what you want, but it is the wrong solution for the actual problem at hand (a report order issue, not a run order issue). Sorry to have to go this way, but I have Very Strong Feelings™ about testing (and put out the very first test framework that actually randomized order to maintain exactly this).

@zenspider zenspider closed this Jul 29, 2019
@zenspider
Copy link
Contributor

Also: Please do file that issue so we can get it on the board and you can track it.

@mattray
Copy link
Contributor Author

mattray commented Jul 29, 2019

@zenspider was #3797 not sufficient?

@zenspider
Copy link
Contributor

@mattray I overlooked that. I would say that it is NOT sufficient for the reasons I explained above. Being descriptive as to what your problem is helps us find a solution that fits both the codebase, best practices, and the customer... this ticket is not that. It is prescriptive ("sort the controls to allow X"). I will poke at it.

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.

Make reporting consistent/predictable
6 participants