1. Ralph Bean
  2. tg-docs

Commits

percious  committed 5c756eb

describe how TG2 can be tested.

  • Participants
  • Parent commits e463e27
  • Branches 2.1

Comments (0)

Files changed (5)

File docs/gettingtoknow.rst

View file
  • Ignore whitespace
     main/License
     main/TGandPylons
     building_docs
+    main/testing_core
      
 Libraries and Modules Shipped With TurboGears
 =============================================

File docs/main/Contributing.rst

View file
  • Ignore whitespace
 -------
 
 Automated unit tests are essential to make the future growth of the
-project as error free as possible.
-
-TurboGears 2 uses Nose_, which makes testing easy. You can run the
-tests in each of the source directories just by running `nosetests`.
-For example, to run the test on the TG2 server:
-
-.. code-block:: bash
-
-  (tg2dev)$ cd tg2
-  (tg2dev)$ nosetests
-
-.. _Nose: http://somethingaboutorange.com/mrl/projects/nose/
-
-Default options for `nosetests` can often be found in the
-`[nosetests]` section of `setup.cfg` and additional options can be
-passed on the command line.  See the Nose_ documentation for details.
-
-For TG2 projects all testing default are configured in it's tests
-package for maximun user configurability.
+project as error free as possible.  Please see :ref:`testing_core`
+for more information about how to set up your environment with
+TurboGears for testing.
 
 Documenting Changes
 -------------------

File docs/main/testing_core.rst

View file
  • Ignore whitespace
+.. _testing_core:
+
+Setting up the TurboGears Test Environment and Testing
+========================================================
+
+Initial Environment Setup
+---------------------------
+
+Please follow the instructions on the install_ page to get your
+environment started.  Pay special attention to the virtualenv
+setup.  You want to do your TG development within a clean environment
+that will not interfere with any existing projects you may have.
+
+.. _install: DownloadInstall.html#installing-the-development-version-of-turbogears-2
+
+Package Installation
+-----------------------
+Because Turbogears allows the user to swap out so many different moving parts,
+we need to be able to prove that we can support these components regularly
+in order to provide a robust experience for our users.
+
+Right now TG testing depends on lxml because of chameleon.genshi, a very fast
+implementation of genshi that uses the lxml driver.  This driver is written
+in C, and therfore requires some linkage to work properly.  Lot's of folks
+have problems getting this to work, but if you try this, it will often work::
+
+    $ STATIC_DEPS=true; easy_install lxml
+    
+You can then install chameleon.genshi successfully::
+    
+    $ easy_install chameleon.genshi
+    
+It is then recommended you run the tests the first time through setup.py because
+this will install all of the `test_requires` packages from the setup.py script::
+
+    $ python setup.py test
+
+You can in fact run the tests like this every time, but it is a little easier to use
+nose.
+
+Testing
+-------
+
+Automated unit tests are essential to make the future growth of the
+project as error free as possible.
+
+TurboGears 2 uses Nose_, which makes testing easy. You can run the
+tests in each of the source directories just by running `nosetests`.
+For example, to run the test on the TG2 server:
+
+.. code-block:: bash
+
+  (tg2dev)$ cd tg2
+  (tg2dev)$ nosetests
+
+.. _Nose: http://somethingaboutorange.com/mrl/projects/nose/
+
+Default options for `nosetests` can often be found in the
+`[nosetests]` section of `setup.cfg` and additional options can be
+passed on the command line.  See the Nose_ documentation for details.
+
+With any luck, your tests will run and produce something like the following output::
+
+   ----------------------------------------------------------------------
+    Ran 245 tests in 2.457s
+
+    OK
+
+As you can see, the tests really take very little time to run, so it makes sense
+to run the tests any time you want to contribute code in order to make certain it
+does not break any existing functionality.
+
+Coverage
+----------
+
+Adequate code coverage is a goal for the TurboGears project, as it is probably
+the minimum you could do to make sure your code is well tested.  Code coverage
+testing is built into nose and easy to use.  To test TurboGears and see the code
+coverage output simply type::
+
+    $ nosetests --with-coverage --cover-package=tg
+    
+The end your output will look something like this::
+
+    TOTAL                                 1554   1407    90%   
+    ----------------------------------------------------------------------
+    Ran 245 tests in 3.659s
+
+    OK
+
+TurboGears does not currently have 100% coverage, and we realize this is an issue.
+We'd love some help in this area, so if you have some time and want to learn
+more about the internals of TurboGears, pick a few untested lines of code and
+figure out how to supply sufficient tests to cover that code.  

File docs/misc.rst

View file
  • Ignore whitespace
 
 .. todo:: Difficulty: Medium. Add lifecycle of TG project in the getting to know TG section.
 
-.. todo:: Difficulty: Easy. Explain how TG2 itself can be tested.
-
 .. todo:: Difficulty: Medium. Explain how TG2 apps can be tested and the goodness of test driven development.
 
 .. todo:: Difficulty: Medium. make docs more linky.   provide link to pylons, and why tg2 is now based on it.   eventually, I'd really like to see links to pylonsbook for specific "more information", and how turbogears is different/expands upon it

File docs/recipesandfaq.rst

View file
  • Ignore whitespace
     main/GlobalJSLib
     main/ToscaWidgets/Cookbook
     main/ToscaWidgets/Cookbook/FlexiGrid
-    main/ToscaWidgets/Cookbook/TreeView
     main/ToscaWidgets/Cookbook/Flot
     main/ToscaWidgets/Cookbook/JQueryTreeView
     main/ToscaWidgets/Cookbook/JQueryAjaxForm