-
Notifications
You must be signed in to change notification settings - Fork 40
Testing
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. There's also a rails application in spec/rails_app/
that is used in the tests. This is called a "dummy" application, used only for testing purposes.
The integration tests use cucumber (and rspec) and are found under the folder spec/rails_app/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).
Tests are run using docker-compose, for more details check the docker-compose.yml
file. You can of course run them without Docker if you need/want to, just copy the configurations from the docker files and run the commands directly on your machine.
There are rake tasks to run the tests:
docker-compose run test rake rails_app:install # updates the gem in the test application
docker-compose run test rake rails_app:db # recreates the test application's database
docker-compose run test rake spec # runs all unit tests
docker-compose run test rake cucumber # runs all integration tests
docker-compose run test rake # runs everything
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".
The first thing you have to do is to configure the spec/rails_app/features/config.yml
file (use the spec/rails_app/features/config.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 run the following command:
docker-compose run test cucumber SERVER=test-server-08 --tags ~@wip
In cucumber these "tests" are called features. The command above will run all features except 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. For example:
docker-compose run test rake SERVER=test-bbb071a
docker-compose run test rake SERVER=test-bbb08
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
.
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