Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Writing Integration Tests for Seattle


The purpose of this document is to guide any Seattle developers in how to create integration tests. These integrations will be used to run some sort of test and email the required people (usually the system admins) in case the tests fail.


These are the files that need to be imported in order to setup and run the integration tests properly. All these files are located in trunk/integrationtests/common/

  3. seattle_gmail_info
  4. (Optional - import this if you want to send messages on the irc)

Initializing the Integration Tests

In order to set up the integration tests, we must first initialize the send_gmail so on failure the integration test emails the required developers. In the main function of the test have the following line of code before any testing is done:

success,explanation_str = send_gmail.init_gmail()

if not success:

This ensures that the gmail user name and password are set up.

Key Functions

    1. log(msg) - This function just prints a time stamp as well as the message that is passed along. This function is used when the developer wants to log some information.
    2. notify(text, subject) - This function is used to notify the required developers if the test fails. The <string> text that is passed in as input is the message that is emailed to the developers and the <string> subject is used as the subject of the email. Currently the emails that are notified are "ivan@…", "justinc@…" and "monzum@…". This email list resides in An example of usage would be:
      #test_fail is a boolean
      if test_fail:
        integrationtestlib.notify("Error: The test has failed!!", "test_fail notification")
    3. handle_exception(text, subject) - This function is used with a try and except block. This function should be called if you expect there to be some kind of error that will be printed in StdErr?. This function sends an email to the developer as well as send them a traceback of the failure. An example of usage would be:
        integrationtestlib.handle_exception("run_test failed", "run_test fail notification")
    1. send_msg(message_string) - This function is used to send a message on irc on the server and on the channel #seattle. An example of use would be:
      if test_fail:
        irc_seattlebot.send_msg("Error: The test has failed!!")  

If anyone has further questions or need help writing integration tests, please contact Monzur Muhammad at monzum@….