DEV Community

Cover image for Paralleling Code Coverage using Coveralls and Travis
Montana Mendy
Montana Mendy

Posted on

1

Paralleling Code Coverage using Coveralls and Travis

Hey developer friends,

A short one today -- but an important one.

Let's say you have multiple environments you want to have coverage, first let's enable Coveralls for your repo, so if you haven't done so yet -- head over to coveralls.io and Auth the Coveralls app to up your GitHub account, and then sync your repos with Coveralls.

You'll want to have a .travis.yml file that looks similar to mine:

sudo: false
language: node_js
node_js:
  - "node"
env:
  global:
    - COVERALLS_PARALLEL=true
jobs:
  include:
    - script: COVERALLS_FLAG_NAME=test-1 make test-coveralls-1
    - script: COVERALLS_FLAG_NAME=test-2 make test-coveralls-2
notifications:
  webhooks: https://coveralls.io/webhook
Enter fullscreen mode Exit fullscreen mode

You'll see we are running multiple COVERALLS_FLAG_NAME, this is using the Coveralls webhook to parallelize your coverage. If at first you don't see Coveralls covering your code, you may want to add your env var from Coveralls to Travis CI and name it something like COVERALLS_TOKEN.

Image description

Here's my repo so you can follow step by step! https://github.com/Montana/coveralls-node-travis

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay