Skip to content

Testing

Dag Wieers edited this page Feb 2, 2021 · 21 revisions

Testing the latest code

It is not that hard to test the latest master branch code for testing or when improving the VRT.NU add-on.

Test the master branch (or any other branch)

By far the easiest way to test the latest and greatest code is by downloading the master branch ZIP archive. You can do this from the GitHub project page using the Clone or download button and clicking Download ZIP.

This also works for other branches, just switch to the user and branch you are interested in, and download the ZIP file using the same process and button as above.

Test from your local tree (with changes)

If you have the project cloned locally, like this:

$ git clone [email protected]:add-ons/plugin.video.vrt.nu.git
$ cd plugin.video.vrt.nu/

First make sure you have the latest copy in your cloned directory.

$ git checkout master
$ git pull --rebase origin master

Make a zip package on Linux

If you made any changes and you want to test those (on Linux), you can make a zip package by doing:

$ make

This will perform some basic sanity checks of your (modified) code and then creates a new zip package. You can also run:

$ make zip

To skip these sanity tests.

Make a zip package on Windows

If you made any changes and you want to test those (on Windows), you can make a zip package by doing:

> powershell Build-Zip.ps1

or

> pwsh Build-Zip.ps1

Transfer, install and test

Finally you can transfer this zip package to your Kodi system (if needed).

$ scp -rp plugin.video.vrt.nu-1.6.0-fd627b8.zip root@kodi01:

And install it in Kodi:

Settings » Add-ons » Install from zip file

Tip: Semi-automating zip package installation

An easy way to install a zip file on a remote Kodi system is by running:

$ ssh root@kodi01 kodi-send -a InstallFromZip

This will pop up the "Install from zip file" window so you can select the right zip package and install it with ease.

Reloading the VRT NU add-on before testing

In Kodi the best way to test a new version of the add-on is by loading another add-on first, and then return to the VRT.NU add-on. This guarantees the add-on is started afresh.

Testing on the command-line

Our testing-suite also includes a command-line utility that can run any API call directly.

Show main menu

$ ./tests/run.py /
** Running URI plugin://plugin.video.vrt.nu/ with args 
Info: [plugin.video.vrt.nu] Access: plugin://plugin.video.vrt.nu/
Debug: [plugin.video.vrt.nu][routing] Dispatching to 'main_menu', args: {}
-=( VRT NU )=-
» My favorites → /favorites
» All programs → /programs
» Categories → /categories
» Channels → /channels
» Live TV → /livetv
» Most recent → /recent
» Soon offline → /offline
» Featured content → /featured
» TV guide → /tvguide/date
» Search VRT NU → /search

Show program listing

$ ./tests/run.py /programs/buck
** Running URI plugin://plugin.video.vrt.nu/programs/buck with args 
Info: [plugin.video.vrt.nu] Access: plugin://plugin.video.vrt.nu/programs/buck
Debug: [plugin.video.vrt.nu][routing] Dispatching to 'programs', args: {u'program': u'buck'}
Notice: [plugin.video.vrt.nu] URL get: https://vrtnu-api.vrt.be/search?i=video&facets[programUrl]=//www.vrt.be/vrtnu/a-z/buck/&size=300
-=( Buck )=-
· Katrien onderzoekt Buck in het ziekenhuis → /play/id/vid-e1a59c6f-49eb-43f6-95c6-1fde47b55950/pbs-pub-dc469808-d71a-48c4-9477-c75f56329d30
· Dylan heeft een verrassing voor Mona → /play/id/vid-ec0717e4-bf3b-4805-8930-b809534db2b9/pbs-pub-aedc6044-6d42-48b7-a6da-cc920e3f692a
· Buck ontdekt dat Dylan Elias chanteert → /play/id/vid-388ea27a-1b35-425b-bc2e-630f90ee217c/pbs-pub-09416e93-acee-4043-9a4a-5c78f3875496
Clone this wiki locally