{"id":155,"date":"2015-03-23T08:18:55","date_gmt":"2015-03-22T23:18:55","guid":{"rendered":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2015\/03\/23\/circleci-protractor-parallel"},"modified":"2022-10-26T10:02:20","modified_gmt":"2022-10-26T01:02:20","slug":"circleci-protractor-parallel","status":"publish","type":"post","link":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2015\/03\/23\/circleci-protractor-parallel\/","title":{"rendered":"CirlcleCI \u3067\u5b9f\u884c\u3057\u3066\u3044\u308b Protractor \u30c6\u30b9\u30c8\u3092\u4e26\u5217\u5b9f\u884c\u3057\u3066\u307f\u305f"},"content":{"rendered":"

CirlcleCI \u3067\u5b9f\u884c\u3057\u3066\u3044\u308b Protractor \u30c6\u30b9\u30c8\u3092\u4e26\u5217\u5b9f\u884c\u3057\u3066\u307f\u305f<\/h3>\n

\u6700\u8fd1 Protractor \u306e\u30c6\u30b9\u30c8\u304c CircleCI \u5074\u306e\u30c6\u30b9\u30c8\u74b0\u5883\u306e\u8ca0\u8377\u304c\u9ad8\u304f\u306a\u3063\u3066\u3044\u308b\u305b\u3044\u304b\u3001\u305f\u3073\u305f\u3073\u30b3\u30b1\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u304d\u305f\u3002
\u30ed\u30fc\u30ab\u30eb\u306e\u958b\u767a\u74b0\u5883\u3067\u306f\u901a\u308b\u306e\u306b\u3002
\u30c6\u30b9\u30c8\u304c\u30b3\u30b1\u308b\u5834\u6240\u3082\u5b9f\u884c\u3059\u308b\u3068\u304d\u306b\u3088\u3063\u3066\u9055\u3063\u305f\u308a\u3001\u518d\u5ea6\u5b9f\u884c\u3059\u308b\u3068\u554f\u984c\u306a\u304f\u901a\u3063\u305f\u308a\u3001\u3068\u3044\u3046\u72b6\u6cc1\u3060\u3002
\u307e\u305f\u3001\u30c6\u30b9\u30c8\u306e\u5b9f\u884c\u6642\u9593\u308225\u5206\u524d\u5f8c\u304b\u304b\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u304d\u305f\u3002<\/p>\n

\u305d\u3053\u3067\u3001Protractor \u306e\u30c6\u30b9\u30c8\u30923\u3064\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u5206\u5272\u3057\u3066\u4e26\u5217\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u3066\u307f\u305f\u3002<\/p>\n

CircleCI \u306e\u6599\u91d1\u30d7\u30e9\u30f3<\/h3>\n

CircleCI \u3067\u8907\u6570\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u52d5\u304b\u3059\u306b\u306f\u3001\u6709\u6599\u30d7\u30e9\u30f3\u306e\u5951\u7d04\u304c\u5fc5\u8981\u3068\u306a\u308b\u3002
CircleCI \u306f\u3001\u7121\u6599\u30d7\u30e9\u30f3\u3060\u30681\u30b3\u30f3\u30c6\u30ca\u306e\u307f\u3001\u8ffd\u52a0\u306e1\u30b3\u30f3\u30c6\u30ca\u3054\u3068\u306b$50\u3068\u3044\u3046\u6599\u91d1\u4f53\u7cfb\u3002 <\/p>\n

CircleCI \u5074\u306e\u8a2d\u5b9a<\/h3>\n

\u8907\u6570\u306e\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001CircleCI \u5074\u3067\u8a2d\u5b9a\u304c\u5fc5\u8981\u3068\u306a\u308b\u3002
\u4e0b\u8a18\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u53c2\u8003\u306b\u306a\u308b\u3002
https:\/\/circleci.com\/docs\/setting-up-parallelism<\/a>
https:\/\/circleci.com\/docs\/parallel-manual-setup<\/a> <\/p>\n

CircleCI \u306e Project Settings \u304b\u3089\u3001\u5909\u66f4\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u6570\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3002
\"\u30b3\u30f3\u30c6\u30ca\u6570\u5909\u66f4\u753b\u9762\"
\u4e0a\u8a18\u306f\u30013\u3064\u30b3\u30f3\u30c6\u30ca\u3092\u9078\u629e\u3057\u305f\u5834\u5408\u3002 <\/p>\n

circle.yml \u4fee\u6b63<\/h3>\n

\u305d\u306e\u307e\u307e\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u30011\u3064\u76ee\u306e\u30b3\u30f3\u30c6\u30ca\u3067\u3057\u304b Protractor \u306e\u30c6\u30b9\u30c8\u304c\u901a\u3089\u306a\u3044\u306f\u305a\u3002
\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u8d77\u52d5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u30b5\u30fc\u30d0\u30fc\u304c1\u3064\u76ee\u3067\u3057\u304b\u5b9f\u884c\u3055\u308c\u306a\u3044\u305f\u3081\u3067\u3042\u308b\u3002
3\u3064\u306e\u30b3\u30f3\u30c6\u30ca\u3067\u5b9f\u884c\u3055\u305b\u308b\u3088\u3046\u306b\u3001circle.yml \u306e\u4fee\u6b63\u3082\u5fc5\u8981\u3068\u306a\u3063\u3066\u304f\u308b\u3002 <\/p>\n

\u3010\u4fee\u6b63\u524d\u3011<\/p>\n

test:\n  pre:\n    - grunt serve:\n      background: true\n    - sleep 5<\/code><\/pre>\n

\u3010\u4fee\u6b63\u5f8c\u3011 <\/p>\n

test:\n  pre:\n    - grunt serve:\n        background: true\n        parallel: true\n    - sleep 5:\n        parallel: true\n  override:\n    - bash test.sh:\n        parallel: true<\/code><\/pre>\n

parallel: true<\/code> \u3092\u5404\u30b3\u30f3\u30c6\u30ca\u3067\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u51e6\u7406\u306b\u8ffd\u52a0\u3059\u308b\u3002
\u307e\u305f\u3001\u30c6\u30b9\u30c8\u306b\u3064\u3044\u3066\u4e26\u5217\u5b9f\u884c\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3001override<\/code> \u306b\u8a18\u8ff0\u3059\u308b\u3002 <\/p>\n

\u30c6\u30b9\u30c8\u5b9f\u884c\u7528\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8<\/h3>\n

\u30b5\u30f3\u30d7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8<\/h4>\n

\u3053\u3061\u3089<\/a>\u306b\u4f8b\u793a\u3057\u3066\u3044\u3042\u308b\u30b5\u30f3\u30d7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30d9\u30fc\u30b9\u306b\u4fee\u6b63\u3059\u308b\u3002 <\/p>\n

\u3010\u30b5\u30f3\u30d7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3011<\/p>\n

#!\/bin\/bash\n\ni=0\nfiles=()\nfor file in $(find .\/test -name "*.py" | sort)\ndo\n  if [ $(($i % $CIRCLE_NODE_TOTAL)) -eq $CIRCLE_NODE_INDEX ]\n  then\n    files+=" $file"\n  fi\n  ((i++))\ndone\n\ntest-runner ${files[@]}<\/code><\/pre>\n
\u74b0\u5883\u5909\u6570<\/h5>\n

\u30b9\u30af\u30ea\u30d7\u30c8\u5185\u306b\u5165\u3063\u3066\u3044\u308b\u74b0\u5883\u5909\u6570\u306b\u3064\u3044\u3066\u3002 <\/p>\n

CIRCLE_NODE_TOTAL<\/h6>\n

\u30d3\u30eb\u30c9\u306b\u4f7f\u7528\u3055\u308c\u308b\u30b3\u30f3\u30c6\u30ca\u306e\u5408\u8a08\u6570\u3002 <\/p>\n

CIRCLE_NODE_INDEX<\/h6>\n

\u30d3\u30eb\u30c9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u306e\u756a\u53f7\u30020\u304b\u3089\u59cb\u307e\u308b\u3002 <\/p>\n

\u30b9\u30af\u30ea\u30d7\u30c8\u4fee\u6b63<\/h5>\n

\u30b5\u30f3\u30d7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u57fa\u306b\u3001Protractor \u7528\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4fee\u6b63\u3059\u308b\u3002 <\/p>\n

#!\/bin\/bash\n\ni=0\nfor file in $(find .\/test -name "*E2Etest.coffee" | sort)\ndo\n  if [ $(($i % $CIRCLE_NODE_TOTAL)) -eq $CIRCLE_NODE_INDEX ]; then\n    grunt test --specs $file\n    RETURN_CD=$?\n    if [ $RETURN_CD -ne 0 ]; then\n      exit $RETURN_CD\n    fi\n  fi\n  ((i++))\ndone<\/code><\/pre>\n

test<\/code> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u3001*E2Etest.coffee<\/code> \u3092\u30bd\u30fc\u30c8\u3057\u3066\u30011\u3064\u76ee\u306e\u30b3\u30f3\u30c6\u30ca\u30012\u3064\u76ee\u306e\u30b3\u30f3\u30c6\u30ca\u3068\u3044\u3046\u3088\u3046\u306b\u3001\u6a5f\u68b0\u7684\u306b\u5404\u30b3\u30f3\u30c6\u30ca\u306b\u632f\u308a\u5206\u3051\u3066\u30011\u3064\u305a\u3064\u5b9f\u884c\u3057\u3066\u3044\u304f\u5f62\u306b\u3057\u305f\u3002
\u9014\u4e2d\u3001\u30c6\u30b9\u30c8\u304c\u901a\u3089\u306a\u304b\u3063\u305f\u3089 exit<\/code> \u3067\u51e6\u7406\u3092\u629c\u3051\u308b\u3088\u3046\u306b\u4fee\u6b63\u3002
(\u3053\u308c\u3092\u5165\u308c\u306a\u3044\u3068\u3001\u30c6\u30b9\u30c8\u304c\u901a\u308b\u3001\u901a\u3089\u306a\u3044\u306b\u304b\u304b\u308f\u3089\u305a\u3059\u3079\u3066\u6b63\u5e38\u7d42\u4e86\u3057\u3066\u3057\u307e\u3046\u305f\u3081) <\/p>\n

\u30c6\u30b9\u30c8\u5b9f\u884c<\/h5>\n

\u4e0a\u8a18\u3092\u5b9f\u88c5\u5f8c\u306b\u3001\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8907\u6570\u306e\u30b3\u30f3\u30c6\u30ca\u3067\u30c6\u30b9\u30c8\u304c\u4e26\u5217\u5b9f\u884c\u3055\u308c\u308b\u3002
\"\u8907\u6570\u30b3\u30f3\u30c6\u30ca\u3067\u4e26\u5217\u5b9f\u884c\" <\/p>\n

\u4eca\u5f8c\u306e\u5bfe\u5fdc\u3068\u3057\u3066<\/h3>\n

\u4eca\u56de\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u5185\u306e\u30c6\u30b9\u30c8\u632f\u308a\u5206\u3051\u306e\u90e8\u5206\u3092\u3001\u4f55\u3082\u8003\u3048\u305a\u306b\u6a5f\u68b0\u7684\u306b\u632f\u308a\u5206\u3051\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001\u30c6\u30b9\u30c8\u306e\u5b9f\u884c\u51e6\u7406\u6642\u9593\u306b\u305d\u308c\u307b\u3069\u5927\u304d\u306a\u5dee\u306f\u306a\u304b\u3063\u305f\u3002
(1\u3064\u306e\u30b3\u30f3\u30c6\u30ca\u306b\u91cd\u3044\u30c6\u30b9\u30c8\u304c\u96c6\u4e2d\u3057\u3066\u3057\u307e\u3063\u305f\u305f\u3081)
\u30c6\u30b9\u30c8\u306e\u632f\u308a\u5206\u3051\u3092\u5404\u30b3\u30f3\u30c6\u30ca\u3067\u3046\u307e\u304f\u632f\u308a\u5206\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308c\u3070\u30c6\u30b9\u30c8\u306e\u5b9f\u884c\u6642\u9593\u3092\u304b\u306a\u308a\u524a\u6e1b\u3067\u304d\u305d\u3046\u3067\u306f\u3042\u308b\u3002
\u4eca\u5f8c\u306f\u3053\u306e\u3042\u305f\u308a\u306e\u6539\u5584\u3092\u3057\u3066\u884c\u304d\u305f\u3044\u3002<\/p>\n

CircleCI\u3092\u6d3b\u7528\u3057\u305f\u7d99\u7d9a\u7684\u30a4\u30f3\u30c6\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306b\u3088\u308b\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u30fb\u30e2\u30d0\u30a4\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a<\/a>\u3092\u3054\u691c\u8a0e\u306e\u4f01\u696d\u69d8\u306f\u3001\u662f\u975eMMM\u306b\u3054\u76f8\u8ac7\u4e0b\u3055\u3044\u307e\u305b\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

CirlcleCI \u3067\u5b9f\u884c\u3057\u3066\u3044\u308b Protractor \u30c6\u30b9\u30c8\u3092\u4e26\u5217\u5b9f\u884c\u3057\u3066\u307f\u305f \u6700\u8fd1 Protractor \u306e\u30c6\u30b9\u30c8\u304c CircleCI \u5074\u306e\u30c6\u30b9\u30c8\u74b0\u5883\u306e\u8ca0\u8377\u304c\u9ad8\u304f\u306a\u3063\u3066\u3044\u308b\u305b\u3044\u304b\u3001\u305f\u3073\u305f\u3073\u30b3\u30b1\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u304d\u305f\u3002\u30ed\u30fc\u30ab\u30eb\u306e\u958b\u767a\u74b0\u5883\u3067\u306f\u901a\u308b\u306e\u306b\u3002\u30c6\u30b9\u30c8\u304c\u30b3\u30b1\u308b\u5834\u6240\u3082\u5b9f\u884c\u3059\u308b\u3068\u304d\u306b\u3088\u3063\u3066\u9055\u3063\u305f\u308a\u3001\u518d\u5ea6\u5b9f\u884c\u3059\u308b\u3068\u554f\u984c\u306a\u304f\u901a\u3063\u305f\u308a\u3001\u3068\u3044\u3046\u72b6\u6cc1\u3060\u3002\u307e\u305f\u3001\u30c6\u30b9\u30c8\u306e\u5b9f\u884c\u6642\u9593\u308225\u5206\u524d\u5f8c\u304b\u304b\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u304d […]<\/p>\n","protected":false},"author":3,"featured_media":684,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[44],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/155"}],"collection":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/comments?post=155"}],"version-history":[{"count":1,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":3356,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/155\/revisions\/3356"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}