Code Monkey home page Code Monkey logo

puppet-codeception's Introduction

Build Status Puppet Forge Puppet Forge Libraries.io for GitHub Twitter Follow

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.6'

Manually via puppet

To manually install this module with puppet module tool:

puppet module install noerdisch-codeception --version 0.1.6

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

puppet-codeception's People

Contributors

markusguenther avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

theosotr

puppet-codeception's Issues

Errors on Ubuntu fresh install

Error: sudo apt-get update && sudo apt-get install google-chrome-stable returned 1 instead of one of [0]
==> phoenix-web: Error: /Stage[main]/Codeception/Exec[chrome_install]/returns: change from notrun to 0 failed: sudo apt-get update && sudo apt-get install google-chrome-stable returned 1 instead of one of [0]

And

==> phoenix-web: Error: --2017-11-14 08:16:26--  https://chromedriver.storage.googleapis.com/2.33/chromedriver_linux64.zip
==> phoenix-web: Resolving chromedriver.storage.googleapis.com (chromedriver.storage.googleapis.com)... 216.58.208.48
==> phoenix-web: Connecting to chromedriver.storage.googleapis.com (chromedriver.storage.googleapis.com)|216.58.208.48|:443... connected.
==> phoenix-web: HTTP request sent, awaiting response... 200 OK
==> phoenix-web: Length: 4091651 (3.9M) [application/zip]
==> phoenix-web: Saving to: '~/chromedriver_linux64.zip'
==> phoenix-web:
==> phoenix-web:      0K .......... .......... .......... .......... ..........  1%  431K 9s
==> phoenix-web:     50K .......... .......... .......... .......... ..........  2%  539K 8s
==> phoenix-web:    100K .......... .......... .......... .......... ..........  3% 1.60M 6s
==> phoenix-web:    150K .......... .......... .......... .......... ..........  5%  702K 6s
==> phoenix-web:    200K .......... .......... .......... .......... ..........  6% 2.32M 5s
==> phoenix-web:    250K .......... .......... .......... .......... ..........  7% 3.20M 4s
==> phoenix-web:    300K .......... .......... .......... .......... ..........  8% 1.35M 4s
==> phoenix-web:    350K .......... .......... .......... .......... .......... 10% 2.93M 4s
==> phoenix-web:    400K .......... .......... .......... .......... .......... 11% 1.34M 3s
==> phoenix-web:    450K .......... .......... .......... .......... .......... 12% 3.65M 3s
==> phoenix-web:    500K .......... .......... .......... .......... .......... 13% 2.30M 3s
==> phoenix-web:    550K .......... .......... .......... .......... .......... 15% 2.88M 3s
==> phoenix-web:    600K .......... .......... .......... .......... .......... 16% 2.19M 3s
==> phoenix-web:    650K .......... .......... .......... .......... .......... 17% 2.81M 2s
==> phoenix-web:    700K .......... .......... .......... .......... .......... 18% 2.54M 2s
==> phoenix-web:    750K .......... .......... .......... .......... .......... 20% 2.48M 2s
==> phoenix-web:    800K .......... .......... .......... .......... .......... 21% 2.28M 2s
==> phoenix-web:    850K .......... .......... .......... .......... .......... 22% 5.81M 2s
==> phoenix-web:    900K .......... .......... .......... .......... .......... 23% 2.47M 2s
==> phoenix-web:    950K .......... .......... .......... .......... .......... 25% 2.42M 2s
==> phoenix-web:   1000K .......... .......... .......... .......... .......... 26% 3.59M 2s
==> phoenix-web:   1050K .......... .......... .......... .......... .......... 27% 3.02M 2s
==> phoenix-web:   1100K .......... .......... .......... .......... .......... 28% 2.17M 2s
==> phoenix-web:   1150K .......... .......... .......... .......... .......... 30%  225K 2s
==> phoenix-web:   1200K .......... .......... .......... .......... .......... 31% 1.18M 2s
==> phoenix-web:   1250K .......... .......... .......... .......... .......... 32% 21.6M 2s
==> phoenix-web:   1300K .......... .......... .......... .......... .......... 33%  186M 2s
==> phoenix-web:   1350K .......... .......... .......... .......... .......... 35% 1.55M 2s
==> phoenix-web:   1400K .......... .......... .......... .......... .......... 36% 4.98M 2s
==> phoenix-web:   1450K .......... .......... .......... .......... .......... 37% 18.2M 2s
==> phoenix-web:   1500K .......... .......... .......... .......... .......... 38%  317M 2s
==> phoenix-web:   1550K .......... .......... .......... .......... .......... 40% 12.9M 2s
==> phoenix-web:   1600K .......... .......... .......... .......... .......... 41% 1.08M 1s
==> phoenix-web:   1650K .......... .......... .......... .......... .......... 42% 76.6M 1s
==> phoenix-web:   1700K .......... .......... .......... .......... .......... 43% 24.7M 1s
==> phoenix-web:   1750K .......... .......... .......... .......... .......... 45%  253M 1s
==> phoenix-web:   1800K .......... .......... .......... .......... .......... 46% 1.30M 1s
==> phoenix-web:   1850K .......... .......... .......... .......... .......... 47% 18.1M 1s
==> phoenix-web:   1900K .......... .......... .......... .......... .......... 48% 2.53M 1s
==> phoenix-web:   1950K .......... .......... .......... .......... .......... 50%  178M 1s
==> phoenix-web:   2000K .......... .......... .......... .......... .......... 51% 65.6M 1s
==> phoenix-web:   2050K .......... .......... .......... .......... .......... 52% 80.8M 1s
==> phoenix-web:   2100K .......... .......... .......... .......... .......... 53% 1.24M 1s
==> phoenix-web:   2150K .......... .......... .......... .......... .......... 55% 12.7M 1s
==> phoenix-web:   2200K .......... .......... .......... .......... .......... 56% 1.87M 1s
==> phoenix-web:   2250K .......... .......... .......... .......... .......... 57% 3.43M 1s
==> phoenix-web:   2300K .......... .......... .......... .......... .......... 58%  233M 1s
==> phoenix-web:   2350K .......... .......... .......... .......... .......... 60% 3.34M 1s
==> phoenix-web:   2400K .......... .......... .......... .......... .......... 61% 2.66M 1s
==> phoenix-web:   2450K .......... .......... .......... .......... .......... 62% 2.41M 1s
==> phoenix-web:   2500K .......... .......... .......... .......... .......... 63% 5.01M 1s
==> phoenix-web:   2550K .......... .......... .......... .......... .......... 65% 2.41M 1s
==> phoenix-web:   2600K .......... .......... .......... .......... .......... 66% 4.30M 1s
==> phoenix-web:   2650K .......... .......... .......... .......... .......... 67% 2.79M 1s
==> phoenix-web:   2700K .......... .......... .......... .......... .......... 68% 2.42M 1s
==> phoenix-web:   2750K .......... .......... .......... .......... .......... 70% 2.45M 1s
==> phoenix-web:   2800K .......... .......... .......... .......... .......... 71% 3.74M 1s
==> phoenix-web:   2850K .......... .......... .......... .......... .......... 72% 2.93M 1s
==> phoenix-web:   2900K .......... .......... .......... .......... .......... 73% 3.44M 0s
==> phoenix-web:   2950K .......... .......... .......... .......... .......... 75% 1.97M 0s
==> phoenix-web:   3000K .......... .......... .......... .......... .......... 76% 2.44M 0s
==> phoenix-web:   3050K .......... .......... .......... .......... .......... 77% 7.24M 0s
==> phoenix-web:   3100K .......... .......... .......... .......... .......... 78% 1.98M 0s
==> phoenix-web:   3150K .......... .......... .......... .......... .......... 80% 5.78M 0s
==> phoenix-web:   3200K .......... .......... .......... .......... .......... 81% 1.63M 0s
==> phoenix-web:   3250K .......... .......... .......... .......... .......... 82% 4.90M 0s
==> phoenix-web:   3300K .......... .......... .......... .......... .......... 83% 2.47M 0s
==> phoenix-web:   3350K .......... .......... .......... .......... .......... 85% 4.66M 0s
==> phoenix-web:   3400K .......... .......... .......... .......... .......... 86% 3.38M 0s
==> phoenix-web:   3450K .......... .......... .......... .......... .......... 87% 2.05M 0s
==> phoenix-web:   3500K .......... .......... .......... .......... .......... 88% 2.29M 0s
==> phoenix-web:   3550K .......... .......... .......... .......... .......... 90% 2.45M 0s
==> phoenix-web:   3600K .......... .......... .......... .......... .......... 91% 1.89M 0s
==> phoenix-web:   3650K .......... .......... .......... .......... .......... 92% 27.2M 0s
==> phoenix-web:   3700K .......... .......... .......... .......... .......... 93% 1.69M 0s
==> phoenix-web:   3750K .......... .......... .......... .......... .......... 95% 36.8M 0s
==> phoenix-web:   3800K .......... .......... .......... .......... .......... 96% 2.68M 0s
==> phoenix-web:   3850K .......... .......... .......... .......... .......... 97% 2.32M 0s
==> phoenix-web:   3900K .......... .......... .......... .......... .......... 98% 2.54M 0s
==> phoenix-web:   3950K .......... .......... .......... .......... .....     100% 2.44M=1.8s
==> phoenix-web:
==> phoenix-web: 2017-11-14 08:16:28 (2.22 MB/s) - '~/chromedriver_linux64.zip' saved [4091651/4091651]
==> phoenix-web:
==> phoenix-web: Archive:  ~/chromedriver_linux64.zip
==> phoenix-web:   inflating: ~/chromedriver
==> phoenix-web: sh: 1: rm: not found
==> phoenix-web:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.