development:
  encoding: utf8
  adapter: mysql2
  database: whitehall_development
  username: whitehall
  password: whitehall
  url: <%= ENV["DATABASE_URL"] %>

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &test
  encoding: utf8
  adapter: mysql2
  database: whitehall_test<%= "_executor_#{ENV['EXECUTOR_NUMBER']}_" if ENV['EXECUTOR_NUMBER']%><%= ENV['TEST_ENV_NUMBER'] %>
  username: whitehall
  password: whitehall
  url: <%= ENV["TEST_DATABASE_URL"] %>

benchmark:
  encoding: utf8
  adapter: mysql2
  database: whitehall_development
  username: whitehall
  password: whitehall

production:
  encoding: utf8
  adapter: mysql2
  database: whitehall_production
  pool: 10

cucumber:
  <<: *test

development:
  encoding: utf8
  adapter: mysql2
  database: whitehall_development
  username: whitehall
  password: whitehall
  url: <%= ENV["DATABASE_URL"] %>

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &test
  encoding: utf8
  adapter: mysql2
  database: whitehall_test<%= "_executor_#{ENV['EXECUTOR_NUMBER']}_" if ENV['EXECUTOR_NUMBER']%><%= ENV['TEST_ENV_NUMBER'] %>
  username: whitehall
  password: whitehall
  url: <%= ENV["TEST_DATABASE_URL"] %><%= ENV['TEST_ENV_NUMBER'] if ENV["TEST_DATABASE_URL"] %>

benchmark:
  encoding: utf8
  adapter: mysql2
  database: whitehall_development
  username: whitehall
  password: whitehall

production:
  encoding: utf8
  adapter: mysql2
  database: whitehall_production
  pool: 10

cucumber:
  <<: *test

Allow parallel tests in govuk-docker
Allow parallel tests in govuk-docker

govuk-docker uses a DB url environment variable to set the db which
means it doesn't include the number for running parallel tests. By
applying this environment variable at the end of the URL string we can
achieve the same with a DB environment variable.

This is a bit of a hack as this relies on the URL ending with the db
name (for example: mysql2://root:root@mysql/whitehall_test), were we to
use a query string to apply any options this would stop working. To fix
this would require parsing the URL and modifying the path which would be
a bit of a hassle. It seems somewhat unlikely that this'll change in
config anytime soon so I think it'll do for now.
