Search code examples
dockerrabbitmqcontinuous-integrationgitlab-ci

Gitlab integration of RabbitMQ as a service


I'm trying to have a Gitlab setup where I integrate different services because I have a nodejs app and I would like to do integration testings with services like RabbitMQ, Cassandra, etc.

Question + Description of the problem + Possible Solution

Does someone know how to : write the Gitlab configuration file (.gitlab-ci.yml) to integrate RabbitMQ as a service, where I define a configuration file to create specific virtualhosts, exchanges, queues and users ?

So a section in my .gitlab-ci.yml I defined a variable which should point to the rabbitmq.config file like specified in the official documentation (https://www.rabbitmq.com/configure.html#config-location) but this does not work.

...
 services:
  # - cassandra:3.11
  - rabbitmq:management
 variables:
  RABBITMQ_CONF_FILE : rabbitmq.conf
...

File I need to point to in my Gitlab configuration : rabbitmq.conf

In this file I want to specify a file rabbitmq-definition.json containing my specific virtualhosts, exchanges, queues and users for RabbitMQ.

[
   {rabbit, [
      {loopback_users, []},
      {vm_memory_high_watermark, 0.7},
      {vm_memory_high_watermark_paging_ratio, 0.8},
      {log_levels, [{channel, warning}, {connection, warning}, {federation, warning}, {mirroring, info}]},
      {heartbeat, 10}
    ]},
    {rabbitmq_management, [
        {load_definitions, "./rabbitmq-definition.json"}
    ]}
].

File containing my RabbitMQ configuration :rabbitmq-definition.json

{
    "rabbit_version": "3.8.9",
    "rabbitmq_version": "3.8.9",
    "product_name": "RabbitMQ",
    "product_version": "3.8.9",
    "users": [
        {
            "name": "guest",
            "password_hash": "9OhzGMQqiSCStw2uosywVW2mm95V/I6zLoeOIuVZZm8yFqAV",
            "hashing_algorithm": "rabbit_password_hashing_sha256",
            "tags": "administrator"
        },
        {
            "name": "test",
            "password_hash": "4LWHqT8/KZN8EHa1utXAknONOCjRTZKNoUGdcP3PfG0ljM7L",
            "hashing_algorithm": "rabbit_password_hashing_sha256",
            "tags": "management"
        }
    ],
    "vhosts": [
        {
            "name": "my_virtualhost"
        },
        {
            "name": "/"
        }
    ],
    "permissions": [
        {
            "user": "guest",
            "vhost": "/",
            "configure": ".*",
            "write": ".*",
            "read": ".*"
        },
        {
            "user": "guest",
            "vhost": "my_virtualhost",
            "configure": ".*",
            "write": ".*",
            "read": ".*"
        },
        {
            "user": "test",
            "vhost": "my_virtualhost",
            "configure": "^(my).*",
            "write": "^(my).*",
            "read": "^(my).*"
        }
    ],
    "topic_permissions": [],
    "parameters": [],   
    "policies": [],
    "queues": [
        {
            "name": "my_queue",
            "vhost": "my_virtualhost",
            "durable": true,
            "auto_delete": false,
            "arguments": {}
        }
    ],
    "exchanges": [
        {
            "name": "my_exchange",
            "vhost": "my_virtualhost",
            "type": "topic",
            "durable": true,
            "auto_delete": false,
            "internal": false,
            "arguments": {}
        },
        {
            "name": "my_exchange",
            "vhost": "/",
            "type": "direct",
            "durable": true,
            "auto_delete": false,
            "internal": false,
            "arguments": {}
        }
    ],
    "bindings": [
        {
            "source": "my_exchange",
            "vhost": "my_virtualhost",
            "destination": "my_queue",
            "destination_type": "queue",
            "routing_key": "test.test.*.1",
            "arguments": {}
        }
    ]
}

Existing Setup

Existing file .gitlab-ci.yml:

#image: node:latest
image: node:12

cache:
  paths:
  - node_modules/

stages:
  - install
  - test
  - build
  - deploy
  - security
  - leanix

variables:
  NODE_ENV: "CI"
  ENO_ENV: "CI"
  LOG_FOLDER: "."
  LOG_FILE: "queries.log"

.caching:
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
      - node_modules/
    policy: pull

before_script:
  - npm ci --cache .npm --prefer-offline --no-audit

#install_dependencies:
#  stage: install
#  script:
#    - npm install --no-audit
#  only:
#    changes:
#      - package-lock.json

# test:quality:
#   stage: test
#   allow_failure: true  
#   script:
#     - npx eslint --format table . 

# test:unit:
#   stage: test
#   script:
#     - npm run test
#   coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
#   artifacts:
#     reports:
#       junit: test-results.xml

# test_node14:unit:
#   image: node:14
#   stage: test
#   script:
#     - npm run test
#   coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
#   artifacts:
#     reports:
#       junit: test-results.xml

test:integration:
 stage: test
 script:
  - npm run test_integration
 services:
  # - cassandra:3.11
  - rabbitmq:management
 variables:
  RABBITMQ_CONF_FILE : rabbitmq.conf
  # RABBITMQ_DEFAULT_USER: guest
  # RABBITMQ_DEFAULT_PASS: guest
  # RABBITMQ_DEFAULT_VHOST: 'my_virtualhost'
  # AMQP_URL: 'amqp://guest:guest@rabbitmq:5672'
 coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
 artifacts:
   reports:
     junit: test-results.xml

dependency_scan:
  stage: security
  allow_failure: false
  script:
    - npm audit --audit-level=moderate

include:
  - template: Security/Secret-Detection.gitlab-ci.yml
  - template: Security/SAST.gitlab-ci.yml

secret_detection:
  stage: security
  before_script: []
secret_detection_default_branch:
  stage: security
  before_script: []

nodejs-scan-sast:
  stage: security
  before_script: []

eslint-sast:
  stage: security
  before_script: []

leanix_sync:
  stage: leanix
  variables:
    ENV: "development"
  rules:
    - if: '$CI_COMMIT_BRANCH == "develop"'
      variables:                              
        ENV: "development" 
    - if: '$CI_COMMIT_BRANCH == "test"'
      variables:                              
        ENV: "uat" 
    - if: '$CI_COMMIT_BRANCH == "master"'
      variables:                        
        ENV: "production"     
    
  before_script:
    - apt update && apt -y install jq
  script:
    - VERSION=$(cat package.json | jq -r .version)
    - npm run dependencies_check
    - echo "Update LeanIx Factsheet "
    ...
  allow_failure: true

This is my .env_CI file :

CASSANDRA_CONTACTPOINTS = localhost
CASSANDRA_KEYSPACE = pfm
CASSANDRA_USER = "cassandra"
CASSANDRA_PASS = "cassandra"

RABBITMQ_HOSTS=rabbitmq
RABBITMQ_PORT=5672
RABBITMQ_VHOST=my_virtualhost
RABBITMQ_USER=guest
RABBITMQ_PASS=guest
RABBITMQ_PROTOCOL=amqp

PORT = 8091

Logs of a run after a commit on the node-api project :

Running with gitlab-runner 13.12.0 (7a6612da)
  on Enocloud-Gitlab-Runner PstDVLop
Preparing the "docker" executor
00:37
Using Docker executor with image node:12 ...
Starting service rabbitmq:management ...
Pulling docker image rabbitmq:management ...
Using docker image sha256:737d67e8db8412d535086a8e0b56e6cf2a6097906e2933803c5447c7ff12f265 for rabbitmq:management with digest rabbitmq@sha256:b29faeb169f3488b3ccfee7ac889c1c804c7102be83cb439e24bddabe5e6bdfb ...
Waiting for services to be up and running...
*** WARNING: Service runner-pstdvlop-project-372-concurrent-0-b78aed36fb13c180-rabbitmq-0 probably didn't start properly.
Health check error:


Service container logs:
2021-08-05T15:39:02.476374200Z 2021-08-05 15:39:02.456089+00:00 [info] <0.222.0> Feature flags: list of feature flags found:
2021-08-05T15:39:02.476612801Z 2021-08-05 15:39:02.475702+00:00 [info] <0.222.0> Feature flags:   [ ] implicit_default_bindings
...
2021-08-05T15:39:03.024092380Z 2021-08-05 15:39:03.023476+00:00 [noti] <0.44.0> Application syslog exited with reason: stopped
2021-08-05T15:39:03.024287781Z 2021-08-05 15:39:03.023757+00:00 [noti] <0.222.0> Logging: switching to configured handler(s); following messages may not be visible in this log output
2021-08-05T15:39:03.045901591Z 2021-08-05 15:39:03.045602+00:00 [noti] <0.222.0> Logging: configured log handlers are now ACTIVE
2021-08-05T15:39:03.391624143Z 2021-08-05 15:39:03.391057+00:00 [info] <0.222.0> ra: starting system quorum_queues
2021-08-05T15:39:03.391785874Z 2021-08-05 15:39:03.391207+00:00 [info] <0.222.0> starting Ra system: quorum_queues in directory: /var/lib/rabbitmq/mnesia/rabbit@635519274c80/quorum/rabbit@635519274c80
2021-08-05T15:39:03.510825736Z 2021-08-05 15:39:03.510441+00:00 [info] <0.259.0> ra: meta data store initialised for system quorum_queues. 0 record(s) recovered
2021-08-05T15:39:03.536493082Z 2021-08-05 15:39:03.536098+00:00 [noti] <0.264.0> WAL: ra_log_wal init, open tbls: ra_log_open_mem_tables, closed tbls: ra_log_closed_mem_tables
2021-08-05T15:39:03.547541524Z 2021-08-05 15:39:03.546999+00:00 [info] <0.222.0> ra: starting system coordination
2021-08-05T15:39:03.547876996Z 2021-08-05 15:39:03.547058+00:00 [info] <0.222.0> starting Ra system: coordination in directory: /var/lib/rabbitmq/mnesia/rabbit@635519274c80/coordination/rabbit@635519274c80
2021-08-05T15:39:03.551508520Z 2021-08-05 15:39:03.551130+00:00 [info] <0.272.0> ra: meta data store initialised for system coordination. 0 record(s) recovered
2021-08-05T15:39:03.552002433Z 2021-08-05 15:39:03.551447+00:00 [noti] <0.277.0> WAL: ra_coordination_log_wal init, open tbls: ra_coordination_log_open_mem_tables, closed tbls: ra_coordination_log_closed_mem_tables
2021-08-05T15:39:03.557022096Z 2021-08-05 15:39:03.556629+00:00 [info] <0.222.0> 
2021-08-05T15:39:03.557045886Z 2021-08-05 15:39:03.556629+00:00 [info] <0.222.0>  Starting RabbitMQ 3.9.1 on Erlang 24.0.5 [jit]
2021-08-05T15:39:03.557050686Z 2021-08-05 15:39:03.556629+00:00 [info] <0.222.0>  Copyright (c) 2007-2021 VMware, Inc. or its affiliates.
2021-08-05T15:39:03.557069166Z 2021-08-05 15:39:03.556629+00:00 [info] <0.222.0>  Licensed under the MPL 2.0. Website: https://rabbitmq.com
2021-08-05T15:39:03.558119613Z 
2021-08-05T15:39:03.558134063Z   ##  ##      RabbitMQ 3.9.1
2021-08-05T15:39:03.558139043Z   ##  ##
2021-08-05T15:39:03.558142303Z   ##########  Copyright (c) 2007-2021 VMware, Inc. or its affiliates.
2021-08-05T15:39:03.558145473Z   ######  ##
2021-08-05T15:39:03.558201373Z   ##########  Licensed under the MPL 2.0. Website: https://rabbitmq.com
2021-08-05T15:39:03.558206473Z 
2021-08-05T15:39:03.558210714Z   Erlang:      24.0.5 [jit]
2021-08-05T15:39:03.558215324Z   TLS Library: OpenSSL - OpenSSL 1.1.1k  25 Mar 2021
2021-08-05T15:39:03.558219824Z 
2021-08-05T15:39:03.558223984Z   Doc guides:  https://rabbitmq.com/documentation.html
2021-08-05T15:39:03.558227934Z   Support:     https://rabbitmq.com/contact.html
2021-08-05T15:39:03.558232464Z   Tutorials:   https://rabbitmq.com/getstarted.html
2021-08-05T15:39:03.558236944Z   Monitoring:  https://rabbitmq.com/monitoring.html
2021-08-05T15:39:03.558241154Z 
2021-08-05T15:39:03.558244394Z   Logs: /var/log/rabbitmq/rabbit@635519274c80_upgrade.log
2021-08-05T15:39:03.558247324Z         <stdout>
2021-08-05T15:39:03.558250464Z 
2021-08-05T15:39:03.558253304Z   Config file(s): /etc/rabbitmq/conf.d/10-default-guest-user.conf
2021-08-05T15:39:03.558256274Z 
2021-08-05T15:39:03.558984369Z   Starting broker...2021-08-05 15:39:03.558703+00:00 [info] <0.222.0> 
2021-08-05T15:39:03.558996969Z 2021-08-05 15:39:03.558703+00:00 [info] <0.222.0>  node           : rabbit@635519274c80
2021-08-05T15:39:03.559000489Z 2021-08-05 15:39:03.558703+00:00 [info] <0.222.0>  home dir       : /var/lib/rabbitmq
2021-08-05T15:39:03.559003679Z 2021-08-05 15:39:03.558703+00:00 [info] <0.222.0>  config file(s) : /etc/rabbitmq/conf.d/10-default-guest-user.conf
2021-08-05T15:39:03.559006959Z 2021-08-05 15:39:03.558703+00:00 [info] <0.222.0>  cookie hash    : 1iZSjTlqOt/PC9WvpuHVSg==
2021-08-05T15:39:03.559010669Z 2021-08-05 15:39:03.558703+00:00 [info] <0.222.0>  log(s)         : /var/log/rabbitmq/rabbit@635519274c80_upgrade.log
2021-08-05T15:39:03.559014249Z 2021-08-05 15:39:03.558703+00:00 [info] <0.222.0>                 : <stdout>
2021-08-05T15:39:03.559017899Z 2021-08-05 15:39:03.558703+00:00 [info] <0.222.0>  database dir   : /var/lib/rabbitmq/mnesia/rabbit@635519274c80
2021-08-05T15:39:03.893651319Z 2021-08-05 15:39:03.892900+00:00 [info] <0.222.0> Feature flags: list of feature flags found:
2021-08-05T15:39:09.081076751Z 2021-08-05 15:39:09.080611+00:00 [info] <0.659.0>  * rabbitmq_management_agent
----
Pulling docker image node:12 ...
Using docker image sha256:7e90b11a78a2c66f8824cb7a125dc0e9340d6e17d66bd8f6ba9dd2717af56f6b for node:12 with digest node@sha256:... ...
Preparing environment 00:01
Running on runner-pstdvlop-project-372-concurrent-0 via gitlab-runner01...
Getting source from Git repository 00:01
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/node-api/.git/
Checking out 4ce1ae1a as PM-1814...
Removing .npm/
Removing node_modules/
Skipping Git submodules setup
Restoring cache 00:03
Checking cache for default...
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted. 
WARNING: node_modules/.bin/depcheck: chmod node_modules/.bin/depcheck: no such file or directory (suppressing repeats) 
Successfully extracted cache
Executing "step_script" stage of the job script 00:20
Using docker image sha256:7e90b11a78a2c66f8824cb7a125dc0e9340d6e17d66bd8f6ba9dd2717af56f6b for node:12 with digest node@sha256: ...
$ npm ci --cache .npm --prefer-offline --no-audit
npm WARN prepare removing existing node_modules/ before installation
> [email protected] postinstall /builds/node-api/node_modules/node-cron
> opencollective-postinstall
> [email protected] postinstall /builds/node-api/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
added 642 packages in 10.824s
$ npm run test_integration
> [email protected] test_integration /builds/node-api
> npx nyc mocha test/integration --exit --timeout 10000 --reporter mocha-junit-reporter
RABBITMQ_PROTOCOL : amqp RABBITMQ_USER : guest RABBITMQ_PASS : guest
config.js parseInt(RABBITMQ_PORT) : NaN
simple message
 [x] Sent 'Hello World!'
this queue [object Object] exists
----------------------------|---------|----------|---------|---------|-------------------
File                        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------------------------|---------|----------|---------|---------|-------------------
All files                   |    5.49 |    13.71 |    4.11 |    5.33 |                   
 pfm-liveprice-api          |    21.3 |     33.8 |   21.43 |      21 |                   
  app.js                    |       0 |        0 |       0 |       0 | 1-146             
  config.js                 |   76.67 |    55.81 |     100 |   77.78 | 19-20,48,55,67-69 
 pfm-liveprice-api/routes   |       0 |        0 |       0 |       0 |                   
  index.js                  |       0 |      100 |       0 |       0 | 1-19              
  info.js                   |       0 |      100 |       0 |       0 | 1-15              
  liveprice.js              |       0 |        0 |       0 |       0 | 1-162             
  status.js                 |       0 |      100 |       0 |       0 | 1-14              
 pfm-liveprice-api/services |       0 |        0 |       0 |       0 |                   
  rabbitmq.js               |       0 |        0 |       0 |       0 | 1-110             
 pfm-liveprice-api/utils    |       0 |        0 |       0 |       0 |                   
  buildBinding.js           |       0 |        0 |       0 |       0 | 1-35              
  buildProducts.js          |       0 |        0 |       0 |       0 | 1-70              
  store.js                  |       0 |        0 |       0 |       0 | 1-291             
----------------------------|---------|----------|---------|---------|-------------------
=============================== Coverage summary ===============================
Statements   : 5.49% ( 23/419 )
Branches     : 13.71% ( 24/175 )
Functions    : 4.11% ( 3/73 )
Lines        : 5.33% ( 21/394 )
================================================================================
Saving cache for successful job
00:05
Creating cache default...
node_modules/: found 13259 matching files and directories 
No URL provided, cache will be not uploaded to shared cache server. Cache will be stored only locally. 
Created cache
Uploading artifacts for successful job
00:01
Uploading artifacts...
WARNING: test-results.xml: no matching files       
ERROR: No files to upload                          
Cleaning up file based variables
00:01
Job succeeded

Tried and does not work

Using variables where to define RabbitMQ vars is deprecated and a .config is required

If I try to use the following vars in my .gitlab-ci.yml :

...
test:integration:
 stage: test
 script:
  - npm run test_integration
 services:
  # - cassandra:3.11
  - rabbitmq:management
 variables:
  RABBITMQ_DEFAULT_USER: guest
  RABBITMQ_DEFAULT_PASS: guest
  RABBITMQ_DEFAULT_VHOST: 'my_virtualhost'
  AMQP_URL: 'amqp://guest:guest@rabbitmq:5672'
 coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
 artifacts:
   reports:
     junit: test-results.xml
...

I get the following outout :

...
Starting service rabbitmq:latest ...
Pulling docker image rabbitmq:latest ...
Using docker image sha256:1c609d1740383796a30facdb06e52905e969f599927c1a537c10e4bcc6990193 for rabbitmq:latest with digest rabbitmq@sha256:d5056e576d8767c0faffcb17b5604a4351edacb8f83045e084882cabd384d216 ...
Waiting for services to be up and running...
*** WARNING: Service runner-tpg-ivpc-project-372-concurrent-0-e6aa2c66d0096694-rabbitmq-0 probably didn't start properly.
Health check error:
start service container: Error response from daemon: Cannot link to a non running container: /runner-tpg-ivpc-project-372-concurrent-0-e6aa2c66d0096694-rabbitmq-0 AS /runner-tpg-ivpc-project-372-concurrent-0-e6aa2c66d0096694-rabbitmq-0-wait-for-service/service (docker.go:1156:0s)
Service container logs:
2021-08-05T13:14:33.024761664Z error: RABBITMQ_DEFAULT_PASS is set but deprecated
2021-08-05T13:14:33.024797191Z error: RABBITMQ_DEFAULT_USER is set but deprecated
2021-08-05T13:14:33.024802924Z error: deprecated environment variables detected
2021-08-05T13:14:33.024806771Z 
2021-08-05T13:14:33.024810742Z Please use a configuration file instead; visit https://www.rabbitmq.com/configure.html to learn more
2021-08-05T13:14:33.024844321Z
...

because on the official Docker documentation (https://hub.docker.com/_/rabbitmq) it is stated that :

WARNING: As of RabbitMQ 3.9, all of the docker-specific variables listed below are deprecated and no longer used. Please use a configuration file instead; visit rabbitmq.com/configure to learn more about the configuration file. For a starting point, the 3.8 images will print out the config file it generated from supplied environment variables.

# Unavailable in 3.9 and up
RABBITMQ_DEFAULT_PASS
RABBITMQ_DEFAULT_PASS_FILE
RABBITMQ_DEFAULT_USER
RABBITMQ_DEFAULT_USER_FILE
RABBITMQ_DEFAULT_VHOST
RABBITMQ_ERLANG_COOKIE
...

Solution

  • Finally, this configuration of the .gitlab-ci.yml file works well (no RMQ config file is needed):

    image: node:latest
    # image: node:12
    
    stages:
      - install
      - test
      - build
      - security
      - leanix
    ...
    
    test:integration:
      stage: test
      script:
        - npm run init:keyspace
        - npm run init:table
        - npm run test_integration
        - printf '%s\n' "$ENO_ENV"
        - mv coverage coverage_integration
      services:
        - rabbitmq:management
        - cassandra:3.11
      variables:
        RABBITMQ_DEFAULT_USER: rabbitmq
        RABBITMQ_DEFAULT_PASS: rabbitmq
        RABBITMQ_DEFAULT_PORT: 5672
        RABBITMQ_DEFAULT_VHOST: trayport_virtualhost
      coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
      artifacts:
          paths:
              - "coverage_integration/"   
          reports:
              junit: test-results.xml
    ...
    

    Output of the Gitlab CI/CD :

    2023-05-27T11:58:18.844002783Z INFO  [main] 2023-05-27 11:58:18,843 CassandraDaemon.java:564 - Not starting RPC server as requested. Use JMX (StorageService->startRPCServer()) or nodetool (enablethrift) to start it
    2023-05-27T11:58:18.844283290Z INFO  [main] 2023-05-27 11:58:18,844 CassandraDaemon.java:650 - Startup complete
    2023-05-27T11:58:20.461406047Z INFO  [OptionalTasks:1] 2023-05-27 11:58:20,458 CassandraRoleManager.java:374 - Created default superuser role 'cassandra'
    *********
    Pulling docker image node:latest ...
    Using docker image sha256:2201f1d2b46f1db5b1b58c8699709564a2e5e1196d4b511f807dbf49b33e9ed1 for node:latest with digest node@sha256:d903b23148dccca63152cb2bdf6fdfa062842dcce49f0d45558ca06a8ab14598 ...
    Preparing environment
    Running on runner-tpg-ivpc-project-372-concurrent-0 via gitlab-runner01...
    Getting source from Git repository
    Fetching changes with git depth set to 50...
    Reinitialized existing Git repository in /builds/Biz-IT/api/.git/
    Checking out 96d58141 as master...
    Removing .npm/
    Removing coverage_unit/
    Removing node_modules/
    Skipping Git submodules setup
    Executing "step_script" stage of the job script
    Using docker image sha256:2201f1d2b46f1db5b1b58c8699709564a2e5e1196d4b511f807dbf49b33e9ed1 for node:latest with digest node@sha256:d903b23148dccca63152cb2bdf6fdfa062842dcce49f0d45558ca06a8ab14598 ...
    $ export ENO_ENV="CI"
    $ npm ci --cache .npm --prefer-offline --no-audit
    npm WARN deprecated [email protected]: This package is no longer being maintained.
    ...
    added 862 packages in 12s
    109 packages are looking for funding
      run `npm fund` for details
    $ npm run init:keyspace
    > [email protected] init:keyspace
    > node test/initDatabase/initKeyspace
    RUNNING INIT KEYSPACE SCRIPTS
    Successfully connected to Cassandra.
    Cassandra keyspace created.
    $ npm run init:table
    > [email protected] init:table
    > node test/initDatabase/initTable
    RUNNING INIT SCRIPTS
    Successfully connected to Cassandra.
    Cassandra tables created.
    $ npm run test_integration
    > [email protected] test_integration
    > npx nyc mocha test/integration --exit --timeout 1200000
    Creating tables if not exist...
    config.test.js config.rabbitmq.port =
    ...
    [AMQP] connecting...
      cassandra
      info - HostConnectionPool:  Connection pool to host 172.17.0.3:9042 contains 1 connection(s)
        ✔ insert (89ms)
        ✔ select
        ✔ select latest prices
      RabbitMQ
    [AMQP] connecting...
        ✔ Testing connection
      RESTful API
    GET /info/version 200 3.342 ms - 10
      res.status 200
        ✔ has status 200
        ✔ no err is returned
    GET /info/version 200 0.596 ms - 10
        ✔ The body is an object
    GET /info/version 200 0.434 ms - 10
        ✔ The bores.text equals 1.4.4
    GET /info/version 200 0.598 ms - 10
      RESTful API 2
        ✔ check app status page
        ✔ check app / page
    GET / 302 1.343 ms - 31
    (node:116) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
    (Use `node --trace-deprecation ...` to show where the warning was created)
        ✔ checking the /liveprice/error page
    GET /liveprice/error 200 1.085 ms - 37
        ✔ checking the /liveprice/gas page
    GET /liveprice/gas 200 3.285 ms - 27709
        ✔ checking the /liveprice/pw page
    GET /liveprice/pw 200 2.686 ms - 29709
        ✔ checking the /liveprice/test no commodity
    GET /liveprice/test 404 0.641 ms - 22
        ✔ checking the /liveprice/p
    GET /liveprice/p 200 4.221 ms - 179
        ✔ checking the /liveprice/gas/test with wrong item
    GET /liveprice/gas/test 404 2.106 ms - 22
      cassandra
        ✔ insert
        ✔ select
      18 passing (298ms)