The Colonel helps you to check the smoke in your application

v1.0 2019-11-15 23:11 UTC


Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version License


The Colonel Smoker is an expert in smoke. He can even tell if your application is smoking before deploying it to production.

The Colonel Smoker find the URLs of your Symfony application (only Symfony is supported now) and looks for 500 errors.

Main features :

  • helps providing requirements parameters for your dynamic URLs
  • uses the routes declared in the Symfony routing by default
  • check for response code
  • check if the resulted html contains dynamic data from your entity

The goal is to ensure that each urls in your application does not contains critical errors. It is especially designed for application which have pages with complex and dynamic data to display.

This bundle relies on Symfony service injection. If your are not familiar with this, you can read documentation here


composer require --dev lag/colonel-smoker-bundle


# config/packages/test/lag_smoker.yaml
    host: '' # This is the default configuration
    # This route will be used to generated urls to test against
        # The homepage route has no parameters and expect a 200 OK response code
        app.homepage: ~
        # The show article requires parameters. They will be provided by the mapping "article"
            mapping: article
    # The mapping will be used to generated urls with dynamic parameters
        # This name can be anything, but it has to be unique
            # This mapping will be used with the Article entity of your application
            entity: App\JK\CmsBundle\Entity\Article
            # The property id in the route parameters (/articles/{id} for example) will be mapped with id property of your entity
                id: id


  1. First generate the URL cache :
bin/console smoker:generate-cache
  1. Then run the smoke tests :
bin/console smoker:smoke

If you use the Symfony WebServer bundle, dont forget to run bin/console server:start --env=test.

How it works

The Colonel Smoker will read the configuration and use the Symfony routing to build the urls of your application. Urls are stored in a cache. Then he calls each urls and analyze the response to find 500 errors. But it can tests more like if the html contains some static or dynamic values.

For example, if your application handles articles, the Colonel Smoker can check if the page displaying the article contains the article title.


  1. Getting started
  2. Build Urls
  3. ResponseHandlers

Reference Configuration

            mapping: null
            provider: symfony
                response_code: 200
            mapping: article
            provider: my_custom_requirements_provider
                response_code: 302
            entity: App\JK\CmsBundle\Entity\Article
            provider: symfony
            pattern: 'app.article_'
                - app.article.excluded_routes
                id: id
                categorySlug: category.slug

The Colonel relies on the Symfony DomCrawler component and the Goutte client.

Known Issues

In dev environment, we call the Symfony Client to many times when having the server on the same machine (when using the Symfony web server for example), the cache miss to retrieve value and throws an exception. It causes some build failures. A patch is in progress to avoid this.

## Road map

  • Add an option to set a timeout in tests to avoid error with the cache
  • Add a check to see if the web server is running