Joh*_*nyC 3 testing parallel-processing continuous-integration circleci
我用circle来运行JS和PHP测试(Protractor/Phpunit).
我想使用并行来赢得时间,但我不知道配置并行性.我激活圆参数(2个容器)中的并行度.
我的实际圈子配置(circle.yml):
# Depend de app/config/parameters.circle.yml (parametre symfony pour circle) et app/config/apache.circle (configuration d'Apache pour Circle)
# Configuration du serveur
machine:
php:
version: 5.4.21
timezone:
Europe/Paris
hosts:
bluegrey.circle.dev: 127.0.0.1
dependencies:
pre:
# SauceConnect (Angular)
- wget https://saucelabs.com/downloads/sc-latest-linux.tar.gz
- tar -xzf sc-latest-linux.tar.gz
- ./bin/sc -u johnnyEvo -k xxx:
background: true
pwd: sc-*-linux
# Installation protractor (Angular)
- npm install -g protractor
# On active XDebug
- sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/conf.d/xdebug.ini
- echo "xdebug.max_nesting_level = 250" > ~/.phpenv/versions/$(phpenv global)/etc/conf.d/xdebug.ini
# Configuration d'Apache
- cp app/config/apache.circle /etc/apache2/sites-available
- a2ensite apache.circle
- sudo service apache2 restart
override:
# Composer
- composer install --prefer-source --no-interaction
post:
# Assets
- app/console assetic:dump
# Parameters
- cp app/config/parameters.circle.yml.dist app/config/parameters.yml
database:
pre:
# Base de données (test)
- app/console doctrine:database:create --env=test --no-interaction
- app/console doctrine:schema:update --force --env=test --no-interaction
# Base de données (prod/ angular)
- app/console doctrine:database:drop --no-interaction --force
- app/console doctrine:database:create --no-interaction
- app/console doctrine:schema:update --force --no-interaction
# Fixture
- app/console doctrine:fixture:load --no-interaction
test:
pre:
# Permission pour que Protractor puisse naviguer le site
- sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs app/sessions
- sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs app/sessions
override:
- php -d memory_limit=-1 bin/phpunit -c app
- protractor angutest
Run Code Online (Sandbox Code Playgroud)
谢谢
小智 5
我是CircleCI开发者之一.
最直接的方法是在一个容器上运行PHP测试,在另一个容器上运行JS测试,如果它们具有大致相似的运行时,那么您将获得好处而无需手动拆分测试套件.
在这种情况下,类似下面的东西会起作用:
test:
override:
- case $CIRCLE_NODE_INDEX in 0) php -d memory_limit=-1 bin/phpunit -c app ;; 1) protractor angutest ;; esac:
parallel: true
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
934 次 |
| 最近记录: |