Skip to main content

Embedded integration testing framework.

Project description

PyKiso

Optional Text

Introduction

pykiso is an integration test framework. With it, it is possible to write

  • Whitebox integration tests directly on my target device
  • Graybox integration tests to make sure the communication-link with my target device is working as expected
  • Blackbox integration tests to make sure my external device interfaces are working as expected

The project will contain:

  • The core python framework (this repository)
  • Framework plugins that are generic enough to be integrated as "native" (this repository)
  • Additional "testApps" for different targets platforms (e.g. stm32, ...) or languages (C, C++, ...) . It could be pure SW or also HW (other repositories)

Requirements

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

Install

cd kiso-testing
pip install .

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

cd kiso-testing
pipenv install --dev
pipenv shell

Pre-Commit

To improve code-quality, a configuration of pre-commit hooks are available. The following pre-commit hooks are used:

  • black
  • trailing-whitespace
  • end-of-file-fixer
  • check-docstring-first
  • check-json
  • check-added-large-files
  • check-yaml
  • debug-statements
  • flake8
  • isort

If you don't have pre-commit installed, you can get it using pip:

pip install pre-commit

Start using the hooks with

pre-commit install

NOTE

If you want to create auto changelogs you have to install Nodejs v14.17+. -> https://nodejs.org/en/download/

For initialization you have to call following command after cloning this repo only once.

npm install # on root folder level

pre-commit will then take care of auto generating changelogs. To run it manually call:

gen_changelog.bat # on windwos
gen_changelog.sh  # on unix or if you have shell.exe in your windows environment

Commit message convention

Commits are sorted into multiple categories based on keywords that can occur at any position as part of the commit message. [Category] Keywords

  • [BREAKING CHANGES] BREAKING CHANGE
  • [Features] feat:
  • [Fixes] fix:
  • [Docs] docs:
  • [Styles] style:
  • [Refactors] Refactors:
  • [Performances] perf:
  • [Tests] test:
  • [Build] build:
  • [Ci] ci: Each commit is considered only once according to the order of the categories listed above. Merge commits are ignored.

The tool commitizen can help you to create commits which follows these standards.

# if not yet installed:
pip install -U commitizen==2.20.4
# helps you to create a commit:
cz commit
# or use equivalent short variant:
cz c

Usage

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

Usage: pykiso [OPTIONS] [PATTERN]

  Embedded Integration Test Framework - CLI Entry Point.

  PATTERN: overwrite the test filter pattern from the YAML file (optional)

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
  --version                       Show the version and exit.
  -h, --help                          Show this message and exit.
  --variant                       allow the user to execute a subset of tests
                                  based on variants
  --branch-level                  allow the user to execute a subset of tests
                                  based on branch levels
  --junit                         enables the generation of a junit report
  --text                          default, test results are only displayed in
                                  the console

Suitable config files are available in the 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), GenericTest.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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykiso-0.15.1.tar.gz (97.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pykiso-0.15.1-py2.py3-none-any.whl (146.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pykiso-0.15.1.tar.gz.

File metadata

  • Download URL: pykiso-0.15.1.tar.gz
  • Upload date:
  • Size: 97.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.3

File hashes

Hashes for pykiso-0.15.1.tar.gz
Algorithm Hash digest
SHA256 910b00e20c31f277a7a489d0ee0bd7a73474df93f75983cbf7a05c34327f1e31
MD5 557180397884d2c0a9d7843df9d64fb7
BLAKE2b-256 92c5de188a7a6f27db8f0968f712d7fe7a8454f32d0c4fd93d375f34145df760

See more details on using hashes here.

File details

Details for the file pykiso-0.15.1-py2.py3-none-any.whl.

File metadata

  • Download URL: pykiso-0.15.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 146.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.3

File hashes

Hashes for pykiso-0.15.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 74e19c8a30e4b6da2c8f9f6719a328722a4b01427f3d23bfe558c8addb4f7fe7
MD5 c93f9aa38946ef622ceeb113a9f59bd5
BLAKE2b-256 81a966e0c7f593f300fce388771fdaefbcc90064f58fcc563f7ea2a8bbdf0675

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page