Maintaining a well-tested codebase is mission-critical. apexcov
generates public Apex test coverage reports for your Force.com open-source projects.
$ go get -u github.com/jpmonette/apexcov
To generate your test coverage report:
$ apexcov --username="jpmonette@example.com" --password="my-password"
You can shorten the command by setting the global options as environment variables:
APEXCOV_INSTANCE
: Salesforce instance URLAPEXCOV_USERNAME
: Account usernameAPEXCOV_PASSWORD
: Account password
Add this to your .travis.yml
:
env:
- GOPATH=$HOME/go PATH=$GOPATH/bin:$PATH
before_script:
- npm install -g coveralls
- go get github.com/jpmonette/apexcov
script:
- apexcov
- codeclimate-test-reporter < ./coverage/lcov.info
(make sure you set your COVERALLS_REPO_TOKEN
environment variable)
Add this to your circle.yml
:
machine:
pre:
- npm install -g coveralls
- go get -u github.com/jpmonette/apexcov
test:
post:
- apexcov
- cat ./coverage/lcov.info | coveralls
Add this to your .travis.yml
:
env:
- GOPATH=$HOME/go PATH=$GOPATH/bin:$PATH
- CC_TEST_REPORTER_ID=YOUR_CODE_CLIMATE_REPORTER_ID
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- go get github.com/jpmonette/apexcov
- ./cc-test-reporter before-build
script:
- apexcov
- ./cc-test-reporter format-coverage -t lcov ./coverage/lcov.info
- ./cc-test-reporter upload-coverage
Add this to your circle.yml
:
machine:
pre:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- go get -u github.com/jpmonette/apexcov
test:
post:
- apexcov
- ./cc-test-reporter format-coverage -t lcov ./coverage/lcov.info
- ./cc-test-reporter upload-coverage
(make sure you set your CC_TEST_REPORTER_ID
environment variable)
Add this to your .circleci/config.yml
:
build:
environment:
CC_TEST_REPORTER_ID: YOUR_CODE_CLIMATE_REPORTER_ID
steps:
- go get -u github.com/jpmonette/apexcov
- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- run: chmod +x ./cc-test-reporter
- apexcov
- ./cc-test-reporter format-coverage -t lcov ./coverage/lcov.info
- ./cc-test-reporter upload-coverage
NAME:
apexcov - a Test Coverage Generator for Apex
USAGE:
apexcov [global options] command [command options] [arguments...]
VERSION:
1.0.0
AUTHOR:
Jean-Philippe Monette <contact@jpmonette.net>
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--instance value Salesforce instance to use (default: "https://login.salesforce.com")
--username value Username of the Salesforge org
--password value Password of the Salesforge org
--help, -h show help
--version, -v print the version
This application is distributed under the MIT license found in the LICENSE file.