Skip to content

allow to redefine root directory, merge suites and report to external systems #13

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

Closed
wants to merge 5 commits into from

Conversation

albfan
Copy link

@albfan albfan commented Oct 11, 2015

Mimic behaviour of simplecov to allow bashcov to produce output on a directory different from current dir.

See it working here.

https://github.com/albfan/git-ignore/blob/master/.travis.yml

git-ignore is test with sharness, which creates a sandbox for every test group.

A way to configure bashcov is wanted too. See the hack on every test to read .simplecov

https://github.com/albfan/git-ignore/blob/master/t/t0001-exclude.sh#L11

Using test suites based on sandbox, allow to define command name to
avoid clobber results.

For detailed report, allow to rename coverage dir.
Mimic merge feature from simplecov
@albfan albfan changed the title allow to redefine root directory allow to redefine root directory, merge suites and report to external systems Oct 12, 2015
@albfan
Copy link
Author

albfan commented Oct 12, 2015

All this stuff is working

https://coveralls.io/github/albfan/git-ignore
https://codecov.io/github/albfan/git-ignore

Let's cover new features to pass bashcov filters!

@albfan albfan force-pushed the master branch 11 times, most recently from d63ba92 to 8832b69 Compare October 12, 2015 13:04
@albfan albfan force-pushed the master branch 4 times, most recently from 7958fa7 to bb546f9 Compare October 12, 2015 14:26
construct like

    cat <<EOF
     a large amount of text
         with complex indentation
     and variable resolution $HOME
    EOF

are ignored by xtrace output. Detect those lines
@albfan
Copy link
Author

albfan commented Oct 12, 2015

Code coverage fails to show 100% with

Warning: spec/test_app/tmp.sh was executed but has been deleted since then - it won't be reported in coverage.

I suppose is something related with a timeout or the like

formatters.push(r[:formatter].split("::").inject(Object) { |a, e| a.const_get e })
end
SimpleCov.formatters = formatters
end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to reimplement that in Bashcov. I just tried this and it builds fine on Travis. However it doesn't seem to push coverage results even with your original code. So I must have misconfigured Coveralls somehow. Could you try something along the lines of this in your own repo and see if that works?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think #13 (diff) redefine all formatters. That's why for example doesn't work. If it's possible I would like to have both approach. git-ignore needs .simplecov because of use of test suite sharness, but in general people should use bashcov as another bash script. Anyway, I can keep this on my own fork till it's mature. I understand your are reluctant to add this

@albfan
Copy link
Author

albfan commented Oct 24, 2015

Cool. I have basic skills on ruby, but will apply all your comments.

See the plugin style report is working and I took the license to suggest bashcov to be the tool to create reports on the cloud to codecov, coveralls and codeclimate

This is a repo codecov creates to show people how to support bash coverage (they insist to use python codecov, let's see if we can change his mind)

https://github.com/codecov/example-bash/issues/1

This is a repo pushing coverage reports to all of those systems
https://github.com/albfan/git-ignore/blob/master/.travis.yml#L7

codeclimate is not working yet.

@infertux
Copy link
Owner

Sounds great @albfan - thanks for your efforts. Please let me know if you need help. I'll take another look into this too when I get a moment.

@infertux
Copy link
Owner

infertux commented Oct 8, 2016

Looks like everything is available to do this now:

  • redefine root directory: use bashcov --root=...
  • merge suites and report to external systems: can be done via SimpleCov.formatters = [...]

Please reopen if not.

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

Successfully merging this pull request may close these issues.

2 participants