Life Abridged.

a luacov-coveralls caveat

I've done some continuous integration with travis-ci on my Lua libraries throughout the years. I've been following kikito's template to great success.

However, when I was setting it up for lua-complete I ran into an odd issue with luacov not excluding files correctly, that took a little bit to fix...

Note: I also should've used a squash commit, but oh well..

It was the exclude flag in the last part of the travis build:

  - luacov-coveralls -e $TRAVIS_BUILD_DIR/lua_install

The exclude flag doesn't just exclude certain directories, but rather certain patterns. lua-complete had a dash in the name, and luacov uses a string.match pattern in Lua to handle excludes. I had to go through some code to find it, but that ended up being the issue.

The fix was to just use sed to escape the dashes:

- EXCLUDE_DIR=`echo $TRAVIS_BUILD_DIR/lua_install | sed 's/-/%-/'`
- luacov-coveralls -e $EXCLUDE_DIR

I hope this helps anyone else who has issues using luacov-coveralls with projects that have dashes in the name!

comments powered by Disqus