OpenCov is a self-hosted opensource test coverage history viewer. It is (mostly) compatible with coveralls, so most coverage tools will work easily.
A demo is available at http://demo.opencov.com, you can create an account or login with
- username: [email protected]
- password: password123
For "security" reasons, the user is not admin. NOTE: the demo is on a Heroku free dyno, so it may not always be available and might be very slow.
First, you will need to at least setup a database
To configure the app, create a local.exs
file and override the configuration you need.
Check config/local.sample.exs to see the available configurations.
If you already have a database to use, you can simply start the application using docker:
$ docker run -v /absolute/path/to/local.exs:/opencov/config/local.exs tuvistavie/opencov mix ecto.setup
$ docker run -v /absolute/path/to/local.exs:/opencov/config/local.exs tuvistavie/opencov mix phoenix.server
This will start the server on the port you set in local.exs
.
If you do not have a database, you can start one with docker
and docker-compose
. See docker-compose.yml for a sample docker-compose.yml
file.
Once you have your docker-compose.yml
and local.exs
ready, you can run
$ docker-compose run opencov mix ecto.setup
$ docker-compose up
$ git clone https://github.com/tuvistavie/opencov.git
$ cd opencov
$ cp /path/to/local.exs config/local.exs # local.exs must be in the `config` directory of the app
$ npm install # (or yarn install)
$ mix deps.get
$ mix ecto.setup
$ mix phoenix.server
This should start OpenCov at port 4000.
If you want to setup the server for production, you will need to run the above commands
with MIX_ENV=prod
and to run
$ mix assets.compile
before starting the server.
You should also be able to deploy to Heroku by simply git pushing this repository.
You will need to set the following environment variables using heroku config:set
OPENCOV_PORT
OPENCOV_SCHEME
SECRET_KEY_BASE
SMTP_USER
SMTP_PASSWORD
You will need to run
$ heroku run mix ecto.setup
before you can use your application.
In all setups, mix ecto.setup
creates the following admin user
- email: [email protected]
- password: p4ssw0rd
You should use it for your first login and the change the email and password.
A few languages are documented in the wiki. For other languages, coveralls instructions should work out of the box, you just need to set the URL to your OpenCov server and to explicitly set the token, even when using Travis.
The application is more or less stable. I have been using it for a little while now with coverage data from the 4 languages in the Wiki.
The main missing feature is the ability to send coverage status on pull requests. The implementation is started in the integrations branch but I could not find the time to finish it yet.
I am open to any other suggestions, and help is very welcome.