1.想 jenkins 有展現和解析 Allure 報告的能力,就必須裝 Allure 插件。
![](http://static.javashuo.com/static/loading.gif)
「安裝插件地址:」web
http://updates.jenkins-ci.org/download/plugins/
json
這個地址能夠填寫在 jenkins 的升級站點-url:後端
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
微信
若是在可選插件中輸入 Allure 搜索不到插件,那就只能離線安裝了。編輯器
「離線安裝:」函數
![](http://static.javashuo.com/static/loading.gif)
jenkins 的插件的格式必須是.hpi
。工具
會有各類版本號,選擇最新的一個版本下載下來就行了。測試
![](http://static.javashuo.com/static/loading.gif)
上傳文件,提交後自動跳轉至更新中心,在更新中心會告訴你安裝的結果。flex
![](http://static.javashuo.com/static/loading.gif)
2.裝好以後須要有配置工做:
在執行機上生成的 Allure 報告,要從工程上呈現 Allure 報告的時候,基本上是從執行機上解讀文件。url
![](http://static.javashuo.com/static/loading.gif)
「全局工具管理的做用:」
沒有執行機不用考慮這個。這個地方配置執行機的遠程工做目錄。執行機只執行任務,它的配置都是在 jenkins 主機的管理系統上來配置。
「配置下執行機上 Allure 的安裝路徑:」
每一臺執行機的路徑不必定和主機同樣。配置工具的目的是,先把工具的名稱配置出來,後續對執行機作工具配置,直接選擇工具名稱,而後配置路徑。
統一管理的方式:全部執行機的工具配置:(有哪些工具能夠配置,全都是在 jenkins 工具管理來配置的。)
![](http://static.javashuo.com/static/loading.gif)
沒有配置 jdk1.8 的 JAVA-HOME,若是有兩臺執行機,每臺執行機,本身配置本身的。若是是在主機的這裏配置的,至關於給它作了一個默認的路徑。主機確定是這個路徑,可是執行機就未必是了。
因此這裏地方配置工具的時候就給個名字就行了。執行機模式下能夠不用給地址。執行機模式下不用給,主機模式下要給地址。
這個配置裏沒有 SVN,SVN 是不須要配置的。工程建立的時候有 SVN,就說明它是自帶的。
先啓動 slave(啓動步驟請看前 2 篇文章)。
3.讓執行機去執行 Allure 命令:
![](http://static.javashuo.com/static/loading.gif)
我須要知道執行機的 ALlure 路徑在哪裏。
![](http://static.javashuo.com/static/loading.gif)
「配置 JDK:」
![](http://static.javashuo.com/static/loading.gif)
若是其它的環境須要配置 1.六、1.8 版本的 JDK,這個容許建立多個工具的。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
「配置當前電腦上 Allure29 的具體路徑。」
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
項目組的成員直接在 jenkins 上點擊連接就能夠看到報告了,不須要每次都問你。
4.問題
哪怕只有一個主機沒有 slave,也是能夠配置 Allure 的。執行機和主機不能在同一臺電腦上的,它們之間也不能進行通訊。固然,搞個虛擬機能夠的(虛擬機至關於另一套環境了)。
公衆號 「清菡軟件測試」首發,更多原創文章:清菡軟件測試 78+原創文章,歡迎關注、交流,禁止第三方擅自轉載。
![](http://static.javashuo.com/static/loading.gif)
本文分享自微信公衆號 - 清菡軟件測試(qinghanTester)。
若有侵權,請聯繫 support@oschina.cn 刪除。
本文參與「OSC源創計劃」,歡迎正在閱讀的你也加入,一塊兒分享。