lightspeedphp/lightspeed 问题修复 & 功能扩展

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

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

lightspeedphp/lightspeed

Composer 安装命令:

composer require --dev lightspeedphp/lightspeed

包简介

Run tests faster by splitting them across nodes.

README 文档

README

Installation

Install with composer:

composer require --dev lightspeedphp/lightspeed

Usage

Once installed, you can immediately run php vendor/bin/lightspeed to execute your tests. It will proxy to PHPUnit or to Pest if you have it installed.

Lightspeed is best used within CI where it can run on multiple machines at once to parallelise the execution of your tests. It currently supports GitHub Actions and Buildkite.

GitHub Actions

Here is an example workflow file to execute your tests in parallel. Note you must set the env vars manually for tests to be correctly split between jobs.

name: Demo

on: ['push']

jobs:
  ci:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node_count: [3]
        node_index: [0, 1, 2]

    name: Demo

    steps:
    - name: Checkout
      uses: actions/checkout@v3

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: 8.0
        tools: composer:v2
        coverage: none

    - name: Install PHP dependencies
      run: composer update --no-interaction --no-progress

    - name: Tests (${{ matrix.node_index}})
      env:
        LIGHTSPEED_NODE_COUNT: ${{ matrix.node_count }}
        LIGHTSPEED_NODE_INDEX: ${{ matrix.node_index }}
      run: php vendor/bin/lightspeed --colors=always

Buildkite

Buildkite is supported out of the box by setting the parallelism command step attribute. You can parallelise your test steps with as much agents as you can to minimise test time.

steps:
  - label: ':php: Run tests'
    commands:
      - composer update --no-interaction --no-progress
      - php vendor/bin/lightspeed
    parallelism: 3
    plugins:
      - docker#v4.14.0:
          image: composer:2
          propagate-environment: true

License

Lightspeed is licensed under the BSD 4-Clause License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-4-Clause
  • 更新时间: 2023-08-29