Our documentation is still under construction, please reach out to chat support in the bottom right corner if your queries cannot be answered here.

Getting Started

Hi and thanks for exploring our documentation! We are excited to welcome you to OtterWise and shipping healthier code.

We are building out the articles, so if you are struggling to find something here, please come back later or reach out to us on [email protected] :)

Introduction

OtterWise is a full-suite code quality reporting platform. You can track many different metrics such as code coverage, test coverage, per-test runtime, mutation coverage, complexity and much more.

Creating your account

First step to using OtterWise is creating an account. This is free, and as long as you use public repositories only, its free forever, no credit card required (private repositories are subject to a paid plan).

  1. Authenticate with GitHub: Currently we support GitHub as a source code provider, you can register by clicking here
  2. Enable Organizations: By default, we will enable your own GitHub profile to use in OtterWise. If you are working in an organization (and have the privileges to manage it), you can enable more repositories while following our onboarding guide. You can also click here to enable more organizations (this requires you to be logged in). Screenshot from GitHub showing organization selector

Enabling your Repository

  1. Enable Organizations: Navigate to the list of repositories for your organization, switch to "Not enabled" and search for the repository you want to enable. Now flip the switch at the right-most side. Video from OtterWise showing user enabling a repository
  2. Find repository token: Click on the See Setup Instructions link, or head to your repository settings page and find the repository token. This will be used for the build script later.

Modify build scripts

It is recommended to follow the "See setup instructions" link provided from the Enabling your Repository step, however below are some general instructions.

  1. Install coverage extension: For PHP and other languages, you must install a coverage or debugging extension such as xdebug or pcov (for php). This can generally be done by running a command such as the one below, as part of your build script.
    sudo phpenmod pcov
  2. Output coverage data: For language specific instructions please follow the setup instructions for your repository, or see the other documentation pages. Here is an example for PHP.
    phpunit --coverage-clover=build/logs/clover.xml
  3. Upload coverage data: As the last part of your build steps you should upload the generated data, this can be done as so. The repository token can be found under your repository settings page inside OtterWise.
    bash <(curl -s https://raw.githubusercontent.com/getOtterWise/bash-uploader/main/uploader.sh) --repo-token [your repository token]

Next steps

When builds successfully run, coverage data will be uploaded and you will start seeing per-file metrics as well as reporting over time such as how your code coverage improves with time, and which pull requests contribute to it. Screenshot from OtterWise showing repository coverage data

Now it is recommended to configure Pull Request comments, status checks and more to prevent bad code making it to production again. This can be configured per repository to trigger a failure if your coverage drops and such.

We also offer more metrics you can track, such as Type Coverage. Here you can learn how to track type coverage metrics, which is a great step towards an even healthier code-base.