Detecting ABQ
You may like to know whether a test suite is running in the presence of ABQ. For example, an exclusive resource, like a database that expects only one test process to connect to it, may need to be provisioned for each parallel test executor ABQ starts.
The best way to check for the presence of ABQ in your test process is to read
the ABQ_RUNNER
environment variable abq test
sets for each runner it starts.
For example,
abq test -n 2 -- bundle exec rspec
will start two RSpec runners locally, which will have ABQ_RUNNER=1
and
ABQ_RUNNER=2
configured in their environments, respectively.
The value of ABQ_RUNNER
is guaranteed to be unique for each runner started
under a single invocation of abq test
. It is not unique for runners between
different invocations of abq test
.