Confirmed users
656
edits
(→Tests) |
|||
| Line 82: | Line 82: | ||
* each mozbase package should have tests in a 'tests' subdirectory of its root | * each mozbase package should have tests in a 'tests' subdirectory of its root | ||
**''Example'': | **''Example'': http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/mozprofile/tests/ | ||
* these tests should be contained in a manifest; the master [http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/test-manifest.ini test manifest], is executed via [http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/test.py test.py] | |||
* these tests should be contained in a manifest; the master | |||
==== Running the tests ==== | ==== Running the tests ==== | ||
| Line 93: | Line 91: | ||
Ensure that all mozbase packages are installed as the tests require them as well as 3rd party packages using 'python setup_development.py --extra'. | Ensure that all mozbase packages are installed as the tests require them as well as 3rd party packages using 'python setup_development.py --extra'. | ||
Then run the [ | Then run the [http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/test.py test.py] test runner from the root of the git repository: | ||
python test.py | $ python test.py | ||
This will run all tests from [ | This will run all tests from [http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/test-manifest.ini test-manifest.ini] which is parsed with [http://mxr.mozilla.org/mozilla-central/source/testing/mozbase/manifestdestiny ManifestDestiny]. On success 'test.py' should print the number of tests run and 'OK': | ||
---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ||
| Line 122: | Line 120: | ||
'''Third-party Packages Used in Mozbase Testing:''' | '''Third-party Packages Used in Mozbase Testing:''' | ||
* mock | * mock | ||
In general, additional requirements add overhead to code complexity, new contributor learning curve, maintenance cost, and portability, so the value added should justify the costs. Candidate packages should be discussed with Mozbase stakeholders preferably in a bug so that a record is kept. | In general, additional requirements add overhead to code complexity, new contributor learning curve, maintenance cost, and portability, so the value added should justify the costs. Candidate packages should be discussed with Mozbase stakeholders preferably in a bug so that a record is kept. | ||