Deep-dive on the Next Gen Platform. Join the Webinar!

Skip Navigation
Show nav
Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • 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
Hide categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Developer Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Working with Node.js
      • Troubleshooting Node.js Apps
      • Node.js Behavior in Heroku
    • Ruby
      • Rails Support
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • PHP Behavior in Heroku
      • Working with PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Working with AI
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
  • 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
  • Extending Heroku
  • Developing Buildpacks
  • Testpack API

Testpack API

English — 日本語に切り替える

Last updated February 16, 2025

Table of Contents

  • API
  • bin/test-compile
  • bin/test
  • Example testpacks

Testpacks are the scripts that power the “it just works” functionality of Heroku CI. A testpack supplements a buildpack with scripts that understand how to build, compile, and run tests.

This article is only applicable to apps that use classic buildpacks.

API

The Testpack API is a supplement to the Buildpack API. As such, this document covers only the additions to the Buildpack API to support Heroku CI. Any testpack implementation should also respect the rules, conventions, and styles set forth in the Buildpack API documentation.

A testpack consists of two scripts:

  • bin/test-compile: Used to transform application source code into a testable app.
  • bin/test: Runs the app’s tests.

bin/test-compile

Usage

bin/test-compile BUILD_DIR CACHE_DIR ENV_DIR

Summary

This script is similar to bin/compile, but instead of preparing source for deployment, it prepares source for testing. Commonly, bin/test-compile performs the same operations as bin/compile, but also installs test dependencies, and skips any productionization steps.

Please see the bin/compile documentation for usage, style, and examples.

bin/test

Usage

bin/test BUILD_DIR ENV_DIR

Summary

This script should run the application’s test suite. Most implementations will execute the same command a user would run locally to start a full test run.

Environment

This script will be executed with all .profile.d scripts and ENV_DIR entries already loaded and set as environment variables.

Exit code

Heroku CI will evaluate this script’s exit code to determine if the test run was a pass or failure. An exit code of 0 will indicate a successful test run; any other exit code will indicate a test failure.

Output

Heroku CI will evaluate this script’s output and attempt to parse test case passes and failures according to the Test Anything Protocol (TAP). If Heroku CI is able to detect TAP test passes and failures, the developer will experience an enhanced UI for viewing test runs. Output in TAP format is not mandatory to implement a testpack, though it is desirable.

Example testpacks

The easiest way to get started with a testpack may be to look at existing implementations. Here are a few buildpacks that have implemented the Testpack API:

  • Heroku Go Buildpack
  • Heroku Node.js Buildpack

Keep reading

  • Developing Buildpacks

Feedback

Log in to submit feedback.

Information & Support

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

Language Reference

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

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices