PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 28, 2022

[FIXED] How do you report errors to chef from a test suite?

 September 28, 2022     chef-infra, chef-recipe, continuous-deployment, continuous-integration, deployment     No comments   

Issue

If I run a test suite upon install how would I report errors to chef? More generally, are there great packages for verifying system state?

Does this simply involve returning error codes on exit or are there more verbose ways of interacting with Chef?


Solution

I highly recommend two tools:

  • ChefSpec
  • Test Kitchen

These are great tools for testing the various logic branches and behaviors of your cookbook. ChefSpec will perform an in-memory Chef run, so it's perfect for unit testing and fast feedback loops. Test Kitchen will converge a real node (using Vagrant by default) and then use a busser (such as Bats or Serverspec) to validate the state of the system at the end of converge.

In production, Chef also has native report handling and error reporting. According to the documentation, you can create your own handlers for notifications.



Answered By - sethvargo
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing