2017 © Pedro Peláez
 

library cigar

Smoke testing tool written in PHP.

image

brunty/cigar

Smoke testing tool written in PHP.

  • Wednesday, May 9, 2018
  • by Brunty
  • Repository
  • 5 Watchers
  • 95 Stars
  • 3,751 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 26 Versions
  • 83 % Grown

The README.md

Cigar

Build Status Coverage Status SensioLabsInsight, (*1)

A smoke testing tool inspired by symm/vape, (*2)

Similar tools include:, (*3)

Installation

Install via composer:, (*4)

composer require brunty/cigar --dev, (*5)

Pull via docker:, (*6)

docker pull brunty/cigar, (*7)

To use

Create a .cigar.json file that contains an array of json objects specifying the url, status, (optional) content, and (optional) content-type to check., (*8)

[
  {
    "url": "http://httpbin.org/status/418",
    "status": 418,
    "content": "teapot"
  },
  {
    "url": "http://httpbin.org/status/200",
    "status": 200,
    "content-type": "text/html"
  },
  {
    "url": "http://httpbin.org/status/304",
    "status": 304
  },
  {
    "url": "http://httpbin.org/status/500",
    "status": 500
  }
]

When installed via composer:, (*9)

Run vendor/bin/cigar to have it check each of the URLs return the status code expected., (*10)

When pulled via docker:, (*11)

Run docker run -v $(pwd):/app --rm brunty/cigar to have it check each of the URLs return the status code expected., (*12)

> vendor/bin/cigar                                           
✓ http://httpbin.org/status/418 [418:418] teapot
✓ http://httpbin.org/status/200 [200:200] [text/html:text/html] 
✓ http://httpbin.org/status/304 [304:304] 
✓ http://httpbin.org/status/500 [500:500] 

The format of the lines in the output is:, (*13)

pass/fail url [expected_code:actual_code] [optional_expected_content-type:optional_actual_content-type] optional_text

If all tests pass, the return code $? will be 0 - if any of them don't return the expected status code, the return code will be 1, (*14)

Quiet test mode

If you wish to suppress the output of the test run, pass the --quiet option to the command: vendor/bin/cigar --quiet, (*15)

Alternative configuration files

If you wish to use an alternative configuration file, use the vendor/bin/cigar -c file.json or vendor/bin/cigar --config=file.json options when running the command., (*16)

Passing a base URL to check against

If you wish to check a file of URLs relative to the root of a site against a base URL, you can do so with by using vendor/bin/cigar -u http://httpbin.org or vendor/bin/cigar --url=http://httpbin.org, (*17)

Your configuration file can then contain URLs including:, (*18)

  • Full absolute URLs as before (cigar won't use the base URL when checking an absolute URL)
[
  {
    "url": "http://httpbin.org/status/418",
    "status": 418,
    "content": "teapot"
  }
]
  • URLs relative to the base url that you've specified, either with or without a leading slash., (*19)

    [
    {
    "url": "/status/418",
    "status": 418,
    "content": "teapot"
    },
    
    {
    "url": "status/418",
    "status": 418,
    "content": "teapot"
    }
    ]
    

Disabling SSL cert verification

If you wish to run the tool without checking SSL certs, use the -i or --insecure option to the command: vendor/bin/cigar -i or vendor/bin/cigar --insecure, (*20)

Only use this if absolutely necessary., (*21)

Passing Authorization header

If you wish to add the Authorization header, use the -a or --auth option to the command: vendor/bin/cigar -a "Basic dXNyOnBzd2Q=" or vendor/bin/cigar --auth="Basic dXNyOnBzd2Q=", (*22)

Passing custom header

If you wish to add any custom header(s), use the -h or --header option to the command: vendor/bin/cigar -h "Cache-control: no-cache" or vendor/bin/cigar --header="Cache-control: no-cache", (*23)

Command help & command version

If you want to see all the available options for Cigar, use the command: vendor/bin/cigar --help, (*24)

If you wish to see what version of Cigar you're using, use the command: vendor/bin/cigar --version, (*25)

Contributing

This started as a small personal project., (*26)

Although this project is small, openness and inclusivity are taken seriously. To that end a code of conduct (listed in the contributing guide) has been adopted., (*27)

Contributor Guide, (*28)

The Versions

09/05 2018

1.10.0

1.10.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

09/05 2018

dev-master

9999999-dev

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

09/04 2018

1.9.0

1.9.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

17/03 2018

1.8.1

1.8.1.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

16/03 2018

1.8

1.8.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

12/03 2018

1.7.2

1.7.2.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

12/03 2018

1.7.1

1.7.1.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

12/03 2018

1.7

1.7.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

12/03 2018

1.6

1.6.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

01/03 2018

1.5.1

1.5.1.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

01/03 2018

dev-feature/disable-ssl-checks

dev-feature/disable-ssl-checks

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

18/02 2018

1.4

1.4.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

08/07 2017

1.3.2

1.3.2.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

08/07 2017

1.3.1

1.3.1.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

08/07 2017

1.3

1.3.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/06 2017

1.2.1

1.2.1.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/06 2017

1.2

1.2.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/06 2017

1.1

1.1.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

22/06 2017

1.0.0

1.0.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

22/06 2017

0.3

0.3.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

18/06 2017

dev-feature/content-checking

dev-feature/content-checking

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

18/06 2017

0.2.2

0.2.2.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

18/06 2017

0.2.1

0.2.1.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2017

0.2

0.2.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2017

0.1.1

0.1.1.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

17/06 2017

0.1

0.1.0.0

Smoke testing tool written in PHP.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires