Skip to content

Testing

daronco edited this page Nov 15, 2011 · 8 revisions

To test the gem we use rspec and cucumber.

The unit tests use rspec and are found the folder spec/. You don't need a real BigBlueButton (BBB) server to run these tests. They all use mocks and stubs to simulate the behaviour of a real server.

The integration tests use cucumber (and rspec) and are found under the folder features/. In this case you need a real server to run them. This server also needs support to the Android mobile client (see below why).

There are rake tasks to run the tests:

bundle exec rake spec      # runs all unit tests
bundle exec rake cucumber  # runs all integration tests
bundle exec rake           # runs everything

Integration tests

The first thing you need to run the integration tests is to configure the conf.yml file (use the conf.yml.example). You can add to it multiple BigBlueButton servers and use the command line to indicate which one should be used.

Take the following snippet of a configuration file as an example:

servers:
  bbb-dev-07:
    bbb_salt: 'lkj1293812m3i1092837k12983'
    bbb_url: 'http://your-server/bigbluebutton/api'
    bbb_version: '0.7'
  test-server-08:
    bbb_salt: 'lkj1293812m3i1092837k12983'
    bbb_url: 'http://test-server-08/bigbluebutton/api'
    bbb_version: '0.8'

Then run the following command:

bundle exec cucumber SERVER=test-server-08 --tags @version-all,@version-08 --tags ~@wip

In cucumber these "tests" are called features. Some of the features are specific for a given BBB API version and others are tested against all APIs. The features are tagged to indicate which version they should be ran against (e.g. @version-all, @version-08).

The command above will run all features tagged with @version-all or @version-08 but not those tagged with @wip (that are still being developed). And it's going to use the server test-server-08.

Using the task in our rakefile, these tags will already be pre-configured . You can simply specify the server you want to use and its version. For example:

bundle exec rake SERVER=test-bbb071a V=0.7  # test server for BBB API 0.7
bundle exec rake SERVER=test-bbb08 V=0.8    # test server for BBB API 0.8

Integration tests: bot

Some features need running meetings in the BBB server to be properly tested. To end a meeting, for example, you first need to have it running.

A meeting in BBB will only be running after the first user establishes a RTMP connection with the server. To establish this connection, we are using the bbb-bot, a java application implemented with the same base libraries used in the Android client. This bot is still in early stages of development, but it can already properly join a meeting and so it serves to our purposes.

This is the reason why your server needs support to the mobile application. In BBB 0.8 the support is already available in a standard installation, but for earlier versions you need to install it manually (it's very simple). See: http://code.google.com/p/mconf/wiki/MconfMobile.

The current version of the bot is at this repository: https://github.com/daronco/mconf-mobile/tree/bbb-bot. And the application (jar file) is copied to the extras/ folder in this gem.

The features that use the bot are tagged with @need-bot.

Clone this wiki locally