-
Notifications
You must be signed in to change notification settings - Fork 11
Update repo for Crystal 1+ and document how to run the tests; maybe add an example shard that uses it #17
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
Comments
See also chat in forum: https://forum.crystal-lang.org/t/code-coverage-shard-for-crystal/3380/2 |
Hi @drhuffman12! I opened a PR that will fix this. Please take a look: #18 |
@lbguilherme , I might need some help with this. Maybe beef up the doc's a bit more or point me to the right doc location? I tried the following:
|
I'm using it like this: From your project modify development_dependencies:
coverage:
github: lbguilherme/crystal-coverage Install with:
Then run specs with coverage using:
|
@lbguilherme , Thanks! This looks much better! :) I'd call this issue basically 'done'! Oh, as for the "add docs" and "example shard that uses it" parts, I can move those to a separate issue(s). Feel free to pull in parts/all of my https://github.com/drhuffman12/crystal-coverage-example repo as an example. Otherwise, feel free to close this issue. :) I tried that in an example repo (drhuffman12#1), without adding any code other than updating the shards. (I did have to remove the I think you can mark this issue as 'fixed' and close it:
For example, for my example repo with just a couple spec files (drhuffman12/crystal-coverage-example#1), if I run...
|
I tried forking and updating/fixing this repo, but am having issues. What am I missing?
Please add to the doc's re running the tests (and update the repo to work with Crystal 1+). I think the coverage process is not counting the lines that the specs are actually covering.
For details, see below...
I see
spec/run.sh
which includes:I had errors when running that. First,
ameba
needed to be switched fromveelenga/ameba
tocrystal-ameba/ameba
.The next error was:
I chased down that issue and some others in a fork/branch (drhuffman12#1) and I seemed to get the scripts to work eventially. I added an example shard (drhuffman12/crystal-coverage-example#1) using my fork. I had mixed success.
In my example shard, I tried running the coverage script via:
lib/coverage/bin/crystal-coverage src/**/*.cr
lib/coverage/bin/crystal-coverage spec/**/*_spec.cr
It looks like the coverage calculations/process is broken; it runs and generates the web pages but no tests seem to get logged as line coverages. Maybe I'm doing something wrong? In my example shard, I put in two duplicate classes (only diff by class name) and added more tests for one class than the other. However, the coverage for both is identical and the method that I added a test for isn't showing any code coverage:
Tests added for some
Bar
methods...... But, these test's don't seem to register with the coverage script:
The text was updated successfully, but these errors were encountered: