pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    1. <small id='sAwHS'></small><noframes id='sAwHS'>

      <i id='sAwHS'><tr id='sAwHS'><dt id='sAwHS'><q id='sAwHS'><span id='sAwHS'><b id='sAwHS'><form id='sAwHS'><ins id='sAwHS'></ins><ul id='sAwHS'></ul><sub id='sAwHS'></sub></form><legend id='sAwHS'></legend><bdo id='sAwHS'><pre id='sAwHS'><center id='sAwHS'></center></pre></bdo></b><th id='sAwHS'></th></span></q></dt></tr></i><div class="0geg4ka" id='sAwHS'><tfoot id='sAwHS'></tfoot><dl id='sAwHS'><fieldset id='sAwHS'></fieldset></dl></div>
      <legend id='sAwHS'><style id='sAwHS'><dir id='sAwHS'><q id='sAwHS'></q></dir></style></legend>
    2. <tfoot id='sAwHS'></tfoot>

          <bdo id='sAwHS'></bdo><ul id='sAwHS'></ul>

        在持續(xù)集成構(gòu)建中無頭運(yùn)行 JavaScript 單元測(cè)試

        Running JavaScript unit tests headlessly in a Continuous Integration build(在持續(xù)集成構(gòu)建中無頭運(yùn)行 JavaScript 單元測(cè)試)
            <tbody id='Wqupm'></tbody>
          <tfoot id='Wqupm'></tfoot>

        • <legend id='Wqupm'><style id='Wqupm'><dir id='Wqupm'><q id='Wqupm'></q></dir></style></legend>
            <bdo id='Wqupm'></bdo><ul id='Wqupm'></ul>

            1. <i id='Wqupm'><tr id='Wqupm'><dt id='Wqupm'><q id='Wqupm'><span id='Wqupm'><b id='Wqupm'><form id='Wqupm'><ins id='Wqupm'></ins><ul id='Wqupm'></ul><sub id='Wqupm'></sub></form><legend id='Wqupm'></legend><bdo id='Wqupm'><pre id='Wqupm'><center id='Wqupm'></center></pre></bdo></b><th id='Wqupm'></th></span></q></dt></tr></i><div class="24scsks" id='Wqupm'><tfoot id='Wqupm'></tfoot><dl id='Wqupm'><fieldset id='Wqupm'></fieldset></dl></div>
              1. <small id='Wqupm'></small><noframes id='Wqupm'>

                  本文介紹了在持續(xù)集成構(gòu)建中無頭運(yùn)行 JavaScript 單元測(cè)試的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有一個(gè)在持續(xù)集成系統(tǒng)上運(yùn)行的 webapp 構(gòu)建計(jì)劃(Atlassian Bamboo 2.5).我需要將基于 QUnit 的 JavaScript 單元測(cè)試合并到構(gòu)建計(jì)劃中,以便在每次構(gòu)建時(shí),Javascript 測(cè)試將運(yùn)行,Bamboo 將解釋測(cè)試結(jié)果.

                  最好我希望能夠使構(gòu)建過程獨(dú)立",這樣就不需要連接到外部服務(wù)器.關(guān)于如何實(shí)現(xiàn)這一點(diǎn)的好主意?運(yùn)行構(gòu)建過程的 CI 系統(tǒng)位于 Ubuntu Linux 服務(wù)器上.

                  解決方案

                  我自己想出了一個(gè)解決方案,我認(rèn)為分享它是個(gè)好主意.這種方法可能并非完美無缺,但它似乎是第一個(gè)有效的方法.隨時(shí)發(fā)布改進(jìn)和建議.

                  簡(jiǎn)而言之我做了什么:

                  • 啟動(dòng)一個(gè) Xvfb 實(shí)例,一個(gè)虛擬幀緩沖區(qū)
                  • 使用 JsTestDriver:
                    • 在虛擬幀緩沖區(qū)中啟動(dòng)一個(gè) Firefox 實(shí)例(無頭)
                    • 捕獲 Firefox 實(shí)例并運(yùn)行測(cè)試套件
                    • 生成符合 JUnit 的測(cè)試結(jié)果 .XML
                  • 使用 Bamboo 檢查結(jié)果文件以通過或失敗構(gòu)建

                  接下來我將介紹更詳細(xì)的階段.這就是我的目錄結(jié)構(gòu)最終的樣子:

                  <上一頁>庫(kù)/JsTestDriver.jar測(cè)試/數(shù)量/equiv.jsQUnitAdapter.jsjsTestDriver.confrun_js_tests.sh測(cè)試.js測(cè)試報(bào)告/構(gòu)建.xml

                  在構(gòu)建服務(wù)器上:

                  • 安裝 Xvfb (apt-get install Xvfb)
                  • 安裝 Firefox (apt-get install firefox)

                  到您要構(gòu)建的應(yīng)用程序中:

                  • 安裝 JsTestDriver:http://code.google.com/p/js-測(cè)試驅(qū)動(dòng)/
                    • 添加 QUnit 適配器 equiv.jsQUnitAdapter.js
                    • 配置 JsTestDriver (jsTestDriver.conf):
                  <上一頁>服務(wù)器:http://localhost:4224加載:# 加載 QUnit 適配器(如果不使用 QUnit,可以省略)- qunit/equiv.js- qunit/QUnitAdapter.js# 測(cè)試自己(你會(huì)想要添加更多文件)- 測(cè)試.js

                  創(chuàng)建一個(gè)用于運(yùn)行單元測(cè)試和生成測(cè)試結(jié)果的腳本文件(例如在 Bash 中,run_js_tests.sh):

                  #!/bin/bash# 寫入輸出 XML 的目錄(如果不存在,則不會(huì)生成結(jié)果!)OUTPUT_DIR="../test-reports"mkdir $OUTPUT_DIRXVFB=`哪個(gè) Xvfb`如果[$?"-eq 1];然后回顯未找到 Xvfb."1號(hào)出口菲火狐=`哪個(gè)火狐`如果[$?"-eq 1];然后回聲找不到火狐."1號(hào)出口菲$XVFB :99 -ac &# 將虛擬幀緩沖區(qū)啟動(dòng)到后臺(tái)PID_XVFB="$!"# 獲取進(jìn)程IDexport DISPLAY=:99 # 設(shè)置顯示使用 xvfb 的顯示# 運(yùn)行測(cè)試java -jar ../lib/JsTestDriver.jar --config jsTestDriver.conf --port 4224 --browser $FIREFOX --tests all --testOutput $OUTPUT_DIRkill $PID_XVFB # 關(guān)閉 xvfb (firefox 會(huì)被 JsTestDriver 徹底關(guān)閉)回聲完成".

                  創(chuàng)建一個(gè)調(diào)用腳本的 Ant 目標(biāo):

                  最后,告訴 Bamboo 構(gòu)建計(jì)劃調(diào)用 test 目標(biāo)并查找 JUnit 測(cè)試結(jié)果.這里默認(rèn)的 "**/test-reports/*.xml" 就可以了.

                  I have a webapp build plan running on a Continuous Integration system (Atlassian Bamboo 2.5). I need to incorporate QUnit-based JavaScript unit tests into the build plan so that on each build, the Javascript tests would be run and Bamboo would interpret the test results.

                  Preferably I would like to be able to make the build process "standalone" so that no connections to external servers would be required. Good ideas on how to accomplish this? The CI system running the build process is on an Ubuntu Linux server.

                  解決方案

                  As I managed to come up with a solution myself, I thought it would be a good idea to share it. The approach might not be flawless, but it's the first one that seemed to work. Feel free to post improvements and suggestions.

                  What I did in a nutshell:

                  • Launch an instance of Xvfb, a virtual framebuffer
                  • Using JsTestDriver:
                    • launch an instance of Firefox into the virtual framebuffer (headlessly)
                    • capture the Firefox instance and run the test suite
                    • generate JUnit-compliant test results .XML
                  • Use Bamboo to inspect the results file to pass or fail the build

                  I will next go through the more detailed phases. This is what my my directory structure ended up looking like:

                  lib/
                      JsTestDriver.jar
                  test/
                      qunit/
                              equiv.js
                              QUnitAdapter.js
                      jsTestDriver.conf
                      run_js_tests.sh
                      tests.js
                  test-reports/
                  build.xml
                  

                  On the build server:

                  • Install Xvfb (apt-get install Xvfb)
                  • Install Firefox (apt-get install firefox)

                  Into your application to be built:

                  • Install JsTestDriver: http://code.google.com/p/js-test-driver/
                    • add the QUnit adapters equiv.js and QUnitAdapter.js
                    • configure JsTestDriver (jsTestDriver.conf):

                  server: http://localhost:4224
                  
                  load:
                  # Load QUnit adapters (may be omitted if QUnit is not used)
                    - qunit/equiv.js
                    - qunit/QUnitAdapter.js   
                  
                  # Tests themselves (you'll want to add more files)
                    - tests.js
                  

                  Create a script file for running the unit tests and generating test results (example in Bash, run_js_tests.sh):

                  #!/bin/bash
                  # directory to write output XML (if this doesn't exist, the results will not be generated!)
                  OUTPUT_DIR="../test-reports"
                  mkdir $OUTPUT_DIR
                  
                  XVFB=`which Xvfb`
                  if [ "$?" -eq 1 ];
                  then
                      echo "Xvfb not found."
                      exit 1
                  fi
                  
                  FIREFOX=`which firefox`
                  if [ "$?" -eq 1 ];
                  then
                      echo "Firefox not found."
                      exit 1
                  fi
                  
                  $XVFB :99 -ac &    # launch virtual framebuffer into the background
                  PID_XVFB="$!"      # take the process ID
                  export DISPLAY=:99 # set display to use that of the xvfb
                  
                  # run the tests
                  java -jar ../lib/JsTestDriver.jar --config jsTestDriver.conf --port 4224 --browser $FIREFOX --tests all --testOutput $OUTPUT_DIR
                  
                  kill $PID_XVFB     # shut down xvfb (firefox will shut down cleanly by JsTestDriver)
                  echo "Done."
                  

                  Create an Ant target that calls the script:

                  <target name="test">        
                      <exec executable="cmd" osfamily="windows">
                          <!-- This might contain something different in a Windows environment -->
                      </exec>
                  
                      <exec executable="/bin/bash" dir="test" osfamily="unix">
                          <arg value="run_js_tests.sh" />
                      </exec>
                  </target>   
                  

                  Finally, tell the Bamboo build plan to both invoke the test target and look for JUnit test results. Here the default "**/test-reports/*.xml" will do fine.

                  這篇關(guān)于在持續(xù)集成構(gòu)建中無頭運(yùn)行 JavaScript 單元測(cè)試的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Check if a polygon point is inside another in leaflet(檢查一個(gè)多邊形點(diǎn)是否在傳單中的另一個(gè)內(nèi)部)
                  Changing leaflet markercluster icon color, inheriting the rest of the default CSS properties(更改傳單標(biāo)記群集圖標(biāo)顏色,繼承其余默認(rèn) CSS 屬性)
                  Trigger click on leaflet marker(觸發(fā)點(diǎn)擊傳單標(biāo)記)
                  How can I change the default loading tile color in LeafletJS?(如何更改 LeafletJS 中的默認(rèn)加載磁貼顏色?)
                  Adding Leaflet layer control to sidebar(將 Leaflet 圖層控件添加到側(cè)邊欄)
                  Leaflet - get latitude and longitude of a marker inside a pop-up(Leaflet - 在彈出窗口中獲取標(biāo)記的緯度和經(jīng)度)

                  <small id='2XYtQ'></small><noframes id='2XYtQ'>

                    <bdo id='2XYtQ'></bdo><ul id='2XYtQ'></ul>

                  • <legend id='2XYtQ'><style id='2XYtQ'><dir id='2XYtQ'><q id='2XYtQ'></q></dir></style></legend>
                    <tfoot id='2XYtQ'></tfoot>

                          <tbody id='2XYtQ'></tbody>

                            <i id='2XYtQ'><tr id='2XYtQ'><dt id='2XYtQ'><q id='2XYtQ'><span id='2XYtQ'><b id='2XYtQ'><form id='2XYtQ'><ins id='2XYtQ'></ins><ul id='2XYtQ'></ul><sub id='2XYtQ'></sub></form><legend id='2XYtQ'></legend><bdo id='2XYtQ'><pre id='2XYtQ'><center id='2XYtQ'></center></pre></bdo></b><th id='2XYtQ'></th></span></q></dt></tr></i><div class="kus6cke" id='2XYtQ'><tfoot id='2XYtQ'></tfoot><dl id='2XYtQ'><fieldset id='2XYtQ'></fieldset></dl></div>

                          • 主站蜘蛛池模板: 讲师宝经纪-专业培训机构师资供应商_培训机构找讲师、培训师、讲师经纪就上讲师宝经纪 | 阿里巴巴诚信通温州、台州、宁波、嘉兴授权渠道商-浙江联欣科技提供阿里会员办理 | 深圳展厅设计_企业展馆设计_展厅设计公司_数字展厅设计_深圳百艺堂 | 全自动烧卖机厂家_饺子机_烧麦机价格_小笼汤包机_宁波江北阜欣食品机械有限公司 | 好看的韩国漫画_韩漫在线免费阅读-汗汗漫画 | 阴离子_阳离子聚丙烯酰胺厂家_聚合氯化铝价格_水处理絮凝剂_巩义市江源净水材料有限公司 | 酒精检测棒,数显温湿度计,酒安酒精测试仪,酒精检测仪,呼气式酒精检测仪-郑州欧诺仪器有限公司 | 打包钢带,铁皮打包带,烤蓝打包带-高密市金和金属制品厂 | 有机肥设备生产制造厂家,BB掺混肥搅拌机、复合肥设备生产线,有机肥料全部加工设备多少钱,对辊挤压造粒机,有机肥造粒设备 -- 郑州程翔重工机械有限公司 | 天津货架厂_穿梭车货架_重型仓储货架_阁楼货架定制-天津钢力仓储货架生产厂家_天津钢力智能仓储装备 | VI设计-LOGO设计公司-品牌设计公司-包装设计公司-导视设计-杭州易象设计 | 吸污车_吸粪车_抽粪车_电动三轮吸粪车_真空吸污车_高压清洗吸污车-远大汽车制造有限公司 | 课件导航网_ppt课件_课件模板_课件下载_最新课件资源分享发布平台 | 手持式3d激光扫描仪-便携式三维立体扫描仪-北京福禄克斯 | ?水马注水围挡_塑料注水围挡_防撞桶-常州瑞轩水马注水围挡有限公司 | 空气能采暖,热泵烘干机,空气源热水机组|设备|厂家,东莞高温热泵_正旭新能源 | 上海租车公司_上海包车_奔驰租赁_上海商务租车_上海谐焕租车 | 400电话_400电话申请_866元/年_【400电话官方业务办理】-俏号网 3dmax渲染-效果图渲染-影视动画渲染-北京快渲科技有限公司 | 丹佛斯压力传感器,WISE温度传感器,WISE压力开关,丹佛斯温度开关-上海力笙工业设备有限公司 | 数年网路-免费在线工具您的在线工具箱-shuyear.com | 复盛空压机配件-空气压缩机-复盛空压机(华北)总代理 | 抖音短视频运营_企业网站建设_网络推广_全网自媒体营销-东莞市凌天信息科技有限公司 | 外贮压-柜式-悬挂式-七氟丙烷-灭火器-灭火系统-药剂-价格-厂家-IG541-混合气体-贮压-非贮压-超细干粉-自动-灭火装置-气体灭火设备-探火管灭火厂家-东莞汇建消防科技有限公司 | 异噻唑啉酮-均三嗪-三丹油-1227-中北杀菌剂厂家 | 山东螺杆空压机,烟台空压机,烟台开山空压机-烟台开山机电设备有限公司 | 进口试验机价格-进口生物材料试验机-西安卡夫曼测控技术有限公司 | 热熔胶网膜|pes热熔网膜价格|eva热熔胶膜|热熔胶膜|tpu热熔胶膜厂家-苏州惠洋胶粘制品有限公司 | 手表腕表维修保养鉴定售后服务中心网点 - 名表维修保养 | 磨煤机配件-高铬辊套-高铬衬板-立磨辊套-盐山县宏润电力设备有限公司 | 沈阳楼承板_彩钢板_压型钢板厂家-辽宁中盛绿建钢品股份有限公司 轴承振动测量仪电箱-轴承测振动仪器-测试仪厂家-杭州居易电气 | 北京网站建设|北京网站开发|北京网站设计|高端做网站公司 | 宽带办理,电信宽带,移动宽带,联通宽带,电信宽带办理,移动宽带办理,联通宽带办理 | 地图标注|微信高德百度地图标注|地图标记-做地图[ZuoMap.com] | 武汉高温老化房,恒温恒湿试验箱,冷热冲击试验箱-武汉安德信检测设备有限公司 | 【ph计】|在线ph计|工业ph计|ph计厂家|ph计价格|酸度计生产厂家_武汉吉尔德科技有限公司 | 拉力机-拉力试验机-万能试验机-电子拉力机-拉伸试验机-剥离强度试验机-苏州皖仪实验仪器有限公司 | 高压无油空压机_无油水润滑空压机_水润滑无油螺杆空压机_无油空压机厂家-科普柯超滤(广东)节能科技有限公司 | 金属管浮子流量计_金属转子流量计厂家-淮安润中仪表科技有限公司 | 粉碎机_塑料粉碎机_塑料破碎机厂家-星标机械 | 石家庄救护车出租_重症转院_跨省跨境医疗转送_活动赛事医疗保障_康复出院_放弃治疗_腾康26年医疗护送转诊团队 | 珠海网站建设_响应网站建设_珠海建站公司_珠海网站设计与制作_珠海网讯互联 |