Commits

seccanj committed 5913873

Release 1.3.8. Fixed tickets about moving test case into a different catalog.

o Fixed Ticket #8121 (Track-Hacks): Catalog Wiki Page not added

o Fixed Ticket #8123 (Track-Hacks): Can't move testcase more than one time into different catalog

o Fixed Ticket #8124 (Track-Hacks): AttributeError: 'NoneType' object has no attribute 'splitlines'

o Fixed Ticket #8125 (Track-Hacks): "duplicate test case" does not work for previously moved test case

  • Participants
  • Parent commits b0136d2

Comments (0)

Files changed (19)

+
+To build the four plugins that make up the application:
+
+
+  On Linux:
+
+ 1) Make sure you have Trac installed and available in the Python lookup 
+    path. Genshi should also be available in the Python lookup path.
+    To make these libraries available to Python you can either install them
+    centrally, or reference them using the PYTHONLIB environment variable.
+ 2) Unzip the source code distribution package
+ 3) Open a shell, cd into the root directory coming from the source code 
+    distribution package
+ 4) Build the source code using the provided buil.sh script:
+ 
+    . ./build.sh
+ 
+    The build shell script can copy the resulting egg files into your desired 
+    destination.
+    If you wish to directly install the egg files under your Trac environment, 
+    you can do that
+    by providing your project root directory to the build.sh script:
+    
+    . ./build.sh path/to/your/project
+
+ 5) You will find the built egg files under the directory "bin".
+    
+    
+  On Windows:
+
+ 1), 2), 3) Same as for Linux
+ 4) Build the source code using the provided buil.sh script:
+ 
+    build.cmd
+ 
+    The build shell script can copy the resulting egg files into your desired 
+    destination.
+    If you wish to directly install the egg files under your Trac environment, 
+    you can do that
+    by providing your project root directory to the build.sh script:
+    
+    build.cmd path\to\your\project
+    
+ 5) You will find the built egg files under the directory "bin".
+    
+
+==============================================================================
+Use the following command to clean up the build:
+
+  On Linux:
+
+    . ./build.sh
+
+    
+  On Windows:
+    
+    build.cmd

File INSTALLATION.txt

