定制 ekandreas/testrunner 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ekandreas/testrunner

Composer 安装命令:

composer require ekandreas/testrunner

包简介

README 文档

README

License

*** WORK IN PROGRESS ***

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

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

The testsuite should be placed within a plugin that's going to be tested.

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.

To continuously run tests to a plugin use the partitial test command:

dep tests:run

Requirements

  • Docker-machine with VirtualBox
  • PHP Composer

Setup

Install this lib with composer, eg:

composer require ekandreas/testrunner:dev-master

Now create a deployment file in root of your plugin, eg:

<!-- 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:

vendor/bin/dep tests

This is only the first time, aprox 10 min first time.

And with continuous tests:

vendor/bin/dep tests:run

Only seconds to a test report.

Deploy file example

<!-- deploy.php -->
<?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

dep tests:stop

Killing Docker machine

This will kill the virtual test machine

dep tests:kill

Recipe parameters, options

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

<!-- 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.

TODO

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

统计信息

  • 总下载量: 334
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-01-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固