This repository has been archived by the owner on Oct 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
How to test
Enzo Rivello edited this page Mar 2, 2017
·
14 revisions
Follow the instructions in how to create a local environment first, to install the essential tools to proceed.
Download ruby dependencies by typing
chef exec bundle
Download chef dependencies by typing:
chef exec berks
You are now ready for your first converge!
Depending on the platform of your choice, you can fire a complete test suite by running:
chef exec bundle exec rake integration:#{platform}[#{suite},#{action}]
where:
- platform is either
vagrant
ordocker
- suite is the name of your kitchen suite (e.g.
community
) - action is the name of your kitchen action
-
converge
will fire up a local alfresco instance. (localhost
for docker,192.168.33.23
by default for vagrant) -
verify
will launch test on an existing instance -
test
will fire up the machine, launch the test then destroy the instance created -
login
will permit you to enter inside the created instance (the password for thekitchen
user iskitchen
)
-
warning: oh-my-zsh doesn't read rake arguments well. To solve this problem, wrap the command in quotation marks, like this:
chef exec bundle exec rake 'integration:#{platform}[#{suite},#{action}]'
Test setup is largely left to personal preference. However, this is the test flow that we use internally.
- Fork and Create a new branch from develop
- Fire up a local alfresco instance (
bundle exec rake integration:docker[community, converge]
) - Run the existing tests, to be sure that you are working on a clean slate (
chef exec bundle exec rake integration:docker[community, verify]
) - Write your tests first (under test//integration/#{suite_name}, then your features in Chef
- Run converge again (to bring the new changes to the existing environment)
- Run kitchen-test to see if the tests are passing
- Repeat steps from 4 to 6 up until you are satisfied with your result
- Destroy your local instance (
bundle exec rake integration:docker[community, converge]
) - Run Foodcritic either by typing the following in the project root folder:
chef exec foodcritic .
chef exec bundle exec rake
- Push your results to your local repo
- Make a pull request against
Alfresco/develop
All pull requests needs to go to develop, any pull directly to master will be automatically turned down