1. Resources
  2. /
  3. Examples
  4. /
  5. Rails Parallel

Buildkite Rails Parallel Pipeline Example

This repository is an example Buildkite pipeline that demonstrates how to run 20 parallel test jobs for a Rails application using rbenv and Knapsack.

See the full Getting Started Guide for step-by-step instructions on how to get this running.

Screenshot of Buildkite Rails Parallel example pipeline

How it works

This repository doesn’t include a Rails application, but it does provide the CI setup you’d typically use in a real project.

In the pipeline configuration file the parallelism property for the test step is set to 20. When a build, the step will appear 20 times in the pipeline, each with different environment variables exposed so you can divvy up your test suite accordingly. You can then run 20 agents (on the same machine, or distributed) to work on the 20 jobs in parallel.

This example:

  • Uses rbenv to manage Ruby versions
  • Runs tests in parallel using Buildkite’s parallelism feature
  • Leverages Knapsack for test suite splitting
  • Can be used on a single machine or distributed across multiple agents

Key files:

Parallel test execution

The test step in pipeline.yml is configured like this:

steps:
  - name: ":rspec:"
    command: "scripts/ci/setup.sh && scripts/ci/parallel_specs.sh"
    parallelism: 20

Each parallel job receives unique environment variables (BUILDKITE_PARALLEL_JOB, BUILDKITE_PARALLEL_JOB_COUNT) to help split the workload.

See the parallelizing builds guide for more information to create parallelized and distributed builds with Buildkite.

💡 Want to use Docker? Try the Rails Docker Parallel Example

Knapsack Pro

Consult the Knapsack documentation for configuring your database and dependent services to support running parallel steps on the one machine.

See Knapsack Pro version of this example pipeline for how to perform dynamic splits/allocation of test nodes.

License

See LICENSE.md (MIT)

More examples

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Public pipelines
  3. Test Engine
  4. Package Registries
  5. Mobile Delivery Cloud
  6. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Example pipelines
  5. Plugins
  6. Webinars
  7. Case studies
  8. Events
  9. Migration Services
  10. Comparisons

Company

  1. About
  2. Careers
  3. Press
  4. Brand assets
  5. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2025