Reader small image

You're reading from  HashiCorp Packer in Production

Product typeBook
Published inJul 2023
PublisherPackt
ISBN-139781803246857
Edition1st Edition
Right arrow
Author (1)
John Boero
John Boero
author image
John Boero

John Boero has 20 years of experience in the tech industry covering engineering, consulting, architecture, and pre-sales. He comes from Chicago, IL in the USA but currently lives in London, UK. He has worked for Red Hat, Puppet, and HashiCorp and remains active in the open source community. All commissions for this book will be donated to the Raspberry Pi Foundation non-profit to encourage coding and computing skills for kids.
Read more about John Boero

Right arrow

Building and testing your plugin

The GNUMakefile scaffolding also includes simple test support. It would be wise to modify any test Packer templates to demonstrate every feature of your plugin fully. There is a helpful test target to put the test templates and mock data through your plugin. When ready, you can simply run make test and you will get an informative report of failures or issues:

$ make test
?       packer-plugin-nspawn    [no test files]
ok      packer-plugin-nspawn/builder/nspawn     0.047s
ok      packer-plugin-nspawn/datasource/nspawn  0.036s
?       packer-plugin-nspawn/version    [no test files]

Having this added to automation would also be a very wise move. A pre-commit hook can prevent broken code from being committed and also log one of these tests for compliance...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
HashiCorp Packer in Production
Published in: Jul 2023Publisher: PacktISBN-13: 9781803246857

Author (1)

author image
John Boero

John Boero has 20 years of experience in the tech industry covering engineering, consulting, architecture, and pre-sales. He comes from Chicago, IL in the USA but currently lives in London, UK. He has worked for Red Hat, Puppet, and HashiCorp and remains active in the open source community. All commissions for this book will be donated to the Raspberry Pi Foundation non-profit to encourage coding and computing skills for kids.
Read more about John Boero