pgRouting / pgrouting

Repository contains pgRouting library. Development branch is "develop", stable branch is "master"
https://pgrouting.org
GNU General Public License v2.0
1.12k stars 364 forks source link

Clean up doc_queries_generator.pl #2636

Open cvvergara opened 1 month ago

cvvergara commented 1 month ago

Back then on 2013 it was named test_runner.pl It was doing the "tests" Name changed on v2.2.0 algorithm-tester.pl the first attempt to rename because tests are done using pgtap To its current name on v.3.0.0 doc_queries_generator.pl, final name that is not misleading on doing tests. It kinda does "tests", basically what it does is it runs the queries used on the documentation and generates the results. So the results shown in the documentation are the results using the version of pgRouting, using PostgreSQL and PostGIS versions installed on the CI actions. Because they are not tests, the name is not misleading, but it also helps to kinda do visual comparisons (testing). The code needs:

$ tools/testers/doc_queries_generator.pl -h
RUNNING: doc_queries_generator.pl -h
Usage: doc_queries_generator.pl -pgver vpg -pgisver vpgis -psql /path/to/psql
       -alg 'dir'          - directory to select which algorithm subdirs to test
       -pgver version      - postgresql version
       -pghost host        - postgresql host or socket directory to use
       -pgport port        - postgresql port to use
       -pguser username    - postgresql user role to use
       -dbname name        - Database name defaults to pgr_test__db__test
       -pgrver version     - pgrouting version. (Not all compares will pass)
       -psql /path/to/psql - optional path to psql
       -data               - only install the sampledata.
       -l(evel)  NOTICE    - client_min_messages value. Defaults to NOTICE. other values can be WARNING, DEBUG3, etc
       -c(lean)            - dropdb before running.
       -doc(umentation)    - ONLY generate documentation examples. LEVEL is set to NOTICE
       -v(erbose)          - verbose messages of the execution
       -h(elp)             - help

where -v(erbose) is mainly used when having problems with the other flags -doc(umentation) generates the results of the documentation queries When this last flag is missing, then it does a visual compare (the kinda test) To remove:

Also cleanup the way the results are presented. for example:

tools/testers/doc_queries_generator.pl -alg docqueries/version
RUNNING: doc_queries_generator.pl -alg docqueries/version
Operative system found: linux
                                                                         version                                                                         
---------------------------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 15.7 (Ubuntu 15.7-1.pgdg22.04+~20240524.0311.g8e16f81) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
(1 row)

                                                                        postgis_full_version                                                                        
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
 POSTGIS="3.3.3 2355e8e" [EXTENSION] PGSQL="150" GEOS="3.11.1-CAPI-1.17.1" PROJ="8.2.1" LIBXML="2.9.13" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)"
(1 row)

                                                                pgr_full_version                                                                
------------------------------------------------------------------------------------------------------------------------------------------------
 (3.7.0-dev,Debug,2024/05/28,pgrouting-3.7.0,Linux,"PostgreSQL 15.7 (Ubuntu 15.7-1.pgdg22.04+~20240524.0311.g8.0",GNU-12.3.0,1.74.0,44e8266f19)
(1 row)

Processing docqueries/version/version.pg    Run time: 0.212744   PASS
Processing docqueries/version/full_version.pg   Run time: 0.212562   PASS
$stats = {
           'RunTimeTotal' => '0.425306',
           'z_crash' => 0,
           'z_fail' => 0,
           'z_pass' => 2
         };