codeception
Version information
This version is compatible with:
- Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 6.0.0
- ,
Start using this module
Add this module to your Puppetfile:
mod 'noerdisch-codeception', '0.1.7'
Learn more about managing modules with a PuppetfileDocumentation
Nœrdisch puppet module for codeception
This is a little puppet module I created for testing the open source CMS TYPO3 with codeception. You can also use it to test other PHP scripts with codeception.
I tested this actualy only on ubuntu 16.04.
Install
Via puppet forge
To use this module, add this declaration to your Puppetfile:
mod 'noerdisch-codeception', '0.1.7'
Manually via puppet
To manually install this module with puppet module tool:
puppet module install noerdisch-codeception --version 0.1.7
Via git
Clone the repository in your modules folder.
git clone https://github.com/noerdisch/puppet-codeception.git codeception
Now you only need to include the new module to your main manifest file. Just use:
include codeception
Note
The module comes with codeception and a chromedriver. So you are able to write acceptance tests from the beginning.
For new projects you can just enter codecept bootstrap
and you are ready to go.
For acceptance tests we use the chromedriver for the google chrome browser. If you want to use other browsers you need to install the geckodriver e.g. first.
To start the chrome we also added a script. Just enter chrome-start
and you can run the codeception tests.
The script creates a file with the pid of the chrome process. The file is located in your home folder. When your done enter chrome-stop
to stop the process. The chromedriver runs on port 9515
.
The usage of chrome is at the moment only for Debian like operating systems!
TYPO3 special
The TYPO3 team release a testing framework since version 8 and they also offer codeception tests with a whole suite for the core. To run TYPO3 tests you need to start a listener first. We also added a small script for that usecase. But you can also use this for every webapplication.
start-typo3-listener
And like the chrome we have a stop script, when your work is done.
stop-typo3-listener
!! Important !!
The chrome script can be started from everywhere, but the TYPO3 listener is relevant for the concrete TYPO3 instance. So please execute the script from the TYPO3 instance web root.
We are saving the current process id so that we know if a script is running. When you want to run multiple TYPO3 instances on one server you can not execute the acceptance tests in parallel. First finish one instance, stop the listener and then start a new listener from the web root of the new instance.
Disclamer
I am not a DevOps guy. So be patient with me if something is done wrong and open an issue or send a PR. I just want to share my little helper.
Troubleshooting
- The TYPO3 acceptance tests are failing and the screenshot shows only "File not found"? Then you probably have a process that uses the port 8000. Check this with
sudo netstat -plnt
... when you have a process that is not php, try to stop that. Otherwise the start-typo3-listener can not start.
Links
MIT License Copyright (c) 2017 Markus Günther Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.