-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Usage with BATS #302
Comments
Thanks for the help. I've had success now inside of a docker container, obviously I messed up and ran kcov as root and missed that point. However, on my Arch workstation, it still doesn't work despite running as an unprivileged user. |
OK, are the symptoms the same in Arch and in the container? |
According to this problem, The bats (and successor bats-core) captures stdout and stderr at once (see sstephenson/bats#180). The target script that run by bats output trace data to stderr, but trace data absorbed by bats. Therefore kcov cannot get trace data, I think. This issue fixed in kcov v37. |
hi @SimonKagstrom , I have been encountering issues when trying to run kcov(v38) with bats(v1.3.0) with GNU bash, version 5.0.18(1)-release (x86_64-apple-darwin19.5.0). The command I am trying to run is: In one configuration of the commands, I have managed to get the kcov to measure the coverage of the bats source files instead of the bash file mentioned in this issue - bats-core/bats-core#15 |
@ivopieniak that sounds more like a permission issue, are you able to write to the coverage/-directory? The "Can't write helper" means that a generated file cannot be placed in the output directory. It looks like it's being run from /usr/local, maybe you could try to run it with the output being placed somewhere else, e.g.,
so that output is placed on a location where (I think) you should be able to write. |
Hi, just passing by searching for other issues, and found this old-ish one about bats + kcov. Our repository is not public at the moment, but we are happily using kcov + bats with no issues. Tested wit:
The command we use to run is something similar to this: $ docker run --rm -it -v "${PWD}:/code" workflow:latest \
/usr/local/bin/kcov --include-path=./ ./coverage/ \
/usr/local/bin/bats --verbose-run --recursive ./ On Ubuntu it uses my local user. In the container (in CICD) we use |
Thanks for the report @kinow! I don't use bats myself (almost only using kcov for compiled code), so I have a hard time helping with these issues. Good that the docker image is tested as well, although I note that the version reported there is slightly old. Closing, since it should at least be possible to get working as per @Kinows report. |
I tried using this with BATS (and so has the BATS team), but it doesn't seem to work with current versions.
See details here: bats-core/bats-core#15
Perhaps you can shed some light on this?
The text was updated successfully, but these errors were encountered: