Add Vagrantfiles for various environments to aid in testing

This commit is contained in:
Ben Ramsey
2020-01-22 14:13:05 -06:00
parent 7591ab461f
commit 39fb5166ed
8 changed files with 140 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
.vagrant/
+10
View File
@@ -0,0 +1,10 @@
# Running Tests With Vagrant
To run tests using these instructions, you will first need to install
[Vagrant](https://www.vagrantup.com). You should be able to use
[VirtualBox](https://www.virtualbox.org) with each environment. Other providers,
such as VMWare and Hyper-V, may be available, depending on the box used.
* [Run tests on Linux](linux/README.md)
* [Run tests on FreeBSD](freebsd/README.md)
* [Run tests on Windows](windows/README.md)
+15
View File
@@ -0,0 +1,15 @@
# Run tests on FreeBSD
``` bash
cd /path/to/uuid/resources/vagrant/freebsd
vagrant up
vagrant ssh
```
Once inside the VM:
``` bash
cd uuid/
composer install
composer run-script --timeout=0 test
```
+35
View File
@@ -0,0 +1,35 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<-SCRIPT
pkg update
pkg install -y \
php74 \
php74-bcmath \
php74-composer \
php74-dom \
php74-gmp \
php74-json \
php74-pecl-libsodium \
php74-pecl-uuid \
php74-pecl-xdebug \
php74-simplexml \
php74-tokenizer \
php74-xml \
php74-xmlreader \
php74-xmlwriter \
php74-zip \
unzip
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "freebsd/FreeBSD-12.1-RELEASE"
config.vm.box_version = "2019.11.01"
config.vm.provision "shell", inline: $script
config.vm.synced_folder "../../../", "/home/vagrant/uuid", type: "rsync"
config.ssh.shell = "sh"
config.vm.provider "virtualbox" do |v|
v.name = "ramsey-uuid-freebsd"
end
end
+15
View File
@@ -0,0 +1,15 @@
# Run tests on Linux
``` bash
cd /path/to/uuid/resources/vagrant/linux
vagrant up
vagrant ssh
```
Once inside the VM:
``` bash
cd uuid/
composer install
composer run-script --timeout=0 test
```
+27
View File
@@ -0,0 +1,27 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<-SCRIPT
apt-get update
apt-get install -y \
composer \
php-bcmath \
php-cli \
php-gmp \
php-json \
php-uuid \
php-xdebug \
php-xml \
php-zip \
unzip
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/eoan64"
config.vm.provision "shell", inline: $script
config.vm.synced_folder "../../../", "/home/vagrant/uuid", type: "rsync"
config.vm.provider "virtualbox" do |v|
v.name = "ramsey-uuid-linux"
end
end
+15
View File
@@ -0,0 +1,15 @@
# Run tests on Windows
``` bash
cd /path/to/uuid/resources/vagrant/windows
vagrant up
vagrant ssh
```
Once inside the VM:
``` bash
cd uuid
composer install
composer run-script --timeout=0 test
```
+22
View File
@@ -0,0 +1,22 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<-SCRIPT
choco install composer php unzip --no-progress -y
Invoke-WebRequest -Uri https://windows.php.net/downloads/pecl/releases/xdebug/2.9.1/php_xdebug-2.9.1-7.4-nts-vc15-x64.zip -UseBasicParsing -OutFile C:\\temp\\php_xdebug.zip
unzip C:\\temp\\php_xdebug.zip -d C:\\temp\\php_xdebug
move C:\\temp\\php_xdebug\\php_xdebug.dll C:\\tools\\php74\\ext\\php_xdebug.dll
Add-Content C:\\tools\\php74\\php.ini "`nextension=gmp"
Add-Content C:\\tools\\php74\\php.ini "`nextension=sodium"
Add-Content C:\\tools\\php74\\php.ini "`nzend_extension=xdebug"
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "jborean93/WindowsServer2019"
config.vm.provision "shell", inline: $script
config.vm.synced_folder "../../../", "C:\\Users\\vagrant\\uuid"
config.vm.provider "virtualbox" do |vb|
vb.name = "ramsey-uuid-windows"
end
end