久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    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="qwawimqqmiuu" 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="qwawimqqmiuu" 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)最終的樣子:

                  <上一頁(yè)>庫(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):
                  <上一頁(yè)>服務(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="qwawimqqmiuu" id='2XYtQ'><tfoot id='2XYtQ'></tfoot><dl id='2XYtQ'><fieldset id='2XYtQ'></fieldset></dl></div>

                          • 主站蜘蛛池模板: 性色av网站 | 国产精品久久久久久久久久久久久 | 在线伊人网 | www.午夜| 久久超 | 中文字幕在线观看第一页 | 免费观看一区二区 | 久久久精品在线 | 欧美国产日韩一区二区 | 中国一级毛片 | 中文字幕理伦片免费看 | 久久99视频 | 美女一级片 | 亚洲久久久久久 | 免费的av | 亚洲精品一区二区三区在线 | 亚洲精品成人网 | 99re视频| 日韩精品一区在线 | 综合激情网 | 日本精品视频在线观看 | 久久久午夜 | 久久99视频| 中文字幕第7页 | 国精产品99永久一区一区 | 欧美一级欧美三级在线观看 | 日韩精品视频免费播放 | 国产91精品看黄网站在线观看 | 欧美日韩一区二区三区四区 | 欧美一区视频 | 久久精品视频国产 | 91日韩在线 | 亚洲小视频在线观看 | 国产精品网站在线观看 | 久久av在线 | 久久夜色精品国产欧美乱极品 | 日韩一区二区视频 | 欧美午夜精品一区二区三区 | 九九久久精品视频 | 国产av一级毛片 | 精品福利在线 |