This python module introduces a basic framework for adding integration tests to PredictionIO. It is nothing more than a collection of utility functions mostly being wrappers over shell executed commands.
In order to execute tests, besides a configured PredictionIO environment one has to download the following python-3 packages:
tests.py - the executable script. Launches eventserver to be available for the tests. You can pass it arguments to:
For more information run:
python3 tests.py -h
As soon as the tests are finishied an XML file with JUnit-like test reports is created in the directory of execution.
Every test should be an instance of pio_tests.integration.BaseTestCase defined in pio_tests.integration.
Upon creation, a pio_tests.integration.TestContext object is provided to it with description of:
Every test should be registered in the appropriate place in tests.py file, whereas its definition should reside in pio_tests.scenarios module. If the test requires some additional files during the execution, you should put them under data directory mentioned above.
The best way to test different application engines is to make use of pio_tests.utility.AppEngine. Apart from containing utility functions, it downloads engine templates if necessary.
To see an example of implemented test check pio_tests.scenarios.quickstart_test, which is a repetition of the QuickStart tutorial from the doc site.