New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests via OpsWorks ec2 #175

Merged
merged 1 commit into from Dec 5, 2016

Conversation

Projects
None yet
2 participants
@alexpop
Collaborator

alexpop commented Dec 2, 2016

fixes #169

@alexpop alexpop self-assigned this Dec 2, 2016

@alexpop alexpop added the in progress label Dec 2, 2016

@alexpop alexpop changed the title from WIP: integration tests via OpsWorks ec2 to Integration tests via OpsWorks ec2 Dec 3, 2016

@chris-rock

This is an awesome addition @alexpop. I just added some minor findings.

test/kitchen-automate/README.md Outdated
## How is it working?
This cookbook uses the `kitchen-ec2` driver in order to spin up an OpsWorks(Chef Server + Automate) instance in ec2 using a previously snapshotted OpsWorks instance.

This comment has been minimized.

@chris-rock

chris-rock Dec 5, 2016

Collaborator

This comment has been minimized.

@chris-rock

chris-rock Dec 5, 2016

Collaborator

Or are you expecting ChefDK?

This comment has been minimized.

@alexpop

alexpop Dec 5, 2016

Collaborator

only kitchen + kitchen-ec2 and kitchen-inspec are needed. I'll add it

test/kitchen-automate/README.md Outdated
A `kitchen test` will:
1. Create the ec2 instance
2. Converge the node with chef_zero using the `default` recipe
3. Test the success of the reporting using InSpec resources in `test/integration/default/`. This is verifying that compliance scan reports exist in ElasticSearch(used by Chef Visibility) for both converges.

This comment has been minimized.

@chris-rock

chris-rock Dec 5, 2016

Collaborator

nit: ElasticSearch (used by Chef Visibility) space is missing

# Run the "halt" command on the instance 4 hours from now
# Ensures instances are not left hanging around if integration tests fail
# To prevent an instance from halting use the `atq` and `atrm ID` commands as root
execute 'echo "halt" | at now + 4 hours' do

This comment has been minimized.

@chris-rock

chris-rock Dec 5, 2016

Collaborator

👍 cool trick!

# Because we snapshot the instance, the initial S3 storage config goes away
# Disable the S3 store for cookbooks:
delete_lines "Avoid cookbook storage in S3" do

This comment has been minimized.

@chris-rock

chris-rock Dec 5, 2016

Collaborator

we should add a note, that this is only suitable for test environments, not production environments

This comment has been minimized.

@alexpop

alexpop Dec 5, 2016

Collaborator

I added a note in test/kitchen-automate/README.md

Add integration testing using Chef Automate
Signed-off-by: Alex Pop <apop@chef.io>
@chris-rock

This comment has been minimized.

Collaborator

chris-rock commented Dec 5, 2016

Great work @alexpop 💯

@chris-rock chris-rock merged commit 89d64e5 into master Dec 5, 2016

2 checks passed

DCO This commit has a DCO Signed-off-by
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@chris-rock chris-rock deleted the ap/automate-kitchen branch Dec 5, 2016

@chris-rock chris-rock removed the in progress label Dec 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment