Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Background Jobs in Python
      • Working with Django
    • Java
      • Working with Maven
      • Java Database Operations
      • Java Advanced Topics
      • Working with Spring Boot
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Continuous Delivery
  • Continuous Integration
  • Heroku CI Parallel Test Runs

Heroku CI Parallel Test Runs

English — 日本語に切り替える

Last updated July 15, 2022

Table of Contents

  • Quick Start
  • Parallelizing Your Test Suite
  • Databases in Parallel Test Runs

Heroku CI supports distributing test runs across up to 32 dynos to substanially reduce execution time.

Heroku CI parallel test runs UI

Quick Start

Specify test run parallelism in your app’s app.json file, under the formation key:

{
  "environments": {
    "test": {
      "formation": {
        "test": {
          "quantity": 32
        }
      }
    }
  }
}

This configuration launches 32 test dynos per test run.

Parallelizing Your Test Suite

Heroku CI exposes the following environment variables to dynos that are part of a parallel test run:

  • CI_NODE_TOTAL: The total number dynos in the test run
  • CI_NODE_INDEX: The index of this dyno in the test run (zero-indexed)

Use these values to specify to your parallel test runner which tests it should run on each dyno.

Test Runners

Test runners that support parallel execution include (but are not limited to):

Ruby

  • ci_queue
  • knapsack gem or the Knapsack Pro add-on

Javascript

  • Knapsack Pro

Ember.js

  • ember-exam

Databases in Parallel Test Runs

Dynos in a parallel test run share the same instance of any databases (and other add-ons) provisioned for the test run. This means that a Heroku Postgres instance might be shared between up to 32 dynos.

Many testing frameworks expect to have exclusive access to databases. If this is the case for your testing framework, your test runs can provision special in-dyno plans for Heroku Postgres and Heroku Data for Redis. Modify the plans for these add-ons in your app.json file like so:

{
  "addons": [
    "heroku-postgresql:in-dyno",
    "heroku-redis:in-dyno"
  ]
}

Postgres extensions are currently limited by the in-dyno Heroku Postgres plan. See supported extensions

Keep reading

  • Continuous Integration

Feedback

Log in to submit feedback.

Heroku CI: Technical Detail on Test Run Lifecycle Heroku CI: Technical Detail on Test Run Lifecycle

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences