承接 kylekatarnls/multi-tester 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kylekatarnls/multi-tester

Composer 安装命令:

composer require kylekatarnls/multi-tester

包简介

Test your package change inside other packages

README 文档

README

Latest Stable Version PHP Version License GitHub Actions StyleCI Test Coverage Dependencies

When you get multiple projects with strong dependencies between themselves or a project that many other depends on and make a change on one of them, you not only want this project's unit tests to pass, but all other to still pass considering this change. Even with a full coverage of each project, it's not rare to get a project broken by a very small change in one of its dependencies despite that change seemed pretty harmless.

If you package manager is composer, here comes multi-tester to the rescue. It will allow you to run unit tests of other project(s) replacing your package in their vendor directory with the current state of your package.

multi-tester is Travis CI friendly. Packages with .travis.yml will automatically be handled using Travis CI standard commands.

Installation

You first need to use composer for your project and have a composer.json file at the root of your project with a "name" property defined (it will be used to replace the code of your project from the vendor directory of other projects with the current changes).

Then you need to install multi-tester as a development dependency:

composer require kylekatarnls/multi-tester --dev

Use

Once installed, the local command vendor/bin/multi-tester will be available.

With --add option it will create .multi-tester.yml (or the config file you passed as first argument) if it does not exist and add a project with default settings in it.

Without --add it will run tests on specified projects in the config file.

# Add a project:
vendor/bin/multi-tester --add=nesbot/carbon

# Run the tests:
vendor/bin/multi-tester

Without argument, it will try to load its configuration from .multi-tester.yml file in the current directory. But you can specify an other location as the first argument: vendor/bin/multi-tester ./directory/config.json (config file can be a .json or a .yml).

You also can get detailed output with -v or --verbose flag.

Configuration

The .multi-tester.yml config file is where you will list projects and how to download, install and test them.

config: # config entry is optional, it's about main config
  # By default, multi-tester assumes composer.json is in the same directory than .multi-tester.yml
  # But you can customize it to a relative path:
  directory: ../foobar

# Specify a vendor/package name as entry
symfony/symfony:
  # Specify how to download the project:
  clone: git clone https://github.com/symfony/symfony.git .
  # Specify how to install dependencies of the project:
  install: composer install
  # Specify how to run unit tests of the project:
  script: vendor/bin/phpunit

my-org/an-other-project: ...

All entry of a project configuration are optionals.

If you don't specify clone, multi-tester will check the package name at packagist.org (composer registry) and get the Git url from it (other VCS are not supported yet). Instead of clone, you can also specify a version entry to filter packages versions (using packagist.org API). Without version, the last stable will be used.

symfony/symfony:
  version: ^3.2 # can be any semver string: >4.5, ~3.1.0, etc.

# You can pass the version string directly in the package name,
# so you can run the same package at different versions
symfony/symfony:5.4.*: default # 'default' means all settings use the default one

If you don't specify install, composer install --no-interaction will be used by default.

If you don't specify script, vendor/bin/phpunit --no-coverage will be used by default.

If you set install: travis, multi-tester will copy the install command from the .travis.yml file of the package you test.

If you set script: travis, multi-tester will copy the script command from the .travis.yml file of the package you test.

To get both from .travis.yml, use the shortcut:

symfony/symfony:5.4.*: travis

Travis

To not have to check manually with multi-tester, you should have it in your CI (continuous integration) process. For example if you use Travis, here is how to integrate in it and then get every project tested at each commit.

Let's say you have the following .travis.yml:

language: php

php:
  - 7.1
  - 7.2
  - 7.3

install:
  - composer install

script:
  - vendor/bin/phpunit

Then you can add a line for multi-tester to your builds with:

language: php

matrix:
  include:
    - php: 7.1
    - php: 7.2
    - php: 7.3
    - php: 7.3
      env: MULTITEST='on'

install:
  - composer install

script:
  - if [ "$MULTITEST" != "on" ]; then vendor/bin/phpunit; fi;
  - if [ "$MULTITEST" = "on" ]; then vendor/bin/multi-tester; fi;

kylekatarnls/multi-tester 适用场景与选型建议

kylekatarnls/multi-tester 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 381.08k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 02 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 kylekatarnls/multi-tester 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 381.08k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 16
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-02