testutil: make blueprint result comparison more robust and easy to read#467
Merged
phobologic merged 1 commit intoAug 26, 2017
Conversation
Compare results of blueprint tests to the expected fixtures directly as dictionaries, by using `to_dict`, and parsing the file with `json.loads`, respectively. Then generate the strings with `json.dumps` with the same parameters (with `sort_keys` enabled) such that differences in the output are easy to discerne. This should make false-negatives much less likely.
phobologic
added a commit
that referenced
this pull request
Feb 3, 2018
This fixes an issue that was introduced in #467. The original functionality was to always dump the current output to `.json-result`, that way it was easy to build & compare the output. With the current implementation (from #467) we raise an exception if the old results aren't available, but don't create the new results. This is an issue whenever creating a new test.
phobologic
added a commit
that referenced
this pull request
Feb 4, 2018
* Always dump the current output/result This fixes an issue that was introduced in #467. The original functionality was to always dump the current output to `.json-result`, that way it was easy to build & compare the output. With the current implementation (from #467) we raise an exception if the old results aren't available, but don't create the new results. This is an issue whenever creating a new test. * Update CHANGELOG
phrohdoh
pushed a commit
to phrohdoh/stacker
that referenced
this pull request
Dec 18, 2018
…ad (cloudtools#467) Compare results of blueprint tests to the expected fixtures directly as dictionaries, by using `to_dict`, and parsing the file with `json.loads`, respectively. Then generate the strings with `json.dumps` with the same parameters (with `sort_keys` enabled) such that differences in the output are easy to discerne. This should make false-negatives much less likely.
phrohdoh
pushed a commit
to phrohdoh/stacker
that referenced
this pull request
Dec 18, 2018
* Always dump the current output/result This fixes an issue that was introduced in cloudtools#467. The original functionality was to always dump the current output to `.json-result`, that way it was easy to build & compare the output. With the current implementation (from cloudtools#467) we raise an exception if the old results aren't available, but don't create the new results. This is an issue whenever creating a new test. * Update CHANGELOG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compare results of blueprint tests to the expected fixtures directly as
dictionaries, by using
to_dict, and parsing the file withjson.loads, respectively. Then generate the strings withjson.dumpswith the same parameters (with
sort_keysenabled) such thatdifferences in the output are easy to discerne.
This should make false-negatives much less likely.