Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

bats_print_failed_command: Include $output if available. #101

Closed

Conversation

aluzzardi
Copy link

Checking $status right after a run seems to be a quite regular use case:

@test "run will fail" {
    run blahblah
    [[ "$status" -eq 0 ]]
}

With this change, the $output of run is included in case of failure, which makes debugging much easier:

 ✗ run will fail
   (in test file broken.bats, line 7)
     `[[ "$status" -eq 0 ]]' failed
     bats/libexec/bats-exec-test: line 58: blahblah: command not found

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
@aluzzardi
Copy link
Author

/cc @vieux @ehazlett

@vieux
Copy link

vieux commented May 5, 2015

Yes!

@vieux
Copy link

vieux commented May 5, 2015

LGTM

@ehazlett
Copy link

ehazlett commented May 5, 2015

Nice!

On Monday, May 4, 2015, Victor Vieux notifications@github.com wrote:

LGTM


Reply to this email directly or view it on GitHub
#101 (comment).

@miketheman
Copy link

👍 Applied this today locally, looks cool.

@kazurayam
Copy link

Definitely I need this merged

@vieux
Copy link

vieux commented Aug 18, 2015

Ping @sstephenson :)

@sameersbn
Copy link

👍

@jszwedko
Copy link

Bump @sstephenson

@ztombol
Copy link

ztombol commented Mar 24, 2016

Anyone who wants to get feedback when a test fails should take a look at the discussion in #110 and the libraries that resulted from it.

@mattyclarkson
Copy link

This so needs to be merged and released. It's impossible to understand why the test failed on a build server otherwise. @sstephenson

@ztombol ztombol mentioned this pull request Dec 13, 2016
18 tasks
@aluzzardi aluzzardi closed this Apr 6, 2017
@xmik
Copy link

xmik commented Apr 6, 2017

@aluzzardi was there a reason to close this? Is this PR perhaps merged into some official fork (in the context of #150)?

yarikoptic pushed a commit to neurodebian/bats that referenced this pull request Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants