Project

starspec

0.0
No release in over 3 years
Parallel RSpec runner for I/O-bound Rails suites using threaded Actors with per-Actor database connections
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

starspec

Parallel RSpec runner for I/O-bound Rails suites. Runs specs concurrently across threaded Actors, each with its own ActiveRecord Connection, relying on PostgreSQL's native MVCC for test isolation. No forking, no per-worker Rails boot, no per-worker test database.

Status: pre-alpha. Design and validation planning complete; implementation in progress.

How it differs

  • One process, N Actors. Actors are Ruby threads, each running examples in a transaction that rolls back at the end. PG handles cross-Actor isolation natively.
  • SystemTests supported in parallel. A cookie-based ActorContext transport lets the PumaRequestThread handling a Capybara request borrow the originating Actor's Connection, so the test sees its own uncommitted writes across the thread boundary. The mechanism generalizes to other transports (Sidekiq, ActiveJob, ActionCable) via pluggable adapters.
  • Small, targeted monkey-patch. ~10 lines prepending a module onto ActiveRecord::ConnectionAdapters::ConnectionPool. No pin_connection!, no fight with teardown_fixtures.

Docs

  • docs/DESIGN.md — authoritative design (Actor pattern, ConnectionBorrowing, ActorContext, cookie transport, scope boundaries).
  • docs/GLOSSARY.md — precise terminology (TestProcess, Actor, Connection, PumaRequestThread, etc.).
  • docs/investigation/ — notes from the spike investigation that produced the current design.

Installation

bundle add starspec

or

gem install starspec

Usage

TODO.

Development

bin/setup          # install dependencies
bundle exec rspec  # run the gem's own specs
rake build         # build .gem into pkg/

License

MIT. See LICENSE.txt.