Closed uniomni closed 13 years ago
Also, the output in the window where risiko-start is run now produces unhelpful screen output.
127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:48 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:52 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:52 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:52 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:52 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:52 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:52 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:53 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:53 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:44 -0500] "POST /api/v1/calculate/ HTTP/1.1" 200 - "http://127.0.0.1:8000/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110615 Ubuntu/10.10 (maverick) Firefox/3.6.18" 127.0.0.1 - - [26/Jun/2011:22:17:44 -0500] "POST /api/v1/calculate/ HTTP/1.1" 200 - "http://127.0.0.1:8000/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110615 Ubuntu/10.10 (maverick) Firefox/3.6.18" 127.0.0.1 - - [26/Jun/2011:22:17:54 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:54 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:57 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:57 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:57 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:57 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:59 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:59 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:59 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1" 127.0.0.1 - - [26/Jun/2011:22:17:59 -0500] "GET /data/acls HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1"
Although better not, the test suite still outputs diagnostics from the calculation routine. Each test should be only one line with either OK, FAIL or ERROR.
See The same file can be uploaded more than once ... ok Shapefile can be uploaded ... ok Shapefile with without prj file is rejected ... ok GeoTIF file can be uploaded ... ok Earthquake fatalities calculation via the HTTP Rest API is correct ... INFO 2011-08-01 00:07:21,521 Performing requested calculation INFO 2011-08-01 00:07:21,521 - Downloading hazard layer geonode:earthquake_ground_shaking from http://localhost:8001/geoserver-geonode-dev/ows INFO 2011-08-01 00:07:21,769 - Downloading exposure layer geonode:population_2010_clip from http://localhost:8001/geoserver-geonode-dev/ows INFO 2011-08-01 00:07:21,924 - Calculating impact using <class 'impact.plugins.earthquake.allen_fatality_model.EarthquakeFatalityFunction'> INFO 2011-08-01 00:07:21,955 - Uploading impact layer /tmp/tmp1E57ef.tif INFO 2011-08-01 00:07:28,506 - Result available at http://localhost:8000/data/geonode:output_2011_08_01t000721347148. ok Earthquake school damage calculation works via the HTTP REST API ... INFO 2011-08-01 00:07:28,917 Performing requested calculation INFO 2011-08-01 00:07:28,917 - Downloading hazard layer geonode:lembang_mmi_hazmap from http://localhost:8001/geoserver-geonode-dev/ows INFO 2011-08-01 00:07:29,092 - Downloading exposure layer geonode:lembang_schools from http://localhost:8001/geoserver-geonode-dev/ows INFO 2011-08-01 00:07:29,215 - Calculating impact using <class 'impact.plugins.earthquake.unspecific_building_impact_model.EarthquakeBuildingDamageFunction'> INFO 2011-08-01 00:07:29,257 - Uploading impact layer /tmp/tmp5tbT1z.shp INFO 2011-08-01 00:07:35,370 - Result available at http://localhost:8000/data/geonode:output_2011_08_01t000728772104. ok Functions can be retrieved from the HTTP Rest API ... ok Layers can be retrieved from the HTTP Rest API ... ok Lembang building damage from ground shaking works ... ok Fatalities from ground shaking can be computed correctly 1 ... ok Fatalities from ground shaking can be computed correctly 2 ... o
Running the test suite (and code quality audit) creates a lot of unnecessary output. When all tests pass and code quality is good (as per pylint and pep8) the output should be minimal. Currently, it is very hard to pick out potential problems from the output produced!
In particular, we always get huge amounts of logging output from GeoNode's upload function and also the logging from Risiko's calculate function.
I propose suppressing GeoNode's logging to screen completely (except for errors) and suppress risiko's log when running testing only.