[mapserver-dev] Automated publication of MapServer code coverage

Even Rouault even.rouault at mines-paris.org
Mon Jul 8 15:08:51 PDT 2013


Le lundi 08 juillet 2013 20:08:18, Jeff McKenna a écrit :
> Let me know if you need help with the .org part....to be honest I'm not
> fully understanding how we would do all this yet...but it could be
> linked somehow from http://www.mapserver.org/development/

The ssh suggestion of Thomas makes sense. We would likely need a dedicated 
unpriviledged user account on the server on which to upload the HTML files, 
just in case the key gets compromised (just to be paranoid : the 
administrators of the Travis system are very likely in a position to get the 
secret stuff since it is their system that does the decryption ...). On that 
account, generate a public/private pair of a ssh key. Then use the "travis 
encrypt MY_PRIVATE_SSH_KEY=value_of_the_private_ssh_key", and then in the 
script run by Travis, we can copy $MY_PRIVATE_SSH_KEY to 
the_server_private_key and scp -i the_server_private_key an archive of the 
HTML files and un-archive it on the server (using a rsync daemon on the server 
would probably be a bit more efficient)

If we don't want to depend on the cronjob that runs on my machine, my 
master_with_coverage should be merged in the master .travis.yml file, so that 
it runs at each master Travis build (with a test so that this is done only on 
the master branch to avoid a future branch-6-4 to do it too. This can be done 
by testing the TRAVIS_BRANCH environmenet variable). And the encryption of the 
ssh private key should be done by someone who is the owner of the MapServer 
Travis account (I think. Unless someone with github.com/mapservert push 
priviledge is sufficient).

~~~~~

To tell the truth all this feels a bit complicated. If we could use a good old 
Jenkins instance, things would be much more simple... I've experimented for 
another project a script ( https://software.sandia.gov/trac/fast/wiki/gcovr ) 
that transforms the gcov output to Cobertura format, and the Cobertura Jenkins 
plugin can then publish the code coverage.

> 
> -jeff
> 
> On 2013-07-08 2:50 PM, thomas bonfort wrote:
> > Even,
> > This is way cool !
> > Maybe the resulting pages could be uploaded to the mapserver.org
> > website. I'm not sure about ftp access, but the upload could probably
> > be done with an ssh key. I would also need that functionality to
> > upload artifacts for failed test runs, in order to visually see which
> > tests failed, but that's another story...
> > 
> > regards,
> > Thomas
> > 
> > On 6 July 2013 23:52, Even Rouault <even.rouault at mines-paris.org> wrote:
> >> 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/ro
> >> uault/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
> >> 
> >> --
> 
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev

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


More information about the mapserver-dev mailing list