Search code examples
chef-infratest-kitchen

test-kitchen update instead of create every time


In test-kitchen, is there a way to update the instance created instead of destroying and recreating the instance every time? Say if I change in kitchen.yml and want to see that change, running the whole destroy/create can take a while.


Solution

  • Depending on the provider you are using - yes.

    First, there are a few lifecycle steps:

    1. kitchen create - this will create the instance. It's the equivalent of vagrant up --no-provision.
    2. kitchen converge - this will converge (provision) the instance. It's the equivalent of vagrant provision.
    3. kitchen verify - this will run any post-integration tests (like ServerSpec or bats). There is no equivalent in vagrant.
    4. kitchen test - wraps the above three commands in a single sequence.

    Test Kitchen does not have a notion of vagrant reload, which is what you seem to describe by your example. However, you can accomplish a reload by doing something like:

    cd .kitchen/suite_name && vagrant reload
    

    from the command line.