Skip to content

Testing

daronco edited this page Nov 25, 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

In brief, what you'll need is:

  • A BBB server, 0.7 or 0.8 (you can test against multiple servers);
  • The server must be "mobile-enabled";
  • Sync the clock between your machine and the BBB server.

The first thing you have to do is to configure the features/conf.yml file (use the features/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:
    salt: 'lkj1293812m3i1092837k12983'
    url: 'http://your-server/bigbluebutton/api'
    version: '0.7'
  test-server-08:
    salt: 'lkj1293812m3i1092837k12983'
    url: 'http://test-server-08/bigbluebutton/api'
    version: '0.8'
    mobile_salt: '03b07' # you NEED this in 0.8!

Then open the file extras/download_bot_from.txt and open the URL pointed in this file. It will download the file bbb-bot.jar. Put it in the folder extras/. To know more about the bot see the following sections in this page.

Finally, 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, you just need to set the mobile_salt in features/conf.yml. For earlier versions of BigBlueButton you need to install it manually (it's very simple). See: http://code.google.com/p/mconf/wiki/MconfMobile for more information.

The current version of the bot is at this repository: https://github.com/daronco/mconf-mobile/tree/bbb-bot. The file extras/download_bot_from.txt contains the link to the bot that should be used. Just download it and put it in the extras/ folder.

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

Clone this wiki locally