[mapserver-dev] Automated publication of MapServer code coverage

Even Rouault even.rouault at mines-paris.org
Sat Jul 6 14:52:09 PDT 2013


Hi devs,

What is it about ?
--------------------------

I've setup a cronjob that publishes the code coverage of MapServer when 
running the msautotest suite. 

The results are published at the below links, and updated at each pushed 
commit in master :

http://even.rouault.free.fr/mapserver_coverage_html/home/travis/build/rouault/mapserver/

What for ?
----------------

This can help improving msautotest to add better coverage for still untested 
code.

How does it work ?
----------------------------

I've setup a branch 'mapserver_coverage' in my mapserver fork : 
https://github.com/rouault/mapserver/commits/master_with_coverage

This branch modifies the base .travis.yml to compile mapserver with coverage 
information (gcc --coverage flag), runs the testsuite and then generate the 
HTML report of code coverage afterwards with the lcov & genhtml utilities. At 
the end, it transfers the generated HTML files onto the above site via FTP. 
(There's a trick to be able to incrementally upload files between jobs. See 
run_code_coverage_upload.sh and find_updated_files.py ) 

The changes of master_with_coverage vs master are summarized here :
https://github.com/rouault/mapserver/compare/master_with_coverage

The cronjob just merges 'master' into 'master_with_coverage' regularly and 
pushes the branch to github, which causes a Travis build.

Why in a personnal branch ?
-------------------------------------------

The issue is with the FTP transfer onto my HTTP page. This requires of course 
specifying a password that is better kept private... Travis offers a way of 
doing this securely by putting an encrypted environment variable into the 
.travis.yml file. When Travis runs the script, it decrypts the environment 
variable. The variable is encoded/decoded with information linked to the 
Travis (or github ?? I'm not sure) account. There's a security in Travis that 
prevents people running forks of the repository (or pull requests triggering 
Travis builds) to steal the decoded information. See http://about.travis-
ci.org/docs/user/build-configuration/#Secure-environment-variables for more 
details.

This could likely be merged into the official MapServer repository (this would 
avoid relying on the cronjob on my PC) if the project manages a FTP 
repository. I've not investigated if there would be more efficient/simple ways 
to upload files.


Best regards,

Even

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the mapserver-dev mailing list