Coder Social home page Coder Social logo

codeclimate-coverage-buildkite-plugin's Introduction

Codeclimate Coverage Buildkite Plugin

This is a Buildkite plugin for Codeclimate coverage reporting. It adds pre-command and post-command hooks that use Codeclimate's test reporter to submit code coverage reports to Codeclimate.

To use this plugin you need to:

  • Setup a code coverage tool for your project. For example, if you're working on a Ruby/Rails project, you can use SimpleCov.
  • Setup a Codeclimate account, and add your repository to Codeclimate
  • Get the test reporter id for your repo (https://docs.codeclimate.com/docs/finding-your-test-coverage-token), and set it as the env var CC_TEST_REPORTER_ID on your Buildkite pipeline

Then configure your buildkite pipeline for parallel or non-parallel test steps:

Non-Parallel

  1. Add codeclimate-coverage plugin to your test step.

You're test step should look something like this:

- name: 'Test'
  command: '.buildkite/test'
  plugins:
    docker-compose#v2.4.1:
      run: web
      env:
        # Used by code coverage
        - BUILDKITE_BRANCH
        - BUILDKITE_COMMIT
        - CC_TEST_REPORTER_ID
    taylorzr/codeclimate-coverage#v0.1.0: ~

Parallel

  1. Add coverage to your artifact_paths
  2. Add codeclimate-coverage plugin to your test step
  3. Add a new step to sum and upload the aggregate coverage report

You're pipeline should look something like this:

  - name: 'Test'
    command: '.buildkite/test'
    artifact_paths:
      - "coverage/codeclimate_coverage_*.json"
    parallelism: 2
    plugins:
      docker-compose#v2.4.1:
        run: web
        env:
          # Used by code coverage
          - BUILDKITE_BRANCH
          - BUILDKITE_COMMIT
          - CC_TEST_REPORTER_ID
      taylorzr/codeclimate-coverage#v0.1.0:
        prefix: '/usr/src/app'

  - name: ':codeclimate: Upload'
    command: 'echo +++ :codeclimate:'
    plugins:
      taylorzr/codeclimate-coverage#v0.1.0: ~
        sum_and_upload: true
        prefix: '/usr/src/app'

TODO:

  • document, explain, and test prefix config
  • document and test reporter url config
  • document debug config
  • document caveats
    • must mount local dir when using docker-compose
    • must pass through env variables

codeclimate-coverage-buildkite-plugin's People

Contributors

taylorzr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.