Travis CI
#1
Has anyone used Travis CI for their XBMC addons?

Even have used it for other projects?


I am looking for a way to setup automated tests on a couple addons/repositories and came across Travis CI and what appears to be easy integration with github

Also found this great article - http://jonathanbeluch.com/blog/2012/09/t...mc-addons/

Though so far it's a bit over my head

I'm wondering how do you go about setting your required imports that do not exist locally, such as the XBMC python libraries?

My target addon to setup is URLResolver - https://github.com/Eldorados/script.module.urlresolver
Reply
#2
Quote:I'm wondering how do you go about setting your required imports that do not exist locally, such as the XBMC python libraries?
Best way? Don't. Don't couple what you want to test with xbmc. Have all the web scraping and non-xbmc logic in one module and write unit tests for that. Like the blog says: the scraping is what fails, not the plugin stuff. You don't really need to test that.
Otherwise: you have to mock the xbmc modules inject them into sys.path for tests.
Reply
#3
Ok I might be confused, not totally wrapping my head around it all yet

In my case I want to run unit tests against the modules within URLResolver (a script module with a collection of individual 'resolvers' that resolve final links to many different file/streaming host sites)... when someone updates one of the resolvers for a site, I want to run a test that uses that resolver to determine if it works or not

These modules themselves import a number of libraries, including XBMC

How would I handle that? Or am I still thinking about this in a completely wrong way?
Reply
#4
I'm not familiar with this addon, but I imagine a test would be just to call 'resolve' function for an example url and check it it returned the correct thing. If that function doesn't depend on any xbmc modules it's straight forward. Basically you should have designed from beginning such that all code you want to test does not depend on xbmc modules.

If that ship has sailed you have to create dummy modules for xbmcgui etc. and implement everything that's called from the method you want to test. (You see where this is going. If you actually rely on things returned from the modules this quickly becomes messy)
Reply

Logout Mark Read Team Forum Stats Members Help
Travis CI0