oprudkyi/codeception-events-scripting 问题修复 & 功能扩展

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

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

oprudkyi/codeception-events-scripting

Composer 安装命令:

composer require oprudkyi/codeception-events-scripting

包简介

The Codeception extension for automatically running shell scripts on codeception events

README 文档

README

oprudkyi/codeception-events-scripting The Codeception extension for automatically running shell scripts on codeception events.

Latest Stable Version Total Downloads License Build Status

About

Run shell scripts on codeception's events - before/after tests/suites (like db seeding, stopping-running additional software etc.) Inspired by Phantoman extension for Codeception, though allow to run anything in more generic way.

Minimum Requirements

  • Codeception 2.1.0
  • PHP 5.5

Installation

This project can be installed via Composer. To get the latest version, simply add the following line to the require block of your composer.json file:

{
    "require-dev": {
            "oprudkyi/codeception-events-scripting": "*"
    }

}

You'll then need to run composer install or composer update to download the package and have the autoloader updated.

Or run the following command:

    composer require oprudkyi/codeception-events-scripting --dev

Configuration

Enable extension in the codeception.yml and write commands. Next events are supported:

  • BeforeAll - run before tests on every "codecept run"
  • AfterAll - run after all tests
  • BeforeSuite - run before each suite (use 'suites' array to run only for selected suites)
  • AfterSuite - run after each suite (use 'suites' array to run only for selected suites)

supported next attributes:

  • command - command line to run (for one-liners you can write command directly)
  • description - echoed before command
  • params - additional params for command
  • ignoreErrors - don't break testing if command fails (failed or retval != 0)
  • suites - single name or array of suites to run command for (applied to base name, like 'acceptance' as well to long name 'acceptance (phantom, firefox)')
  • environments - single name or array of environments
  • platforms - single name or array of platforms (uses PHP_OS constant, i.e. the platform where PHP was built, check here for details)
extensions:
    enabled:
        - Codeception\Extension\EventsScripting
    config:
        Codeception\Extension\EventsScripting:
            BeforeAll:
                - command: echo "Before All"
                - command: echo "Before All with Description"
                  description: Description of command
                - echo "Before All single line"
                - command: echo 
                  params: "Before All Params"
                  description: Before All with Params
                - command: "false"
                  description: BeforeAll. fail on run but ignore errors
                  ignoreErrors: true
            AfterAll:
                - command: echo "After All"
                - command: uname
                  description: Platform *nx-like
                  platforms: [darwin, linux, bsd, unix]
                - command: ver
                  description: Platform Windows
                  platforms: windows
            BeforeSuite:
                - command: echo "Before acceptance suite"
                  suites: ['acceptance']
                - command: echo "Before any suite"
                - command: echo "Before acceptance suite, phantom environment"
                  suites: ['acceptance']
                  environments: phantom
                - command: echo "Before acceptance suite, phantom,chrome environments"
                  suites: ['acceptance']
                  environments: ['phantom', 'chrome']
            AfterSuite:
                - command: echo "After acceptance suite"
                  suites: 'acceptance'
                - command: echo "After any suite"

Real example (start/stop mailcatcher and seed db):

        Codeception\Extension\EventsScripting:
          BeforeAll:
              - command: ./artisan db:seed-test --env=testing
                description: Reset db and seed
          BeforeSuite:
              - command: GEM_HOME=vendor/ruby vendor/ruby/bin/mailcatcher --ip 127.0.0.1 --smtp-port 11031 --http-port 11091
                suites: 'acceptance' 
                description: Start mailcatcher
          AfterSuite:
              - command: curl -s -X DELETE http://127.0.0.1:11091
                suites: 'acceptance' 
                description: Stop mailcatcher
                ignoreErrors: true

Testing

cd sample
composer install -n --prefer-source
cd ../test
composer install -n --prefer-source
./vendor/bin/codecept run

Contribute

This package is (yet) under development and refactoring but is ready for production. Please, feel free to comment, contribute and help. I will be happy to get some help to deliver tests.

License

Codeception's events scripting is licensed under The MIT License (MIT).

oprudkyi/codeception-events-scripting 适用场景与选型建议

oprudkyi/codeception-events-scripting 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 58.41k 次下载、GitHub Stars 达 12, 最近一次更新时间为 2016 年 04 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 oprudkyi/codeception-events-scripting 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 58.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 11
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-25