Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 567991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:08:32+00:00 2026-05-13T13:08:32+00:00

I have a webapp build plan running on a Continuous Integration system ( Atlassian

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:08:32+00:00Added an answer on May 13, 2026 at 1:08 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 431k
  • Answers 431k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It is more safe (and also for code reuse) to… May 15, 2026 at 2:07 pm
  • Editorial Team
    Editorial Team added an answer Confirmed from DSP Dimensions, that the current DIRAC2 library will… May 15, 2026 at 2:07 pm
  • Editorial Team
    Editorial Team added an answer Make sure your call to [self managedObjectContext] is returning a… May 15, 2026 at 2:07 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.