Skip to content

Testing

Leonardo Crauss Daronco edited this page Sep 16, 2013 · 8 revisions

To test the gem we use rspec and cucumber.

The unit tests use rspec and are found in 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 features/conf.yml.example as a template). 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 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 run 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. We use the gem bbbot-ruby to add command-line clients (bots) to the meeting. See its README for more information.

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

Integration tests: BigBlueButton server configurations

Recommended configurations for the BigBlueButton server to be used in the tests:

In /var/lib/tomcat6/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties set:

removeMeetingWhenEnded=false
defaultMeetingExpireDuration=2

See more at: http://code.google.com/p/bigbluebutton/issues/detail?id=980

Clone this wiki locally