+Installation:
+
+The functionalities are divided in three plugins, which must be installed in this order:
+
+    1) Trac Generic Class => TracGenericClass
+
+    2) Trac Generic Workflow => TracGenericWorkflow
+
+    3) Test Manager => TestManager
+
+
+An additional plugin is only useful for debugging and should not be installed in a production environment.
+
+    *  SQL Executor => SQLExecutor
+
+
+Copyright (c) 2010, Roberto Longobardi
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+Test Manager plugin for Trac
+
+  Copyright 2010 Roberto Longobardi
+
+  Project web page on TracHacks: http://trac-hacks.org/wiki/TestManagerForTracPlugin
+  
+  Project web page on SourceForge.net: http://sourceforge.net/projects/testman4trac/
+  
+  Project web page on Pypi: http://pypi.python.org/pypi/TestManager
+
+
+A Trac plugin to create Test Cases, organize them in catalogs, generate test plans and track their execution status and outcome.
+
+Refer to BUILD.txt for details about how to build.
+
+Refer to INSTALL.txt for installation details.
+
+=================================================================================================  
+Change History:
+
+(Refer to the tickets on trac-hacks or SourceForge for complete descriptions.)
+
+Release 1.3.8 (2010-11-23):
+  o Fixed Ticket #8121 (Track-Hacks): Catalog Wiki Page not added
+  o Fixed Ticket #8123 (Track-Hacks): Can't move testcase more than one time into different catalog
+  o Fixed Ticket #8124 (Track-Hacks): AttributeError: 'NoneType' object has no attribute 'splitlines'
+  o Fixed Ticket #8125 (Track-Hacks): "duplicate test case" does not work for previously moved test case
+
+Release 1.3.7 (2010-11-20):
+  o Enhancement #7704 (Track-Hacks): Add ability to delete a Test Plan
+  o Fixet Ticket #8084 (Track-Hacks): Ordering issue
+
+Release 1.3.6 (2010-11-09):
+  o Fixed Ticket #8004 (Track-Hacks): Cannot search if an admin
+
+Release 1.3.5 (2010-10-17):
+  o Restored compatibility with Trac 0.11. Now again both 0.11 and 0.12 are supported.
+
+Release 1.3.4 (2010-10-15):
+  o Added tabular view to catalogs and plans. Search now works with custom properties in tabular views.
+
+Release 1.3.3 (2010-10-05):
+  o Enhanced feature 3076739 (SourceForge): Full Test Plan display / print
+
+Release 1.3.2 (2010-10-03):
+  o Added feature 3076739 (SourceForge): Full Test Plan display / print
+
+Release 1.3.1 (2010-10-02):
+  o Fixed a base-code bug that prevented test catalog modification with a PostgreSQL binding. (Thanks Rodel for reporting it).
+
+Release 1.3.0 (2010-10-01):
+  o The base Test Manager plugin has been separated and other plugins have been created to embed the functionalities of generic class framework and the workflow engine.
+    Now we have four plugins:
+      * Trac Generic Class plugin, providing the persistent class framework
+      * Trac Generic Workflow plugin, providing the generic workflow engine applicable 
+        to any Trac Resource. This plugin requires the Trac Generic Class plugin.
+      * SQL Executor plugin, as a debugging tool when dealing with persistent data. Not to be enabled in a production environment.
+
+    Moreover, the generic class framework has been added a set of new functionalities. 
+    Refer to the README file in its package for more details.
+      
+Release 1.2.0 (2010-09-20):
+  o The data model has been completely rewritten, now using python classes for all the test objects.
+    A generic object supporting programmatic definition of its standard fields, declarative 
+    definition of custom fields (in trac.ini) and keeping track of change history has been created, 
+    by generalizing the base Ticket code.
+    
+    The specific object "type" is specified during construction
+    as the "realm" parameter.
+    This name must also correspond to the database table storing the
+    corresponding objects, and is used as the base name for the 
+    custom fields table and the change tracking table (see below).
+    
+    Features:
+        * Support for custom fields, specified in the trac.ini file
+          with the same syntax as for custom Ticket fields. Custom
+          fields are kept in a "<schema>_custom" table
+        * Keeping track of all changes to any field, into a separate
+          "<schema>_change" table
+        * A set of callbacks to allow for subclasses to control and 
+          perform actions pre and post any operation pertaining the 
+          object's lifecycle
+        * Registering listeners, via the ITestObjectChangeListener
+          interface, for object creation, modification and deletion.
+        * Searching objects matching any set of valorized fields,
+          (even non-key fields), applying the "dynamic record" pattern. 
+          See the method list_matching_objects.
+    
+  o Enhancement #7704 (Track-Hacks): Add workflow capabilities, with custom states, transitions and operations, and state transition listeners support
+      A generic Trac Resource workflow system has been implemented, allowing to add workflow capabilities 
+      to any Trac resource.
+      Test objects have been implemented as Trac resources as well, so they benefit of workflow capabilities.
+
+      Available objects 'realms' to associate workflows to are: testcatalog, testcase, testcaseinplan, testplan.
+      
+      Note that the object with realm 'resourceworkflowstate', which manages the state of any resource in a
+      workflow, also supports custom properties (see below), so plugins can augment a resource workflow state
+      with additional context information and use it inside listener callbacks, for example.
+
+      For example, add the following to your trac.ini file to associate a workflow with all Test Case objects.
+      The sample_operation is currently provided by the Test Manager system itself, as an example.
+      It just logs a debug message with the text input by the User in a text field.
+      
+        [testcase-resource_workflow]
+        leave = * -> *
+        leave.operations = sample_operation
+        leave.default = 1
+
+        accept = new -> accepted
+        accept.permissions = TEST_MODIFY
+        accept.operations = sample_operation
+
+        resolve = accepted -> closed
+        resolve.permissions = TEST_MODIFY
+        resolve.operations = sample_operation
+
+  o Enhancement #7705 (Track-Hacks): Add support for custom properties and change history to all of the test management objects
+      A generic object supporting programmatic definition of its standard fields, declarative definition 
+      of custom fields (in trac.ini) and keeping track of change history has been created, by generalizing 
+      the base Ticket code.
+      
+      Only text type of properties are currently supported.
+
+      For example, add the following to your trac.ini file to add custom properties to all of the four
+      test objects.
+      Note that the available realms to augment are, as above, testcatalog, testcase, testcaseinplan and testplan, 
+      with the addition of resourceworkflowstate.
+
+        [testcatalog-tm_custom]
+        prop1 = text
+        prop1.value = Default value
+
+        [testcaseinplan-tm_custom]
+        prop_strange = text
+        prop_strange.value = windows
+
+        [testcase-tm_custom]
+        nice_prop = text
+        nice_prop.value = My friend
+
+        [testplan-tm_custom]
+        good_prop = text
+        good_prop.value = linux
+
+  o Enhancement #7569 (Track-Hacks): Add listener interface to let other components react to test case status change
+      Added listener interface for all of the test objects lifecycle:
+       * Object created
+       * Object modified (including custom properties)
+       * Object deleted
+      This applies to test catalogs, test cases, test plans and test cases in a plan (i.e. with a status).
+  
+Release 1.1.2 (2010-08-25):
+  o Enhancement #7552 (Track-Hacks): Export test statistics in CSV and bookmark this chart features in the test stats chart
+  o Fixed Ticket #7551 (Track-Hacks): Test statistics don't work on Trac 0.11
+
+Release 1.1.1 (2010-08-20):
+  o Enhancement #7526 (Track-Hacks): Add ability to duplicate a test case
+  o Enhancement #7536 (Track-Hacks): Add test management statistics
+  o Added "autosave=true" parameter to the RESTful API to create test catalogs 
+    and test cases programmatically without need to later submit the wiki editing form.
+
+Release 1.1.0 (2010-08-18):
+  o Enhancement #7487 (Track-Hacks): Add multiple test plans capability
+  o Enhancement #7507 (Track-Hacks): Implement security permissions
+  o Enhancement #7484 (Track-Hacks): Reverse the order of changes in the test case status change history
+
+Release 1.0.2 (2010-08-17):
+  o Fixed Ticket #7485 (Track-Hacks): "Open ticket on this test case" should work without a patched TracTicketTemplatePlugin
+
+Release 1.0.1 (2010-08-12):
+  o First attempt at externalizing strings
+
+Release 1.0 (2010-08-10):
+  o First release publicly available
+  
+mkdir bin
+
+cd tracgenericclass\trunk
+python setup.py bdist_egg
+xcopy /y dist\*.egg ..\..\bin
+
+cd ..\..\tracgenericworkflow\trunk
+python setup.py bdist_egg
+xcopy /y dist\*.egg ..\..\bin
+
+cd ..\..\sqlexecutor\trunk
+python setup.py bdist_egg
+xcopy /y dist\*.egg ..\..\bin
+
+cd ..\..\testman4trac\trunk
+python setup.py bdist_egg
+xcopy /y dist\*.egg ..\..\bin
+
+cd ..\..
+
+xcopy /y *.txt bin
+
+xcopy /y bin\*.egg %1\plugins
 cd ../../testman4trac/trunk
 python setup.py bdist_egg
 cp dist/*.egg ../../bin
-cp testmanager/INSTALLATION.txt ../../bin
 
 cd ../..
 
+cp *.txt bin
+
 cp bin/*.egg $project_path/plugins
-

File build_wininst.cmd

+mkdir bin
+
+cd tracgenericclass\trunk
+python setup.py bdist_wininst
+
+cd ..\..\tracgenericworkflow\trunk
+python setup.py bdist_wininst
+
+cd ..\..\sqlexecutor\trunk
+python setup.py bdist_wininst
+
+cd ..\..\testman4trac\trunk
+python setup.py bdist_wininst
+
+cd ..\..
+
+xcopy /y *.txt bin
+
+rmdir /s /q bin
+
+cd tracgenericclass\trunk
+rmdir /s /q build 
+rmdir /s /q dist 
+rmdir /s /q TracGenericClass.egg-info
+
+cd ..\..\tracgenericworkflow/trunk
+rmdir /s /q build 
+rmdir /s /q dist 
+rmdir /s /q TracGenericWorkflow.egg-info
+
+cd ..\..\sqlexecutor/trunk
+rmdir /s /q build 
+rmdir /s /q dist 
+rmdir /s /q SQLExecutor.egg-info
+
+cd ..\..\testman4trac/trunk
+rmdir /s /q build 
+rmdir /s /q dist 
+rmdir /s /q TestManager.egg-info
+
+cd ..\..

File clean.sh

File contents unchanged.
+set VER=%1
+
+zip -r testman4trac.%VER%.zip bin
+
+mkdir testman4trac.%VER%
+
+xcopy /y *.sh testman4trac.%VER%
+xcopy /y *.cmd testman4trac.%VER%
+xcopy /y *.txt testman4trac.%VER%
+xcopy /y /s /i sqlexecutor testman4trac.%VER%\sqlexecutor
+xcopy /y /s /i testman4trac testman4trac.%VER%\testman4trac
+xcopy /y /s /i tracgenericclass testman4trac.%VER%\tracgenericclass
+xcopy /y /s /i tracgenericworkflow testman4trac.%VER%\tracgenericworkflow
+
+cd testman4trac.%VER%
+
+call clean.cmd
+
+cd ..
+
+zip -r testman4trac.%VER%.src.zip testman4trac.%VER%
+
+rmdir /s /q testman4trac.%VER%
 mkdir testman4trac.$VER
 
 cp *.sh testman4trac.$VER
+cp *.txt testman4trac.$VER
+cp *.cmd testman4trac.$VER
 cp -R sqlexecutor testman4trac.$VER
 cp -R testman4trac testman4trac.$VER
 cp -R tracgenericclass testman4trac.$VER

File sqlexecutor/trunk/setup.py

 
 setup(
     name='SQLExecutor',
-    version='1.0.1',
+    version='1.0.2',
     packages=['sqlexecutor'],
     package_data={'sqlexecutor' : ['*.txt', 'templates/*.html', 'htdocs/*.*', 'htdocs/js/*.js', 'htdocs/css/*.css', 'htdocs/images/*.*']},
     author = 'Roberto Longobardi',

File sqlexecutor/trunk/sqlexecutor/sql.py

             result = ''
             for row in cursor:
                 for i in row:
-                    result += str(i) + ', '
+                    if isinstance(i, basestring):
+                        result += i + u', '
+                    else:
+                        result += str(i) + u', '
                 result += CRLF
 
             db.commit()

File testman4trac/trunk/setup.py

 
 setup(
     name='TestManager',
-    version='1.3.7',
+    version='1.3.8',
     packages=['testmanager'],
     package_data={'testmanager' : ['*.txt', 'templates/*.html', 'htdocs/js/*.js', 'htdocs/css/*.css', 'htdocs/images/*.*']},
     author = 'Roberto Longobardi',

File testman4trac/trunk/testmanager/README.txt

 
 A Trac plugin to create Test Cases, organize them in catalogs, generate test plans and track their execution status and outcome.
 
+Refer to BUILD.txt for details about how to build.
+
 Refer to INSTALL.txt for installation details.
 
 =================================================================================================  
 
 (Refer to the tickets on trac-hacks or SourceForge for complete descriptions.)
 
+Release 1.3.8 (2010-11-23):
+  o Fixed Ticket #8121 (Track-Hacks): Catalog Wiki Page not added
+  o Fixed Ticket #8123 (Track-Hacks): Can't move testcase more than one time into different catalog
+  o Fixed Ticket #8124 (Track-Hacks): AttributeError: 'NoneType' object has no attribute 'splitlines'
+  o Fixed Ticket #8125 (Track-Hacks): "duplicate test case" does not work for previously moved test case
+
 Release 1.3.7 (2010-11-20):
   o Enhancement #7704 (Track-Hacks): Add ability to delete a Test Plan
   o Fixet Ticket #8084 (Track-Hacks): Ordering issue

File testman4trac/trunk/testmanager/api.py

             
             if type == 'catalog':
                 req.perm.require('TEST_MODIFY')
+                pagename += '_TT'+str(id)
 
                 try:
                     new_tc = TestCatalog(self.env, id, pagename, title, '')
                         old_pagename = tcId
                         tc_id = tcId.rpartition('_TC')[2]
                         tc = TestCase(self.env, tc_id, tcId)
+                        tc.author = author
+                        tc.remote_addr = req.remote_addr
                         if tc.exists:
                             tc.move_to(tcat)                            
                         else:

File testman4trac/trunk/testmanager/model.py

         """ 
         Moves the test case into a different catalog.
         
-        Note: the test case keeps its ID, but the old wiki page is
-        deleted and a new page is created with the new "path".
-        This means the page change history is lost.
+        Note: the test case keeps its ID, and the wiki page is moved 
+        into the new name. This way, the page change history is kept.
         """
+
+        db, handle_ta = get_db_for_write(self.env, db)
+
+        # Rename the wiki page
+        new_page_name = tcat['page_name'] + '_TC' + self['id']
+
+        cursor = db.cursor()
+        cursor.execute("UPDATE wiki SET name = %s WHERE name = %s", 
+            (new_page_name, self['page_name']))
+
+        if handle_ta:
+            db.commit()
+
+        # Invalidate Trac 0.12 page name cache
+        try:
+            del WikiSystem(self.env).pages
+        except:
+            pass
+
+        # TODO Move wiki page attachments
+        #from trac.attachment import Attachment
+        #Attachment.delete_all(self.env, 'wiki', self.name, db)
         
-        text = self.wikipage.text
-        
-        old_cat = self.get_enclosing_catalog()
-        
-        # Create new wiki page to store the test case
-        new_page_name = tcat['page_name'] + '_TC' + self['id']
-        new_page = WikiPage(self.env, new_page_name)
-               
-        new_page.text = text
-        new_page.save(self.author, "Moved from catalog \"%s\" (%s)" % (old_cat.title, old_cat['page_name']), '127.0.0.1')
-
         # Remove test case from all the plans
         tcip_search = TestCaseInPlan(self.env)
         tcip_search['id'] = self.values['id']
         for tcip in tcip_search.list_matching_objects(db):
             tcip.delete(db)
 
-        # Delete old wiki page
-        self.wikipage.delete()
+        # Update self properties and save
+        self['page_name'] = new_page_name
+        self.wikipage = WikiPage(self.env, new_page_name)
+        
+        self.save_changes('System', "Moved to a different catalog", 
+            datetime.now(utc), db)
 
-        self['page_name'] = new_page_name
-        self.wikipage = new_page
-        
         
 class TestCaseInPlan(AbstractVariableFieldsObject):
     """

File tracgenericclass/trunk/setup.py

 
 setup(
     name='TracGenericClass',
-    version='1.0.2',
+    version='1.0.3',
     packages=['tracgenericclass'],
     package_data={'tracgenericclass' : ['*.txt', 'templates/*.html', 'htdocs/*.*', 'htdocs/js/*.js', 'htdocs/css/*.css', 'htdocs/images/*.*']},
     author = 'Roberto Longobardi',

File tracgenericclass/trunk/tracgenericclass/util.py

     global has_read_db
 
     if db:
-        return (db, False)
+        return (db, True)
 
     if not checked_compatibility:
         check_compatibility(env)