tree: f19989c6c12835a600c23e13d5c110a9cf4906e2 [path history] [tgz]
  1. docker-files/
  2. pio_tests/
  3. .rat-excludes
  4. after_script.travis.sh
  5. before_script.travis.sh
  6. build_docker.sh
  7. check_libraries.sh
  8. check_license.sh
  9. docker-compose.yml
  10. Dockerfile
  11. Dockerfile.base
  12. README.md
  13. run_docker.sh
  14. script.travis.sh
  15. unit.sh
tests/README.md

Testing PredictionIO

Intention of this subdirectory is to amass different types of tests other than unit-tests and also to make developers life easier giving them with means to check the application deterministically for different configurations. Moreover, it provides testing scenarios for TravisCI to be run on pull requests and commits.

Integration Tests

These tests are mostly user-functionality tests. They check logic and reliability of the system. In order to get familiar with their structure, please see README.

Docker image

After introducing some changes, a developer would like to try them against different configurations, namely to see if everything works as expected e.g. when you change the data repository for the events or meta-data. A good way to that is to use the docker image with installed and running dependencies.

To download the image run:

$ docker pull predictionio/pio-testing

To build the image use the script:

$ tests/docker-build.sh <image_name>

This is necessary to infer proper versions of dependencies e.g. Spark to be included in the image.

The most convenient way to make use of it is to execute run_docker.sh script passing it the configuration, the path to PredictionIO's repository with archived snapshot and the command to run. When no command is provided it opens a bash shell inside the docker image. Example of usage:

$ ./run_docker.sh ELASTICSEARCH HBASE LOCALFS \
    ~/projects/predictionio "echo 'All tests passed...'"

Directory structure inside the image:

  • /PredictionIO - extracted snapshot (/PredictionIO/bin is also already added to PATH)
  • /pio_host - mounted path to repository
  • /tests/pio_tests - copy of integration tests
  • /vendors - directory with installed services
  • /drivers - jars with database drivers