久久久久久久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>

        在持續集成構建中無頭運行 JavaScript 單元測試

        Running JavaScript unit tests headlessly in a Continuous Integration build(在持續集成構建中無頭運行 JavaScript 單元測試)
            <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'>

                  本文介紹了在持續集成構建中無頭運行 JavaScript 單元測試的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個在持續集成系統上運行的 webapp 構建計劃(Atlassian Bamboo 2.5).我需要將基于 QUnit 的 JavaScript 單元測試合并到構建計劃中,以便在每次構建時,Javascript 測試將運行,Bamboo 將解釋測試結果.

                  最好我希望能夠使構建過程獨立",這樣就不需要連接到外部服務器.關于如何實現這一點的好主意?運行構建過程的 CI 系統位于 Ubuntu Linux 服務器上.

                  解決方案

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

                  簡而言之我做了什么:

                  • 啟動一個 Xvfb 實例,一個虛擬幀緩沖區
                  • 使用 JsTestDriver:
                    • 在虛擬幀緩沖區中啟動一個 Firefox 實例(無頭)
                    • 捕獲 Firefox 實例并運行測試套件
                    • 生成符合 JUnit 的測試結果 .XML
                  • 使用 Bamboo 檢查結果文件以通過或失敗構建

                  接下來我將介紹更詳細的階段.這就是我的目錄結構最終的樣子:

                  <上一頁>庫/JsTestDriver.jar測試/數量/equiv.jsQUnitAdapter.jsjsTestDriver.confrun_js_tests.sh測試.js測試報告/構建.xml

                  在構建服務器上:

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

                  到您要構建的應用程序中:

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

                  創建一個用于運行單元測試和生成測試結果的腳本文件(例如在 Bash 中,run_js_tests.sh):

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

                  創建一個調用腳本的 Ant 目標:

                  最后,告訴 Bamboo 構建計劃調用 test 目標并查找 JUnit 測試結果.這里默認的 "**/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.

                  這篇關于在持續集成構建中無頭運行 JavaScript 單元測試的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

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

                  <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>

                          • 主站蜘蛛池模板: 日干夜操 | 久久高清 | 一区在线视频 | 精品视频国产 | 午夜一区 | 成人毛片视频免费 | 日日草夜夜草 | 国产中文字幕在线 | 天堂一区二区三区 | 亚洲巨乳自拍在线视频 | 色婷婷一区二区三区四区 | 国产99精品| 美女在线视频一区二区三区 | 免费人成在线观看网站 | 欧美成人免费在线 | 欧美成人综合 | 国产真实精品久久二三区 | 天堂一区二区三区 | 久久网亚洲 | 欧美一区二区三区免费在线观看 | 激情 一区 | 久久成人精品 | 美日韩中文字幕 | 亚洲国产精品日韩av不卡在线 | 黄色国产大片 | 国产伦一区二区三区四区 | 精品日韩一区二区三区av动图 | 黄色网毛片 | 国产精品久久久久久久久久 | 日韩在线免费播放 | 国产午夜精品久久 | 日本福利视频免费观看 | 精品一区二区三区在线观看国产 | 国产高清视频在线观看 | 国产精品久久久久久久久久久免费看 | 在线观看亚| 99精品一区二区 | 伊人狠狠| 欧美一级二级视频 | 青青久视频 | 先锋资源网站 |