Changes between Version 59 and Version 60 of DevWikiGardenTest


Ignore:
Timestamp:
Dec 18, 2010, 8:24:23 AM (13 years ago)
Author:
robe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • DevWikiGardenTest

    v59 v60  
    77The (reference.xml or postgis.xml) and (postgis_gardentest.sql.xsl, raster_gardentest.sql.xsl (introduced in PostGIS 2.0) located in the doc and doc/xsl folders are both needed to build the tests. 
    88
    9 NOTE: These tests are equivalent to a monkey testing the software so a lot of tests fail. It's good in a sense as a monkey will stuff a geometry, geography or raster in any function that takes that and as such will test the system as human monkeys are bound to do and will also manage to crash the server
    10 in places where the software is not kiddie proofed.  As of PostGIS 2.0, there are currently about 70,000 some odd tests for the geometry/geography side and about 1,600 tests for raster generated and run (these are growing)
     9NOTE: These tests are equivalent to a monkey testing the software so a lot of tests fail. It's good in a sense as a monkey will stuff a geometry, geography or raster in any function that takes that and as such will test the system as human monkeys/applications are bound to do and will also manage to crash the server
     10in places where the software is not kiddie proofed.  As of PostGIS 2.0, there are currently about 80,000 some odd tests for the geometry/geography side and about 1,600 tests for raster generated and run (these are growing).  The PostGIS 1.5 has about 40,000 some odd tests for geometry/geography.  The main reason for the increase in tests is the number of new geometry types/empty types and functions added in PostGIS 2.0.
    1111
    12 == Version PostGIS 2.0+ (the geometry/geography logging has been backported to PostGIS 1.5) ==
     12== Version PostGIS 1.5 0 2.0+ (the geometry/geography logging has been backported to PostGIS 1.5.3+ (currently in branch)) ==
    1313The latest version and branch version of PostGIS 1.5 includes logic that will during the tests -  create two tables in the test database and populate them for later inspection: (for the 1.5 version the table names are defaulted to postgis_garden15_log, postgis_garden15_log_output - NOTE these can be changed by editing the var_logtable variable in the docs/xsl/postgis_gardentest.sql.xsl file)
    1414 * '''postgis_garden_log''': This contains a record for each test and logs both the start, end times and the sql statement that was run.
     
    2525
    2626If the test crashes before completion, the record with the max logid will tell you the query that crashed the server.
     27I usually just run a query like this to figure out the crashing query:
     28
     29{{{
     30SELECT *
     31  FROM postgis_garden_log ORDER BY logid DESC limit 1;
     32}}}
     33
    2734
    2835 * '''postgis_garden_log_output''' -- this outputs the query results for queries that return something in xml format.  It  uses the built-in query_to_xml function that has existed since PostgreSQL 8.3 to do that. columns:
     
    3037   * ''log_output'' - an xml field that contains the query_to_xml output of the query.
    3138
    32 There is also a companion for raster testing: raster_gardentest.sql.xsl. The raster one currently only has a '''raster_garden_log''' table
    33 which is lacking a log_sql field.  This will be added soon.  The structure follows the same pattern as postgis_garden_log
    34 except that g1/g2 fields may refer to a pixeltype or geometry type.
     39There is also a companion for raster testing: raster_gardentest.sql.xsl.  The structure follows the same pattern as postgis_garden_log
     40except that g1/g2 fields may refer to a pixeltype or geometry type and spatial_class is ''raster''.
    3541
    3642-- To Build the script
     
    5864There are a lot of nice benefits  about logging the query and the output to a table:
    5965  * It's easier to inspect
    60   * You can conceivably (though haven't tried yet) do a join between two log output tables by logid (as long as the logs were generated from the same test script) to compare results from different versions of postgis)
     66  * You can do a join between two log output tables by logid (as long as the logs were generated from the same test script) to compare results from different versions of postgis)
     67
     68Here is an example query I use to figure out which tests don't complete that used to complete in PostGIS 1.5.  Note for this -- I ran the PostGIS 1.5. batter of tests against a 1.5.2 install and a PostGIS 2.0 install and rename the log tables to be a bit more descriptive. The below will spit
     69out all the tests that used to complete in postgis 1.5 install that now throw errors in postgis 2.0 install
     70
     71{{{
     72SELECT p2.logid, p2.func,  p2.g1, p2.g2, p2.spatial_class, p2.log_sql
     73FROM postgis_garden15on20_log As p2 INNER JOIN
     74    postgis_garden15on152_log As p1 ON p2.logid = p1.logid
     75WHERE p1.log_end is NOT NULL and p2.log_end is NULL;
     76}}}
     77 
    6178  * You can also rerun a subset of the queries for closer inspection by just writing an sql statement something like below -- which will retest all tests for the ST_3DDistance function that completed successfully
    6279