Testing modules locally can be accomplished using a series of Make
tasks
contained in this repo.
Make Task | What happens |
---|---|
converge | Execute kitchen converge for all modules |
test | Execute kitchen test --destroy=always for all modules |
verify | Execute kitchen verify for all modules |
destroy | Execute kitchen destroy for all modules |
kitchen | Execute kitchen <command> . Specify the command with the COMMAND argument to make |
e.g. run a single test: make kitchen COMMAND="verify minimal-aws"
Typical Workflow:
make destroy && make format && make converge && make verify
Test Kitchen uses the concept of "instances" as it's medium for multiple test
packages in a project.
An "instance" is the combination of a test suite and a platform.
This project uses a single platform for all specs (e.g. aws
).
The name of this platform actually doesn't matter since the terraform provisioner
and driver are not affected by it.
You can see the available test instances by running the kitchen list
command:
$ make kitchen COMMAND=list
Instance Driver Provisioner Verifier Transport Last Action Last Error
default-aws Terraform Terraform Terraform Ssh Verified
To run Test Kitchen processes for a single instance, you must use the kitchen
target from the make file and pass the command and the instance name using the
COMMAND
variable to make.
# where 'default-aws is an Instance name from kitchen's list
$ make kitchen COMMAND="converge default-aws"