knectar/behat-ci 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

knectar/behat-ci

Composer 安装命令:

composer create-project knectar/behat-ci

包简介

A console application that schedules, generates configurations, and runs behat tests on a server

README 文档

README

Scrutinizer Code Quality

Introduction

Behat continuous integration CLI is an efficient way to manage Behat configurations and have Behat testing run automatically when a project is updated. It will also generate a custom Behat.yml configuration file for you. All you have to do is specify the profiles.

System requirements

Installation

  1. Include behat-ci in your global composer.json with composer global require knectar/behat-ci
  2. Run composer global update to install (No database configuration needed.)
  3. Run composer install in the directory where the app was saved. (usually /home/user/.composer/vendor/knectar/behat-ci/app)
  4. Update your system PATH to include the application's app directory (path/to/global/.composer/vendor/knectar/behat-ci/app)
  5. That is all, we can now run this application's commands!

Configuration

The smooth running of behat-ci relies on several files working in synchrony.

bhqueue.txt is a simple text file that keeps track of when tests are scheduled to be run, written to by the bh schedule command.

profiles.yml is a list of device profiles as well as default Behat configuration. Feel free to add more and customize according to the current standards and what is available on sauce labs. See the sample files for use as a template.

projects.yml is a list of your projects that to run tests against. It will contain an entry per project, structured as follows:

whitetest: #the overall project name. uses the beanstalkapp machine name
  environments: # should match the branch
    -dev:
        base_url: http://example.com
        features: /path/to/project/features/directory
    -production:
        base_url: http://example.com
        features: /path/to/project/features/directory
  profiles: #to run as set in profiles.yml
    - win-chrome
    - android
    - iPhone
  behat-params: #optional additional parameters
        format: html
        out: /path/to/output.html

Note: by default, projects.yml, profiles.yml, bhqueue, and bhqueuelog are located in the /etc/behat-ci/ directory. Trigger will look for profiles.yml and projects.yml to be set up in /etc/behat-ci or in the user's home directory. Otherwise the absolute paths to the files must be set in config.yml so the command knows where to look.

Usage

For details on the commands in the console, simply run

bh

The application relies on 2 key commands,

bh schedule

Is to be called when changes are pushed (or manually). This command will

  1. Update bhqueue.txt, which tells the application that tests need to be run.

  2. Generate the .yml configuration file required to run customized Behat configurations. This file will be stored in /tmp and disposed of by the 'trigger' command. You may use behat-ci to just generate behat.yml files and execute behat testing manually by running bh schedule $projname -b $branchname followed by behat -c /tmp/project_env.yml

    bh trigger Is meant to be called periodically (every minute) by cron on the server. It checks bhqueue to see if a change has been made in the project and if testing needs to be done. It will run the Behat tests as needed with the specified flags/parameters.

To run tests manually in a single command, run

bh test

with the same input arguments as bh schedule, and the application will perform schedule and trigger consecutively.

knectar/behat-ci 适用场景与选型建议

knectar/behat-ci 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 124 次下载、GitHub Stars 达 3, 最近一次更新时间为 2015 年 08 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「testing」 「Behat」 「continuous integration」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 knectar/behat-ci 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 knectar/behat-ci 我们能提供哪些服务?
定制开发 / 二次开发

基于 knectar/behat-ci 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 7
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-04