2017 © Pedro Peláez
 

library testrunner

image

ekandreas/testrunner

  • Monday, January 11, 2016
  • by EkAndreas
  • Repository
  • 1 Watchers
  • 1 Stars
  • 189 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

WordPress Plugin Test Helper with Docker

License, (*1)

*** WORK IN PROGRESS ***, (*2)

When you develop a plugin for WordPress it's important to also build test cases and use them continuous., (*3)

This package is a helper to run tests within your plugin folder but use Docker as a testing instance and report generator., (*4)

The testsuite should be placed within a plugin that's going to be tested., (*5)

root
│   wp-admin
└───wp-content
    ├───plugins
    │   ├───your-plugin <- install with composer require ekandreas/testrunner:*
    │   │   ...

Note! First time is going to take a long time due to creating images and installing wordpress-develop folder, etc., (*6)

To continuously run tests to a plugin use the partitial test command:, (*7)

dep tests:run

Requirements

  • Docker-machine with VirtualBox
  • PHP Composer

Setup

Install this lib with composer, eg:, (*8)

composer require ekandreas/testrunner:dev-master

Now create a deployment file in root of your plugin, eg:, (*9)

<!-- deploy.php -->
date_default_timezone_set('Europe/Stockholm');
include_once 'vendor/ekandreas/testrunner/recipe.php';

You can now enjoy tests with docker with the following deployment command:, (*10)

vendor/bin/dep tests

This is only the first time, aprox 10 min first time., (*11)

And with continuous tests:, (*12)

vendor/bin/dep tests:run

Only seconds to a test report., (*13)

Deploy file example


<?php
date_default_timezone_set('Europe/Stockholm');

include_once 'vendor/ekandreas/testrunner/recipe.php';

set( 'docker_host_name', 'tests');

Complete run

vendor/bin/dep tests

Partitial run

Booting up Docker and make installation

dep tests:up

Rebuild Docker container images

dep tests:rebuild

Running just the tests (after tests:up)

dep tests:run

Stop the tests

This will kill the containers, (*14)

dep tests:stop

Killing Docker machine

This will kill the virtual test machine, (*15)

dep tests:kill

Recipe parameters, options

If you don't want to use the default docker-machine, define your own, eg:, (*16)

<!-- deploy.php -->
date_default_timezone_set('Europe/Stockholm');
include_once 'vendor/ekandreas/testrunner/recipe.php';
set( 'docker_host_name', 'tests');

If you don't have a docker machine setup then the deploy script will try to create it for you. Virtualbox as default., (*17)

TODO

  • Just one single command dep tests to check and startup mysql and install if missing.

The Versions

11/01 2016

dev-master

9999999-dev

  Sources   Download

11/01 2016

0.3.1

0.3.1.0

  Sources   Download

11/01 2016

0.3

0.3.0.0

  Sources   Download

11/01 2016

0.2

0.2.0.0

  Sources   Download

10/01 2016

0.1

0.1.0.0

  Sources   Download