Getting Started with pykiso

Requirements

  • Python 3.6+

  • pip/pipenv (used to get the rest of the requirements)

Install

git clone https://github.com/eclipse/kiso-testing.git
cd kiso-testing
pip install .

Pipenv is more appropriate for developers as it automatically creates virtual environments.

git clone https://github.com/eclipse/kiso-testing.git
cd kiso-testing
pipenv install --dev
pipenv shell

Usage

Once installed the application is bound to pykiso, it can be called with the following arguments:

$ pykiso --help
Usage: pykiso [OPTIONS]

  Embedded Integration Test Framework - CLI Entry Point.

  :param test_configuration_file: path to the YAML config file :param
  log_path: path to directory or file to write logs to :param log_level: any
  of DEBUG, INFO, WARNING, ERROR :param report_type: if "test", the standard
  report, if "junit", a junit report is generated

Options:
  -c, --test-configuration-file FILE
                                  path to the test configuration file (in YAML
                                  format)  [required]
  -l, --log-path PATH             path to log-file or folder. If not set will
                                  log to STDOUT
  --log-level [DEBUG|INFO|WARNING|ERROR]
                                  set the verbosity of the logging
  --junit                         enables the generation of a junit report
  --text                          default, test results are only displayed in
                                  the console
  --version                       Show the version and exit.
  --help                          Show this message and exit.

Suitable config files are available in the test-examples folder.

Demo using example config

invoke run

Running the Tests

invoke test

or

pytest

List of limitations / todos for the python side

  • When the auxiliary does not answer (ping or else), BasicTest.cleanup_and_skip() call will result in a lock and break the framework.

  • ☐ No test-section will be executed, needs to be removed later.

  • ☒ test configuration files need to be reworked

  • ☒ Names & configurations in the cfg file json are character precise class names & associated parameters.

  • ☐ Spelling mistakes need to be fixed! ongoing

  • ☐ Add verbosity parameters to pass to the unittest framework to get more details about the test.

  • Add result parsing for Jenkins (see: https://stackoverflow.com/questions/11241781/python-unittests-in-jenkins).

  • ☒ Create a python package - ☐ and host it on pip.