Posts tagged "testing"

The Way of Testivus

Just recently I stumbled across and amusing viewpoint on testing. The Way of Testivus is an interesting slant on encouraging testing karma instead of testing dogma. It’s a fun and short read.

Unit Testing JavaScript

I’ve stumbled across a really cool unit testing framework for JavaScript that I wanted to share with everyone. It is called js-test-driver. http://code.google.com/p/js-test-driver/ Most JavaScript unit test frameworks need to be manually run, which requires a dev/qe to open a browser, start the tests, and verify the results. This doesn’t really scale or work for a CI environment. Js-test-driver aims to solve that problem.

The software itself is built with java and has a client and server side component. To start the server you just pass in a port and fire it up. Ex: java -jar JsTestDriver-1.3.2.jar –port 4224 It also has the option of passing in a list of browser executables, which the server will automatically start and setup to listen for unit tests. Additional browsers can be provisioned manually across a variety of devices by pointing to http://{the_servers_IP}:4224 in any browser window. Think Mobile. The client side is run by setting up a config file with some general information, including the server to connect to and the JavaScript files to load.

Example: jsTestDriver.conf

server: http://localhost:4224
 
load:
  - bin/*.js
 
timeout: 90

The tests are then ran by calling the same jar file: java -jar JsTestDriver-1.3.2.jar –tests all

In my proof of concept, I was able to quickly get 8 browsers, (4 Windows browsers, 2 Mac browsers, iPad Safari, and iPhone Safari), up and running for testing against. The Unit Test itself was a very basic Hello World test. The command took more time initializing the jvm & connections than the actual unit tests, which only took 26ms to run across all of the browsers/devices.

Joshua@Quake ~/js-test-driver
$ java -jar JsTestDriver-1.3.2.jar --tests all
........
Total 8 tests (Passed: 8; Fails: 0; Errors: 0) (1.00 ms)
  Safari 533.21.1 Windows: Run 1 tests (Passed: 1; Fails: 0; Errors 0) (0.00 ms)
  Safari 6533.18.5 iPhone OS: Run 1 tests (Passed: 1; Fails: 0; Errors 0) (1.00 ms)
  Firefox 4.0.1 Windows: Run 1 tests (Passed: 1; Fails: 0; Errors 0) (1.00 ms)
  Firefox 4.0.1 Mac OS: Run 1 tests (Passed: 1; Fails: 0; Errors 0) (0.00 ms)
  Safari 6533.18.5 Mac OS: Run 1 tests (Passed: 1; Fails: 0; Errors 0) (1.00 ms)
  Chrome 12.0.742.100 Windows: Run 1 tests (Passed: 1; Fails: 0; Errors 0) (0.00 ms)
  Safari 533.21.1 Mac OS: Run 1 tests (Passed: 1; Fails: 0; Errors 0) (1.00 ms)
  Microsoft Internet Explorer 9.0 Windows: Run 1 tests (Passed: 1; Fails: 0; Errors 0) (0.00 ms)
 
Joshua@Quake ~/js-test-driver
$

Continuous Integratation testing FlexUnit on CentOS

First let me introduce myself.  My name is Joshua Garnett.  I joined Adobe last fall as a Computer Scientist on the Flash Platform Services Team.  I’m currently working on the InMarket app distribution service. If you’re an app developer and looking to simplify your deployment process, you should definitely check it out.

Now on to the actual reason behind this post.  Recently I was tasked with getting FlexUnit tests to run in our CI environment. There is a lot of documentation out there on how to get things up and running on Hudson, but I wasn’t able to find a fool-proof method for those of us who just want to use an ant build script to run the tests. This is a brief summary of the items that need to be setup and installed in order to do just that.

Here is the software that I ended up using:

Continue reading…