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

Add combined output if a test fails #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
commander
!cmd/commander
release
dev.sh

tmp.yml
*.out
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/SimonBaeumer/commander

require (
github.com/SimonBaeumer/cmd v1.1.0
github.com/SimonBaeumer/cmd v1.2.1
github.com/antchfx/xmlquery v1.1.0
github.com/antchfx/xpath v1.1.0 // indirect
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/SimonBaeumer/cmd v1.1.0 h1:tr5dUMlly/8bLiC5B0J1AcE4ISru8POEfzAirWnUJnY=
github.com/SimonBaeumer/cmd v1.1.0/go.mod h1:4mc/LDXDWNbkeooqHP83yx3JXtInPHjJkF8zhzqqmZE=
github.com/SimonBaeumer/cmd v1.2.1 h1:NAhJp2ME68xZZJE4CVxOrNXStHdL77z1WF38OZFAQhM=
github.com/SimonBaeumer/cmd v1.2.1/go.mod h1:4mc/LDXDWNbkeooqHP83yx3JXtInPHjJkF8zhzqqmZE=
github.com/antchfx/jsonquery v1.0.0 h1:1Yhk496SrCoY6fJkFZqpXEqbwOw5sFtLns9la4NoK3I=
github.com/antchfx/jsonquery v1.0.0/go.mod h1:h7950pvPrUZzJIflNqsELgDQovTpPNa0rAHf8NwjegY=
github.com/antchfx/xmlquery v1.1.0 h1:vj0kZ1y3Q6my4AV+a9xbWrMYzubw+84zuiKgvfV8vb8=
Expand Down
1 change: 1 addition & 0 deletions pkg/output/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (w *OutputWriter) Start(results <-chan runtime.TestResult) bool {
failed++
s := w.addTries("✗ "+r.TestCase.Title, r)
w.fprintf(au.Red(s))
w.fprintf(r.TestCase.Result.Combined)
}
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type CommandResult struct {
Status ResultStatus
Stdout string
Stderr string
Combined string
ExitCode int
FailureProperties []string
Error error
Expand Down Expand Up @@ -197,6 +198,7 @@ func runTest(test TestCase) TestResult {
ExitCode: cut.ExitCode(),
Stdout: strings.TrimSpace(strings.Replace(cut.Stdout(), "\r\n", "\n", -1)),
Stderr: strings.TrimSpace(strings.Replace(cut.Stderr(), "\r\n", "\n", -1)),
Combined: strings.TrimSpace(strings.Replace(cut.Combined(), "\r\n", "\n", -1)),
}

log.Println("title: '"+test.Title+"'", " ExitCode: ", test.Result.ExitCode)
Expand Down
21 changes: 21 additions & 0 deletions vendor/github.com/SimonBaeumer/cmd/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 66 additions & 9 deletions vendor/github.com/SimonBaeumer/cmd/command.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions vendor/github.com/SimonBaeumer/cmd/multiplexed_writer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions vendor/github.com/SimonBaeumer/cmd/testing_utils.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# github.com/SimonBaeumer/cmd v1.1.0
# github.com/SimonBaeumer/cmd v1.2.1
github.com/SimonBaeumer/cmd
# github.com/antchfx/xmlquery v1.1.0
github.com/antchfx/xmlquery
Expand Down