{"id":20040,"date":"2023-01-17T08:47:49","date_gmt":"2023-01-17T08:47:49","guid":{"rendered":"https:\/\/44.225.35.201\/testrail\/docs\/753\/integration-guide\/test-automation\/integrating-with-jenkins\/"},"modified":"2023-03-28T11:49:17","modified_gmt":"2023-03-28T02:49:17","slug":"jenkins","status":"publish","type":"page","link":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/integration-guide\/test-automation\/jenkins\/","title":{"rendered":"Jenkins \u3068\u306e\u7d71\u5408"},"content":{"rendered":"<p>Jenkins \u306f\u4e3b\u8981\u306a\u30aa\u30fc\u30d7\u30f3 \u30bd\u30fc\u30b9\u306e\u81ea\u52d5\u5316\u30b5\u30fc\u30d0\u30fc\u3067\u3042\u308a\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d3\u30eb\u30c9\u3001\u30c7\u30d7\u30ed\u30a4\u3001\u81ea\u52d5\u5316\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u591a\u6570\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002Jenkins \u306f\u5358\u306b CI \u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3001\u7d99\u7d9a\u7684\u30c7\u30ea\u30d0\u30ea\u30fc\u306e\u30cf\u30d6\u3068\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u3001Web \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u4f7f\u7528\u3057\u305f\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3068\u8a2d\u5b9a\u304c\u5bb9\u6613\u3067\u3059\u3002<\/p>\n<p>Jenkins \u306e\u3088\u304f\u3042\u308b\u4f7f\u7528\u65b9\u6cd5\u306f\u3001\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u304c\u30b5\u30d6\u30df\u30c3\u30c8\u3055\u308c\u308b\u305f\u3073\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d3\u30eb\u30c9\u3068\u30c6\u30b9\u30c8\u3092\u884c\u3046\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002TestRail \u306e\u5229\u70b9\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3057\u3001\u624b\u52d5\u306e\u3082\u306e\u3082\u81ea\u52d5\u5316\u3055\u308c\u305f\u3082\u306e\u3082\u542b\u3081\u3066\u3059\u3079\u3066\u306e\u30c6\u30b9\u30c8 \u30b1\u30fc\u30b9\u304a\u3088\u3073\u30c6\u30b9\u30c8\u7d50\u679c\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u3001Jenkins \u304b\u3089\u76f4\u63a5 TestRail \u306b\u81ea\u52d5\u30c6\u30b9\u30c8\u306e\u7d50\u679c\u3092\u9001\u4fe1\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30de\u30cb\u30e5\u30a2\u30eb\u3067\u306f\u3001Jenkins \u3068 <a href=\"\/testrail-cli\/\" target=\"_blank\" rel=\"noopener\">TestRail CLI<\/a> \u3092\u5229\u7528\u3057\u3066\u7c21\u5358\u306b\u3053\u306e\u30bf\u30b9\u30af\u3092\u5b9f\u73fe\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2 id=\"01G95CXQ21W0F4A5QSG4FT8G06\">\u524d\u63d0\u6761\u4ef6<\/h2>\n<div class=\"callout callout--info\">\n<p class=\"callout__title callout__icon\"><em class=\"fas fa-info-circle\">\u00a0<\/em>[et_pb_text admin_label=&#8221;Note&#8221; _builder_version=&#8221;4.4.2&#8243; background_color=&#8221;#F0F8FF&#8221; hover_enabled=&#8221;0&#8243; border_width_all=&#8221;1px&#8221; border_color_all=&#8221;#b0c4de&#8221;]<\/p>\n<div class=\"callout callout--info\">\n<p>\u3053\u306e\u30de\u30cb\u30e5\u30a2\u30eb\u306e\u624b\u9806\u306f\u3001Python 3.10 \u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f Jenkins \u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3001<code class=\"inline-code\">python3.10<\/code> \u3068\u3044\u3046\u30a8\u30a4\u30ea\u30a2\u30b9\u3092\u4f7f\u7528\u3057\u3066 Python \u3092\u547c\u3073\u51fa\u305b\u308b\u3053\u3068\u3092\u524d\u63d0\u3068\u3057\u3066\u3044\u307e\u3059\u3002\u3059\u3067\u306b\u9069\u5207\u306b\u8a2d\u5b9a\u3055\u308c\u305f Jenkins \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u9032\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div>\n<p>[\/et_pb_text]<\/p>\n<\/div>\n<p>\u624b\u9806\u306b\u5f93\u3063\u3066\u3059\u3070\u3084\u304f Jenkins \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u6b21\u306e Dockerfile (<a href=\"https:\/\/hub.docker.com\/r\/jenkins\/jenkins\" target=\"_blank\" rel=\"noopener noreferrer\">\u516c\u5f0f\u306e Jenkins Docker \u30a4\u30e1\u30fc\u30b8<\/a>\u3092\u57fa\u306b\u3057\u3066\u3044\u307e\u3059) \u3092\u30d3\u30eb\u30c9\u3057\u3001\u4ee5\u4e0b\u306e\u624b\u9806\u306b\u5f93\u3063\u3066\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol class=\"list-colored\">\n<li>\u6b21\u306e\u5185\u5bb9\u3092 Dockerfile \u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dockerfile\">FROM jenkins\/jenkins:lts\n\nUSER root\nRUN apt-get update\nRUN apt-get install -y \\\n        build-essential \\\n        zlib1g-dev \\\n        libncurses5-dev \\\n        libgdbm-dev \\\n        libnss3-dev \\\n        libssl-dev \\\n        libreadline-dev \\\n        libffi-dev \\\n        libsqlite3-dev \\\n        wget \\\n        libbz2-dev\nRUN wget https:\/\/www.python.org\/ftp\/python\/3.10.0\/Python-3.10.0.tgz &amp;&amp; \\\n        tar -xvf Python-3.10.0.tgz &amp;&amp; \\\n        cd Python-3.10.0 &amp;&amp; \\\n        .\/configure --enable-optimizations &amp;&amp; \\\n        make -j 2 &amp;&amp; \\\n        make altinstall &amp;&amp; \\\n        python3.10 --version\nUSER jenkins<\/pre>\n<\/li>\n<li>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u30b3\u30de\u30f3\u30c9 \u30e9\u30a4\u30f3\u3092\u958b\u304d\u307e\u3059\u3002<\/li>\n<li>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\n<ul class=\"list-colored\">\n<li>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">docker build -t jenkins:local \ndocker run -p 8080:8080 -p 50000:50000 jenkins:local<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u30b3\u30f3\u30bd\u30fc\u30eb\u306e\u30ad\u30fc\u3092\u30b3\u30d4\u30fc\u3057\u3001\u30d6\u30e9\u30a6\u30b6\u30fc\u3067 http:\/\/localhost:8080 <span style=\"white-space: pre-wrap;\">\u3092\u958b\u304d\u307e\u3059\u3002<\/span><\/li>\n<li>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u30a6\u30a3\u30b6\u30fc\u30c9\u306b\u5f93\u3044\u307e\u3059\u3002<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h2 id=\"01G8TJJS47CJF5RP2Z1ZZ8RSGA\">\u65b0\u898f Jenkins \u30b8\u30e7\u30d6\u306e\u4f5c\u6210<\/h2>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol class=\"list-colored\">\n<li>Jenkins \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067 [<strong>New Item<\/strong>] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/1_new_item.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/1_new_item-1024x625.png\" alt=\"\" width=\"1024\" height=\"625\" class=\"aligncenter wp-image-20041 size-large\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/1_new_item-980x598.png 980w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/1_new_item-480x293.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/a><\/li>\n<li>[<strong>New Item name<\/strong>] \u306b\u5165\u529b\u3057\u3001[<strong>Freestyle project<\/strong>] \u3092\u9078\u629e\u3057\u3066 [<strong>OK<\/strong>] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/2_new_item_details.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/2_new_item_details-1024x652.png\" alt=\"\" width=\"1024\" height=\"652\" class=\"aligncenter wp-image-20042 size-large\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/2_new_item_details-980x624.png 980w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/2_new_item_details-480x306.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h2 id=\"01G8TJJS47YEYBT3HZCS8VZAJG\">Git \u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n<p>\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u3001Git \u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f7f\u7528\u3057\u3066\u81ea\u52d5\u30c6\u30b9\u30c8 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001TestRail \u306e GitHub \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30b5\u30f3\u30d7\u30eb <a href=\"https:\/\/github.com\/gurock\/automation-frameworks-integration\" target=\"_blank\" rel=\"noopener noreferrer\">automation-frameworks-integration<\/a> \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol class=\"list-colored\">\n<li>[<strong>Source Code Management<\/strong>] \u30bb\u30af\u30b7\u30e7\u30f3\u3067 [<strong>Git<\/strong>] \u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/li>\n<li>[<strong>Repository URL<\/strong>] \u306b URL \u3092\u6307\u5b9a\u3057\u307e\u3059 (\u4eca\u56de\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f <code class=\"inline-code\">https:\/\/github.com\/gurock\/automation-frameworks-integration.git<\/code>)\u3002<\/li>\n<li>[<strong>Branch Specifier<\/strong>] \u306b\u30d6\u30e9\u30f3\u30c1\u3092\u6307\u5b9a\u3057\u307e\u3059 (\u4eca\u56de\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f <code class=\"inline-code\">*\/main<\/code>)\u3002<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/3_config_github.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/3_config_github-1024x915.png\" alt=\"\" width=\"1024\" height=\"915\" class=\"aligncenter size-large wp-image-20043\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/3_config_github-980x876.png 980w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/3_config_github-480x429.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/a><\/p>\n<h2 id=\"01G8TJJS473BRTR7N4A9TG4NNZ\">\u30d3\u30eb\u30c9 \u30b9\u30c6\u30c3\u30d7\u306e\u8a2d\u5b9a<\/h2>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol class=\"list-colored\">\n<li>[<strong>Build<\/strong>] \u30bb\u30af\u30b7\u30e7\u30f3\u306e [<strong>Add build step<\/strong>] \u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u3092\u4f7f\u7528\u3057\u3066 [<strong>Execute shell<\/strong>] \u30b9\u30c6\u30c3\u30d7\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/4a_config_build_steps_shell.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/4a_config_build_steps_shell.png\" alt=\"\" width=\"720\" height=\"337\" class=\"aligncenter size-full wp-image-20044\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/4a_config_build_steps_shell.png 720w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/4a_config_build_steps_shell-480x225.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 720px, 100vw\" \/><\/a><\/li>\n<li>[<strong>Execute shell\u00a0<\/strong>] \u30b9\u30c6\u30c3\u30d7\u306e [<strong>Command<\/strong>] \u306b\u4ee5\u4e0b\u3092\u884c\u3046\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u3092\u542b\u3080\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u633f\u5165\u3057\u307e\u3059\u3002\n<ul class=\"list-bullet\">\n<li>\u74b0\u5883\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/li>\n<li>\u30c6\u30b9\u30c8 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u5b9f\u884c<\/li>\n<li><a href=\"\/testrail-cli\/\" target=\"_blank\" rel=\"noopener\">TestRail CLI<\/a> \u3092\u4f7f\u7528\u3057\u305f\u30c6\u30b9\u30c8\u7d50\u679c\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9<\/li>\n<\/ul>\n<p><a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/4_config_build_step.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/4_config_build_step.png\" alt=\"\" width=\"759\" height=\"653\" class=\"aligncenter size-full wp-image-20045\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/4_config_build_step.png 759w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/4_config_build_step-480x413.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 759px, 100vw\" \/><\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h2 id=\"01G8TJJS47E8W6F60PTSJQC26C\">\u30b7\u30a7\u30eb \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u8a73\u7d30<\/h2>\n<p>\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u3001\u4e0a\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u4f7f\u7528\u3055\u308c\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30b3\u30d4\u30fc\u3068\u3001\u5404\u30bb\u30af\u30b7\u30e7\u30f3\u306e\u7c21\u5358\u306a\u8aac\u660e\u3067\u3059\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\"># Go to test project folder\ncd samples\/python\/pytest\n\n# Setup virtual environment\npython3.10 -m venv .\/venv\n. .\/venv\/bin\/activate\n\n# Install and run test project\npip install -r requirements.txt\npytest --junitxml \"reports\/junit-report.xml\" \".\/tests\" || pytest_exit_code=$?\n\n# Install TestRail CLI and upload test results\npip install trcli\ntrcli -y \\\n  -h \"https:\/\/INSTANCE.testrail.io\" \\\n  -u \"USER_EMAIL\" \\\n  -p \"API_TOKEN\" \\\n  --project \"PROJECT NAME\" \\\n  parse_junit \\\n  --title \"Automated Test Run\" \\\n  --run-description \"CI Build: ${BUILD_URL}\" \\\n  -f \"reports\/junit-report.xml\"\n    \n# Exit with Pytest exit code\nexit $pytest_exit_code<\/pre>\n<h4># Go to test project folder<\/h4>\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3001\u307e\u305a\u3001\u5b9f\u884c\u3059\u308b\u81ea\u52d5\u30c6\u30b9\u30c8 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u542b\u3080 <a href=\"https:\/\/github.com\/gurock\/automation-frameworks-integration\/tree\/main\/samples\/python\/pytest\" target=\"_blank\" rel=\"noopener noreferrer\">Pytest \u30b5\u30f3\u30d7\u30eb \u30d7\u30ed\u30b8\u30a7\u30af\u30c8<\/a>\u306e\u30d9\u30fc\u30b9 \u30d5\u30a9\u30eb\u30c0\u30fc\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<h4># Setup virtual environment<\/h4>\n<p>\u6b21\u306b\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5c02\u7528\u306e Python \u4eee\u60f3\u74b0\u5883\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4eee\u60f3\u74b0\u5883\u3092\u4f5c\u6210\u3059\u308b\u306e\u306f\u3001\u78ba\u5b9f\u306b\u4e00\u8cab\u6027\u306e\u3042\u308b\u30d9\u30fc\u30b9\u30e9\u30a4\u30f3\u304b\u3089\u59cb\u3081\u3089\u308c\u308b\u826f\u3044\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3067\u3059\u3002\u4eee\u60f3\u74b0\u5883\u3092\u4f5c\u6210\u3057\u305f\u3089\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30b0\u30ed\u30fc\u30d0\u30eb\u306a Python \u306e\u4ee3\u308f\u308a\u306b\u3053\u306e\u74b0\u5883\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<h4># Install and run test project<\/h4>\n<p>\u4eee\u60f3\u74b0\u5883\u3092\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u3057\u305f\u3089\u3001Pytest \u30c6\u30b9\u30c8 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u76f4\u63a5\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<code class=\"inline-code\">--junitxml \"reports\/junit-report.xml\"<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u3001<a href=\"\/testrail-cli\/\" target=\"_blank\" rel=\"noopener\">TestRail CLI<\/a> \u3067\u4f7f\u7528\u53ef\u80fd\u306a JUnit \u5f62\u5f0f\u306e\u30ec\u30dd\u30fc\u30c8\u3092\u751f\u6210\u3059\u308b\u3088\u3046 Pytest \u306b\u6307\u793a\u3057\u307e\u3059\u3002\u8a73\u7d30\u306a\u8aac\u660e\u306f <a href=\"\/pytest\/\" target=\"_blank\" rel=\"noopener\">Pytest \u3068\u306e\u7d71\u5408<\/a>\u30de\u30cb\u30e5\u30a2\u30eb\u306b\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u6ce8\u76ee\u3059\u3079\u304d\u3082\u3046 1 \u3064\u306e\u8a73\u7d30\u306f <code class=\"inline-code\">pytest<\/code> \u30b3\u30de\u30f3\u30c9\u306e\u5f8c\u306e <code class=\"inline-code\">|| pytest_exit_code=$?<\/code> \u3067\u3059\u3002\u3053\u308c\u306f\u3001\u30c6\u30b9\u30c8\u304c\u5931\u6557\u3057\u3001Pytest \u304c\u30a8\u30e9\u30fc\u7d42\u4e86\u30b3\u30fc\u30c9\u3092\u8fd4\u3057\u3066\u30b8\u30e7\u30d6\u5b9f\u884c\u5168\u4f53\u3092\u4e2d\u65ad\u3059\u308b\u3088\u3046\u306a\u5834\u5408\u3067\u3082\u7d9a\u884c\u3059\u308b\u3088\u3046\u30b7\u30a7\u30eb\u306b\u6307\u793a\u3057\u307e\u3059\u3002\u5f8c\u3067 <code class=\"inline-code\">pytest_exit_code<\/code> \u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7d42\u4e86\u3057\u3001\u30c6\u30b9\u30c8\u7d50\u679c\u306b\u5f93\u3063\u3066\u30d3\u30eb\u30c9\u3092\u6210\u529f\u307e\u305f\u306f\u5931\u6557\u3055\u305b\u307e\u3059\u3002\u3053\u306e\u52d5\u4f5c\u3092\u5b9f\u73fe\u3059\u308b\u65b9\u6cd5\u3084\u5229\u7528\u3067\u304d\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u591a\u6570\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u304c\u30b5\u30f3\u30d7\u30eb\u306e\u76ee\u7684\u3092\u9054\u6210\u3059\u308b\u6700\u3082\u7c21\u5358\u306a\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<h4># Install TestRail CLI and upload test results<\/h4>\n<p>\u30c6\u30b9\u30c8\u306e\u5b9f\u884c\u304c\u6b63\u5e38\u306b\u5b8c\u4e86\u3057\u305f\u5834\u5408 (\u5931\u6557\u3057\u305f\u30c6\u30b9\u30c8\u306e\u6709\u7121\u306b\u304b\u304b\u308f\u3089\u305a)\u3001JUnit \u5f62\u5f0f\u306e\u30ec\u30dd\u30fc\u30c8\u304c\u751f\u6210\u3055\u308c\u3001TestRail \u306b\u7d50\u679c\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002\u7d50\u679c\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u306b\u306f\u3001 <code class=\"inline-code\">pip<\/code> \u3092\u4f7f\u7528\u3057\u3066 <a href=\"\/testrail-cli\/\" target=\"_blank\" rel=\"noopener\">TestRail CLI<\/a> \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001TestRail \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u60c5\u5831\u3092\u6307\u5b9a\u3057\u3066\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3059\u3002<code class=\"inline-code\">-h<\/code>\u3001<code class=\"inline-code\">-u<\/code>\u3001<code class=\"inline-code\">-p<\/code> \u304a\u3088\u3073 <code class=\"inline-code\">--project<\/code> \u306e\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u3092\u7f6e\u304d\u63db\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3082\u3046 1 \u3064\u3001\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306e <code class=\"inline-code\">trcli<\/code> \u306e\u547c\u3073\u51fa\u3057\u3067\u3001\u3055\u3055\u3044\u3067\u3059\u304c\u5f79\u306b\u7acb\u3064\u60c5\u5831\u306f\u3001<code class=\"inline-code\">--run-description \"CI Build: ${BUILD_URL}\"<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u73fe\u5728\u306e Jenkins \u30d3\u30eb\u30c9 URL \u3092 TestRail \u306e\u30c6\u30b9\u30c8 \u30e9\u30f3\u306b\u8ffd\u52a0\u3057\u3001\u7c21\u5358\u306b\u30d3\u30eb\u30c9\u306b\u623b\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u6700\u5f8c\u306b\u63a8\u5968\u4e8b\u9805\u3068\u3057\u3066\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3084 API \u30c8\u30fc\u30af\u30f3\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u76f4\u63a5\u4f7f\u7528\u305b\u305a\u3001<a href=\"https:\/\/www.jenkins.io\/doc\/book\/using\/using-credentials\/\" target=\"_blank\" rel=\"noopener noreferrer\">Jenkins credentials manager<\/a> \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<h4># Exit with Pytest exit code<\/h4>\n<p>\u4e0a\u3067\u3082\u8ff0\u3079\u305f\u3088\u3046\u306b\u3001\u5143\u306e Pytest \u306e\u7d42\u4e86\u30b3\u30fc\u30c9\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7d42\u4e86\u3057\u3066\u3044\u308b\u305f\u3081\u3001Jenkins \u306b\u5b9f\u969b\u306e\u81ea\u52d5\u30c6\u30b9\u30c8\u5b9f\u884c\u306e\u7d50\u679c\u304c\u4f1d\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<h2 id=\"01G8TJJS47J1QYVNCVB6FVRTC9\">\u30b8\u30e7\u30d6\u306e\u5b9f\u884c<\/h2>\n<ol class=\"list-colored\">\n<li style=\"list-style-type: none;\">\n<ol class=\"list-colored\">\n<li>\u4e0a\u3067\u8a2d\u5b9a\u3057\u305f\u30b8\u30e7\u30d6\u3092\u4fdd\u5b58\u3057\u305f\u3089\u3001\u30b8\u30e7\u30d6\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u305d\u308c\u306b\u306f\u3001\u5de6\u30d1\u30cd\u30eb\u306e [<strong>Build Now<\/strong>] \u30a2\u30af\u30b7\u30e7\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/5_run_job.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/5_run_job.png\" alt=\"\" width=\"1098\" height=\"463\" class=\"aligncenter wp-image-20046 size-full\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/5_run_job.png 1098w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/5_run_job-980x413.png 980w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/5_run_job-480x202.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1098px, 100vw\" \/><\/a><\/li>\n<li>\u30b8\u30e7\u30d6\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u30d3\u30eb\u30c9\u306e [<strong>Console Output<\/strong>] \u30da\u30fc\u30b8\u306e\u30ed\u30b0\u3092\u3056\u3063\u3068\u898b\u3066\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u671f\u5f85\u3069\u304a\u308a\u5b9f\u884c\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u30c6\u30b9\u30c8\u5b9f\u884c\u304c\u554f\u984c\u306a\u304f\u5b8c\u4e86\u3057\u3001TestRail CLI \u304c\u9069\u5207\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u3001\u6307\u5b9a\u3055\u308c\u305f\u5834\u6240\u3067\u30c6\u30b9\u30c8\u7d50\u679c\u306e JUnit \u30ec\u30dd\u30fc\u30c8\u3092\u767a\u898b\u3067\u304d\u305f\u5834\u5408\u3001TestRail CLI \u304c\u30c6\u30b9\u30c8\u7d50\u679c\u3092 TestRail \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u30b5\u30d6\u30df\u30c3\u30c8\u3057\u305f\u3053\u3068\u304c\u30ed\u30b0\u3067\u78ba\u8a8d\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/jenkins_logs_v2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/jenkins_logs_v2.png\" alt=\"\" width=\"1106\" height=\"1266\" class=\"aligncenter wp-image-20047 size-full\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/jenkins_logs_v2.png 1106w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/jenkins_logs_v2-980x1122.png 980w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/jenkins_logs_v2-480x549.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1106px, 100vw\" \/><\/a><\/li>\n<li>\u6700\u5f8c\u306b\u3001TestRail \u3092\u958b\u3044\u3066 [<strong>\u30c6\u30b9\u30c8 \u30e9\u30f3\u3068\u7d50\u679c<\/strong>] \u30da\u30fc\u30b8\u306b\u79fb\u52d5\u3059\u308b\u3068\u3001\u00a0<strong>Automated Test Run<\/strong> \u3068\u3044\u3046\u540d\u524d\u3067\u65b0\u3057\u304f\u5b9f\u884c\u3055\u308c\u305f\u30e9\u30f3\u304c\u3042\u308a\u3001\u30c6\u30b9\u30c8\u7d50\u679c\u3068\u3068\u3082\u306b\u3001\u3053\u306e\u30c6\u30b9\u30c8 \u30e9\u30f3\u3092\u751f\u6210\u3057\u305f Jenkins \u30b8\u30e7\u30d6 \u30d3\u30eb\u30c9\u3078\u306e\u30ea\u30f3\u30af\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<a href=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/tr_test_run.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/tr_test_run.png\" alt=\"\" width=\"1045\" height=\"751\" class=\"aligncenter size-full wp-image-20048\" srcset=\"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/tr_test_run.png 1045w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/tr_test_run-980x704.png 980w, https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-content\/uploads\/tr_test_run-480x345.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1045px, 100vw\" \/><\/a><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h2 id=\"01G74W5ZPGTYQ0PY1K37T54TF0\">\u6b21\u306e\u30b9\u30c6\u30c3\u30d7<\/h2>\n<p>\u30c6\u30b9\u30c8\u7d50\u679c\u304c TestRail \u306b\u96c6\u7d04\u3055\u308c\u305f\u306e\u3067\u3001\u5931\u6557\u3057\u305f\u30c6\u30b9\u30c8\u306e\u30a8\u30e9\u30fc \u30e1\u30c3\u30bb\u30fc\u30b8\u3082\u542b\u3081\u3066\u81ea\u52d5\u30c6\u30b9\u30c8\u5b9f\u884c\u306e\u7d50\u679c\u3092\u78ba\u8a8d\u3067\u304d\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u624b\u52d5\u30c6\u30b9\u30c8\u3068\u81ea\u52d5\u30c6\u30b9\u30c8\u3092\u30ec\u30dd\u30fc\u30c8\u4e0a\u3067\u96c6\u7d04\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u95a2\u3059\u308b\u5b8c\u5168\u306a\u30c6\u30b9\u30c8 \u30ab\u30d0\u30ec\u30c3\u30b8\u3092\u8868\u793a\u3057\u305f\u308a\u3001\u30c6\u30b9\u30c8\u81ea\u52d5\u5316\u30d7\u30ed\u30bb\u30b9\u3092\u8ffd\u8de1\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u307e\u305f\u3001\u624b\u52d5\u30c6\u30b9\u30c8\u306e\u7d50\u679c\u3060\u3051\u3067\u306a\u304f\u3001\u81ea\u52d5\u30c6\u30b9\u30c8\u306e\u7d50\u679c\u304b\u3089\u4efb\u610f\u306e\u8ab2\u984c\u30c8\u30e9\u30c3\u30ab\u30fc\u306b\u76f4\u63a5\u30d0\u30b0\u3092\u30ec\u30dd\u30fc\u30c8\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>TestRail \u306e\u30ec\u30dd\u30fc\u30c8\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/www.youtube.com\/watch?v=XXygDfOD2MY\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>TestRail \u306e\u30ec\u30dd\u30fc\u30c8\u304a\u3088\u3073\u30c6\u30b9\u30c8 \u30e1\u30c8\u30ea\u30af\u30b9\u306e\u52d5\u753b(\u82f1\u8a9e)<\/strong><\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jenkins \u306f\u4e3b\u8981\u306a\u30aa\u30fc\u30d7\u30f3 \u30bd\u30fc\u30b9\u306e\u81ea\u52d5\u5316\u30b5\u30fc\u30d0\u30fc\u3067\u3042\u308a\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d3\u30eb\u30c9\u3001\u30c7\u30d7\u30ed\u30a4\u3001\u81ea\u52d5\u5316\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u591a\u6570\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002Jenkins \u306f\u5358\u306b CI \u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3001\u7d99\u7d9a\u7684\u30c7\u30ea [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"parent":6703,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-20040","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-json\/wp\/v2\/pages\/20040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-json\/wp\/v2\/comments?post=20040"}],"version-history":[{"count":29,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-json\/wp\/v2\/pages\/20040\/revisions"}],"predecessor-version":[{"id":22433,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-json\/wp\/v2\/pages\/20040\/revisions\/22433"}],"up":[{"embeddable":true,"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-json\/wp\/v2\/pages\/6703"}],"wp:attachment":[{"href":"https:\/\/docs.testrail.techmatrix.jp\/testrail\/docs\/753\/wp-json\/wp\/v2\/media?parent=20040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}