Laptop is tested by using it to provision a fresh VM. The process is lengthy but scripted, and relies on Vagrant.
Currently, only the linux script is tested, and only on the precise distribution. See the dedicated section for information about OSX testing.
- From the repository root, execute
./test/runner.sh
For each file found at ./test/Vagrantfile.*
:
- Vagrant creates and starts a VM as described by the Vagrantfile
- The appropriate laptop script is run inside the VM
- Some assertions are made against the VMs state
- Vagrant stops and destroys the VM
The following are the assertions:
- The VM was brought up successfully
- The laptop script(s) ran successfully
- The VM reports the correct
$SHELL
- The VM reports the correct ruby
Adding additional linux tests via this framework should be easy: simply add a new Vagrantfile under the test directory which uses a base box with the desired distribution.
OSX will need to be handled specially:
- The VMware provider will have to be used
- Building an OSX base box may or may not be easy
- The resulting test can only be run on an OSX host