Skip to content

Instantly share code, notes, and snippets.

@yauh
Created March 4, 2014 11:00
Show Gist options
  • Save yauh/9344349 to your computer and use it in GitHub Desktop.
Save yauh/9344349 to your computer and use it in GitHub Desktop.
My vagrant setup for testing Yii apps with codeception
# Codeception Test Suite Configuration
# suite for acceptance tests.
# perform tests in browser using the Selenium-like tools.
# powered by Mink (http://mink.behat.org).
# (tip: that's what your customer will see).
# (tip: test your ajax and javascript by one of Mink drivers).
# get MailCatcherHelper here: https://github.com/captbaritone/mailcatcher-codeception-helper
# Using CodeCeption 1.8.x with multiple environments
# (so acceptance testing on Jenkins can use different servers)
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
class_name: WebGuy
modules:
enabled:
- WebHelper
- Selenium2
- MailCatcherHelper
config:
Selenium2:
url: 'http://localhost:8080/'
browser: firefox
MailCatcherHelper:
url: 'http://localhost'
port: '8088'
env:
jenkins:
modules:
config:
Selenium2:
url: 'http://192.168.1.201/'
browser: firefox
MailCatcherHelper:
url: 'http://192.168.2.201:1080/'
port: '1080'
vagrant:
modules:
config:
Selenium2:
url: 'http://localhost:8080/'
browser: firefox
MailCatcherHelper:
url: 'http://localhost:8088/'
port: '8088'
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# It's a wheezy box with 64bit 7.3 Debian
# full lamp stack, yii framework 1.1.14 and all required PHP/Pear modules for devs
config.vm.box = "yauh-wheezy"
# The box sits on my own site
config.vm.box_url = "http://vagrant.yauh.de/yauh-wheezy.box"
# the following assumes three folders in the root of your project: src/, log/, provision/
# folder syncing to allow provisioning and simple deployment
config.vm.synced_folder "provision/", "/tmp/provision"
# my yii project sits in /var/www/src
config.vm.synced_folder "src/", "/var/www/src", owner: "www-data", group: "www-data"
# let all logs be written to the log dir in my project
config.vm.synced_folder "log/", "/var/www/log", owner: "www-data", group: "www-data"
# runs all the ansible magic from inside the vagrant box
# if you like this box as is, there is no need to fire up any shell scripts
#config.vm.provision "shell", path: "provision/setup_vagrant.sh"
# apache can be accessed on localhost:8080
config.vm.network :forwarded_port, guest: 80, host: 8080
# mailcatcher can be accessed on localhost:8088
config.vm.network :forwarded_port, guest: 1080, host: 8088
config.vm.provider :virtualbox do |vb|
# adjust this value if you prefer to give less/more memory to your vagrant box
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment