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

Linux command output display request as a part of goss command test result. #559

Closed
shan100github opened this issue Mar 13, 2020 · 3 comments

Comments

@shan100github
Copy link
Contributor

Describe the feature:
Refer: #557
Currently, file comparison/validation can be performed through goss command. Failure details are not displayed during command execution.

Sample execution of goss command to diff /tmp/file1 /tmp/file2

command:
  diff:
    exit-status: 0
    exec: "diff /tmp/file1 /tmp/file2"

during the success scenarios it's fine, But the output displayed during failure scenarios is not providing details about failure.

on failure following output is displayed by goss.

$>goss v -f tap
1..1
not ok 1 - Command: diff: exit-status: doesn't match, expect: [0] found: [1]

Solution suggestion
During linux command diff /tmp/file1 /tmp/file2execution in terminal displays following content. If we can display following content as goss test result it will be easier for enduser to know failures

$>diff /tmp/file1 /tmp/file2
2c2
< am in file1
---
> am in file2

Describe alternatives considered

No alternatives considered currently, using goss command to perform file diff.

@shan100github shan100github changed the title Linux command output is display request as a part of goss command test. Linux command output display request as a part of goss command test result. Mar 13, 2020
@petemounce
Copy link
Collaborator

Maybe use a package to generate diffs; https://godoc.org/github.com/pmezard/go-difflib/difflib I think. Windows doesn't natively provide that tool :(

@stale
Copy link

stale bot commented Jul 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 9, 2020
@aelsabbahy
Copy link
Member

consolidating with #483

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants