pedrotroller/circle-parallel-tests-builder

为 Circle CI 构建并行测试集的简单方法

v1.0.0 2016-01-07 18:23 UTC

This package is auto-updated.

Last update: 2024-09-19 02:41:42 UTC


README

为 Circle CI 构建并行测试集的简单方法

简介

此工具将为您创建测试套件。它专为 circle-ci 设计,但您也可以与其他工具一起使用。

安装

composer require pedrotroller/circle-parallel-tests-builder --dev

一个二进制文件(circle-tests)已添加到您的二进制目录。

配置

您只需在项目根目录下创建一个名为 circle-tests.yml 的文件,并遵循以下模式

"<my_test>": <weigth>
"<my_test>": <weigth>
"<my_test>": <weigth>

其中 my_test 是要执行的命令,而 weigth 是表示命令执行重量的数字(例如可以是持续时间)。

用法

您可以使用以下命令显示套件

./bin/circle-tests display -t 3 # Will split your tests into 3 suites

您可以使用以下命令启动套件

./bin/circle-tests -i 0 -t 3 # -i represent the index (0 based) of the desired suite

Circle-CI 用例

# ./circle-tests.yml
'bin/behat --no-snippets --tags=~disabled --verbose features/api': 21
'bin/behat --no-snippets --tags=~disabled --verbose features/manager': 50
'bin/phpspec run -fpretty --verbose': 1
'bin/install dev demo': 4
'bin/install prod && app/console doctrine:schema:validate -e=prod': 2
# ./circle.yml
general: # ...

machine: # ...

dependencies: # ...

test:
    override:
        - bin/circle-tests run --index=$CIRCLE_NODE_INDEX --total=$CIRCLE_NODE_TOTAL:
            parallel: true