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

cli-tests: account for protojson whitespace randomization #362

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

ebiggers
Copy link
Collaborator

@ebiggers ebiggers commented Aug 18, 2022

Annoyingly, for JSON formatting protojson randomly selects a spacing method (one space or two spaces) depending on a hash of some sections of the Go binary, to discourage depending on its output being stable. This breaks some checks in the CLI tests of the contents of fscrypt.conf and the output of 'fscrypt status'. As there doesn't appear to be a straightforward alternative currently, for now just update the tests to take into consideration the possible extra space.

Annoyingly, for JSON formatting protojson randomly selects a spacing
method (one space or two spaces) depending on a hash of some sections of
the Go binary, to discourage depending on its output being stable.  This
breaks some checks in the CLI tests of the contents of fscrypt.conf and
the output of 'fscrypt status'.  As there doesn't appear to be a
straightforward alternative currently, for now just update the tests to
take into consideration the possible extra space.
@josephlr josephlr merged commit a1ddf6e into master Aug 19, 2022
@josephlr josephlr deleted the fix-cli-tests-2 branch August 19, 2022 02:06
josephlr added a commit that referenced this pull request Aug 27, 2022
Follow up to #362

Protojson randomly inserts whitespace to indicate that the output is
unstable, breaking out tests. To fix this, compact the output before
comparison.

Signed-off-by: Joe Richey <joerichey@google.com>
josephlr added a commit that referenced this pull request Aug 27, 2022
Follow up to #362

Protojson randomly inserts whitespace to indicate that the output is
unstable, breaking out tests. To fix this, compact the output before
comparison.

Signed-off-by: Joe Richey <joerichey@google.com>
josephlr added a commit that referenced this pull request Aug 27, 2022
Follow up to #362

Protojson randomly inserts whitespace to indicate that the output is
unstable, breaking out tests. To fix this, compact the output before
comparison.

Signed-off-by: Joe Richey <joerichey@google.com>

Signed-off-by: Joe Richey <joerichey@google.com>
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