Tests

Revision 2 as of 2012-05-14 07:06:43

Clear message

The Guide to Creating Your Accomplishments

Creating accomplishment tests

<-- Previous page (Creating .accomplishment scripts) - - - - - Next page (Accomplishments collection structure) --->

If you are contributing a global accomplishment (such as an accomplishment in the ubuntu-community-accomplishments set), we will ask you for a test file when you submit your accomplishment for inclusion. This test file is extremely simple to create, yet it fits into our test automation system to ensure things are working well.

Let's imagine we are creating a test for an accomplishment called my-test-accomplishment. Create a new file in the 'tests' directory in the accomplishments collection (e.g. ubuntu-community-accomplishments/tests) with the same name as the accomplishment (e.g. my-test-accomplishment) and add the following:

[success]
launchpad-email = foo@bar.com

[failure]
launchpad-email = fail@fail.com

The purpose of the test file is to provide validation values (e.g. such as these email addresses) that can be used to test the accomplishment for success and for failure.

Using the above example, our accomplishment would be using launchpad-email to provide validation, and here we specify an email address that should complete the accomplishment (exit code 0) (this is in the success section), and an email address that should fail the accomplishment (exit code 1) (this is in the failure section).

When you submit your merge proposal to contribute your accomplishment, please be sure to include the test. Your accomplishment won't be included unless there is a test.

<-- Previous page (Creating .accomplishment scripts) - - - - - Next page (Accomplishments collection structure) --->