Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Latest commit

 

History

History
63 lines (53 loc) · 1.44 KB

TESTING.md

File metadata and controls

63 lines (53 loc) · 1.44 KB

Testing

Prerequisites

We recommend to install ChefDK to your development environment. It provides all tools used in the process of testig this cookbook.

Before starting, make sure you have installed all dependencies:

git clone https://github.com/Icinga/chef-icinga2.git
cd chef-icinga2

Integration

Requirements

Run Tests

To run all test suits on all platforms:

kitchen test

Instead of running all integration tests, you can specify each suite and platform to create the instances. All steps can be run separately.

kitchen create server-ubuntu-1404
kitchen converge server-ubuntu-1404
kitchen setup server-ubuntu-1404
kitchen verify server-ubuntu-1404
kitchen destroy server-ubuntu-1404

List existing instances

kitchen list

Spec

Unit tests are implemented in ChefSpec/RSpec:

/opt/chefdk/bin/chef exec rake spec

Foodcritic

Linting is done with Foodcritic:

/opt/chefdk/bin/chef exec rake foodcritic

Rubocop

Ruby code is analyzed with Rubocop:

/opt/chefdk/bin/chef exec rake rubocop