Closed aelsabbahy closed 1 year ago
Should -o include_raw be enabled by default, and the option becomes -o exclude_raw
I would prefer -o include_raw
to be the default, because I think that's a higher UX. I would be frustrated if I got a failure, had to re-run with -o include_raw
and the 2nd run passed; indicating the test is flaky somehow. I think that it's best to give the data up-front, because in the context of machine-assertions (and especially when some can be remote-assertions like http
, addr
) the chance of flakes is higher than in "normal" test frameworks.
(Also - this is great work; thank you!)
Awesome, thanks for the thorough feedback. I'll address it over the coming week and hopefully this gets merged/released after that.
I would prefer -o include_raw to be the default
This was my leaning as well, for all the reasons you mentioned.
Addressed some (most/all?) of the feedback here.
@petemounce let me know if all looks good, if I don't hear back in a week, I'll merge it.
Modified install.sh (locked down version) to avoid breaking anyone. Merging, will create a release candidate release.
Checklist
make test-all
(UNIX) passes. CI will also test thisDescription of change
Overview
This PR is a combination of v4 changes + a bunch of misc fixes/additions. My hope is to get this released sooner rather than later so future PRs/changes can be smaller and incremental.
The major changes with v4 is the ability to compare different types and more advanced string matching
note: Manual has been updated to document most (if not all) new matchers, also
testdata/
folder has ~80% coverage of the matcher language.For example:
This conversion also allows treating an io.Reader (memory efficient line-by-line parsing) as a whole string (when compared with a string). This has the benefit of showing the full command output, which was a long-requested feature. For example:
Changes
-o include_raw
will show the non-transformed valueequal
matcher added to do strict type comparison (e.x. string to string)contain-substring
have-patterns
- This mimics the existing default behavior of file contents and command outputcontain-elements
- checks that an array value matches a set of matchers-qf "%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}
), this opens the door for proper rpm version comparison in the futurecat -E /proc/<PID>/comm
to avoid whitespace issues (closes #762)matcher.as-reader
this allows the matcher string to behave as an io.Reader output. Can be useful for testingjson_online
output format, use:goss v -f json -o oneline
Decisions
Should
-o include_raw
be enabled by default, and the option becomes-o exclude_raw
Without include_raw:
With
-o include_raw
:reverted (defer to later)
These were changes living on the v4 branch. However, they are either bad fixes, or need more polish before release