This repository contains the release for RabbitMQ for Cloud Foundry. It is deployable by BOSH in the usual way.
This release is now using BOSH v2 job links and cloud config and requires at least BOSH Director v255.5
-
phantomjs: In order to run the integration tests you need to have
phantomjs
available in the$PATH
.phantomjs
is required bycapybara
at runtime.
Clone the repository and run ./scripts/update-release
to update submodules and install dependencies.
Once you have a BOSH Lite up and running locally, run scripts/deploy-to-bosh-lite
.
To deploy the release into BOSH you will need a deployment manifest. You can generate a deployment manifest using the following command:
alias boshgo=bosh # This is just to make pcf-rabbitmq tile team's life simpler
boshgo interpolate \
--vars-file=manifests/lite-vars-file.yml \
--var=director-uuid=$(bosh status --uuid) \
manifests/cf-rabbitmq-server-only-template.yml > manifests/cf-rabbitmq.yml
To run all the tests do bundle exec rake spec
.
To run only unit tests locally, run: bundle exec rake spec:unit
.
Sometimes testing BOSH releases can lead to writing many tests at the top of the test pyramid, which can increase the feedback loop. Also when tests fail the analysis can become complicated since there are many components working together. Embedded release tests are jobs that we deploy in a colocated way so that we can execute tests within a deployment, inside a VM. The goal is to pull tests down the test pyramid trying to shorten the feedback loop and bring the tests closer to the code.
To execute embedded release tests you need to colocate the tests within the release being tested and deploy. The deployment should fail if the tests fail.
boshgo interpolate \
--ops-file=manifests/add-rmq-server-tests.yml \
--vars-file=manifests/lite-vars-file.yml \
--var=director-uuid=$(bosh status --uuid) \
manifests/cf-rabbitmq-server-only-template.yml > manifests/cf-rabbitmq.yml
bosh deployment manifests/cf-rabbitmq.yml
bosh deploy
Integration tests require this release to be deployed into a BOSH director (see Deploying section above).
To run integration tests do bundle exec rake spec:integration
.
Use SKIP_SYSLOG=true bundle exec rake spec:integration
to skip syslog tests if you don't have PAPERTRAIL_TOKEN
and PAPERTRAIL_GROUP_ID
environment variables configured.
For testing with syslog, remove the SKIP_SYSLOG
environment variable from the command line and generate and deploy a new manifest with syslog:
boshgo interpolate \
--ops-file=manifests/add-syslog-release.yml \
--vars-file=manifests/lite-vars-file.yml \
--var=director-uuid=$(bosh status --uuid) \
manifests/cf-rabbitmq-server-only-template.yml > manifests/cf-rabbitmq.yml
System tests require this release to be deployed colocated within the multitenant-broker release.
Ensure you have deployed the release to BOSH Lite (see Deploying section above).
Use the bosh command below to create a manifest with cf-rabbitmq and multitenant-broker.
boshgo interpolate \
--vars-file=manifests/lite-vars-file.yml \
--vars-file=manifests/lite-multitenant-broker-vars-file.yml \
--var=director-uuid=$(bosh status --uuid) \
manifests/cf-rabbitmq-colocated-with-multitenant-broker-template.yml > manifests/cf-rabbitmq.yml
To run the system tests do bundle exec rake spec:system
If you want to run tests on custom BOSH you need to set following environment variables: