Skip to content

testutil: make blueprint result comparison more robust and easy to read#467

Merged
phobologic merged 1 commit into
cloudtools:masterfrom
Cobliteam:blueprint-test-comparison-improvements
Aug 26, 2017
Merged

testutil: make blueprint result comparison more robust and easy to read#467
phobologic merged 1 commit into
cloudtools:masterfrom
Cobliteam:blueprint-test-comparison-improvements

Conversation

@danielkza

Copy link
Copy Markdown
Contributor

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.

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 phobologic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thanks!

@phobologic phobologic merged commit e38bc7d into cloudtools:master Aug 26, 2017
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.
@danielkza danielkza deleted the blueprint-test-comparison-improvements branch February 3, 2018 19:35
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
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