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

Cherry-pick #9827 to 6.x: Remove trailing whitespace from golden files #9832

Merged
merged 1 commit into from
Dec 29, 2018

Conversation

ycombinator
Copy link
Contributor

Cherry-pick of PR #9827 to 6.x branch. Original message:

When system tests are run with the GENERATE environment variable set, we regenerate golden files used by these tests. To do this we use the Python json.dump function, which adds trailing whitespaces when it is called with the indent argument (which we do). From the Python docs at https://docs.python.org/2/library/json.html:

Note Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this.

Per the suggestion in the docs, this change adds the separators argument as well, to avoid generating trailing whitespace.

This PR also regenerates all golden files with the new regeneration code.

When system tests are run with the `GENERATE` environment variable set, we regenerate golden files used by these tests. To do this we use the Python `json.dump` function, which adds trailing whitespaces when it is called with the `indent` argument (which we do). From the Python docs at https://docs.python.org/2/library/json.html:

> Note Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this.

Per the suggestion in the docs, this change adds the `separators` argument as well, to avoid generating trailing whitespace.

This PR also regenerates all golden files with the new regeneration code.

(cherry picked from commit bb92226)
@ycombinator
Copy link
Contributor Author

I regenerated the golden files in this backport PR because 6.x uses different fields than master.

While doing that it looks like some golden files never existed in 6.x (e.g. nginx/error and santa/log). Also looks like the sorting of keys was not being done in the elasticsearch/deprecation golden file.

Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

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

Looks good, waiting for CI to pass.

@ycombinator ycombinator merged commit 3ebc73b into elastic:6.x Dec 29, 2018
@ycombinator ycombinator deleted the backport_9827_6.x branch December 25, 2019 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants