Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Switch to test-kitchen #14

Open
wingrunr21 opened this issue Mar 8, 2014 · 5 comments
Open

Switch to test-kitchen #14

wingrunr21 opened this issue Mar 8, 2014 · 5 comments
Assignees

Comments

@wingrunr21
Copy link
Collaborator

Instead of relying on a Vagrantfile for chef-solo testing, I'd like to switch us over to test-kitchen. This combined with serverspec tests should help keep us from regressing along with maintaining behavior with the base dokku project.

It'll also help me since I use parallels instead of VirtualBox 😄

@wingrunr21 wingrunr21 self-assigned this Mar 8, 2014
@fgrehm
Copy link
Owner

fgrehm commented Mar 9, 2014

👍

@mikexstudios
Copy link
Contributor

I've been working on updating chef-dokku to match dokku v0.2.3 and added test-kitchen tests along the way. I'm not sure if this is the way you envision the tests so I'll post links instead of a pull request:

https://github.com/mikexstudios/chef-dokku/blob/v0.2.3/.kitchen.yml
https://github.com/mikexstudios/chef-dokku/blob/v0.2.3/attributes/test_helper.rb
https://github.com/mikexstudios/chef-dokku/blob/v0.2.3/recipes/test_helper.rb
https://github.com/mikexstudios/chef-dokku/blob/v0.2.3/test/integration/default/bats/deploy_apps.bats

Right now, I only implemented the same deploy tests as dokku. Here's how it works:

  • Set which apps to test with attribute node['dokku']['test_deploy']['apps']. For example, in .kitchen.yml, I set it to only test the python-flask app so that tests do not take a long time to run.
  • Include recipe[dokku::test_helper] in the run list. The test_helper.rb recipe sets up the test apps from the original dokku git repository and enables root to push to dokku.
  • deploy_apps.bats is run during kitchen verify and pushes each of the enabled apps to the dokku server and checks its output (using the check_output script included with each app).

I wanted to use serverspec, but given the command-heavy nature of deploying the test apps, I opted for bats instead. One neat aspect is that I'm using xip.io for wildcard subdomains that point to a private network address. This simplifies testing app deployment and eliminates the need for something like https://github.com/phinze/landrush, which did not run very well on my system.

I will try to add some other tests for local dokku commands later. But does this sound reasonable so far?

@wingrunr21
Copy link
Collaborator Author

This looks fine to me so far. I have no issue with using bats over serverspec.

@wingrunr21
Copy link
Collaborator Author

@mikexstudios I am going to do work on this today. I may cherry-pick some of your commits out of your branch if you don't mind. Hoping to get a lot of stuff done as I have been neglecting this cookbook.

@mikexstudios
Copy link
Contributor

Great thanks. I'm busy today, but let me know if there is anything I can
help with.
On Jun 26, 2014 10:55 AM, "Stafford Brunk" [email protected] wrote:

@mikexstudios https://github.com/mikexstudios I am going to do work on
this today. I may cherry-pick some of your commits out of your branch if
you don't mind. Hoping to get a lot of stuff done as I have been neglecting
this cookbook.


Reply to this email directly or view it on GitHub
#14 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants