https://github.com/funbox/simplecov-bitbucket-server
Uploads test coverage data to Bitbucket Server via Code Coverage plugin
https://github.com/funbox/simplecov-bitbucket-server
Last synced: 12 months ago
JSON representation
Uploads test coverage data to Bitbucket Server via Code Coverage plugin
- Host: GitHub
- URL: https://github.com/funbox/simplecov-bitbucket-server
- Owner: funbox
- License: mit
- Created: 2021-03-09T15:41:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-04T10:24:21.000Z (about 5 years ago)
- Last Synced: 2025-06-29T08:02:47.584Z (12 months ago)
- Language: Ruby
- Size: 12.7 KB
- Stars: 4
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# SimpleCov to Bitbucket Server
[](https://rubygems.org/gems/simplecov-bitbucket-server)
[](https://travis-ci.com/github/funbox/simplecov-bitbucket-server)
[](https://coveralls.io/github/funbox/simplecov-bitbucket-server)
A [SimpleCov](https://rubygems.org/gems/simplecov) formatter that uploads coverage data to a Bitbucket Server instance via [Code Coverage](https://marketplace.atlassian.com/apps/1218271/code-coverage-for-bitbucket-server) plugin.
## Installation
```ruby
# Gemfile
group :test do
gem 'simplecov-bitbucket-server', '~> 1.0'
end
# spec/spec_helper.rb
require 'simplecov/formatter/bitbucket_server'
SimpleCov.formatter = SimpleCov::Formatter::BitbucketServer.new('https://your.bitbucket.host')
```
## Usage
Run your test suite as usual. At the end SimpleCov will run the formatter. The formatter will post data to the server.
### Commit SHA
Coverage data is uploaded for a certain commit. This commit is the tip of the branch from which the pull request is created. The formatter takes the commit SHA from an environment variable called `GIT_COMMIT` (set by Jenkins).
If you need to pass the commit SHA from some other source, pass it as the second argument to the formatter's constructor. For example:
```ruby
commit = ENV['TRAVIS_COMMIT']
SimpleCov.formatter = SimpleCov::Formatter::BitbucketServer.new('https://your.bitbucket.host', commit)
```
[](https://funbox.ru)