Skip to main content

Embedded integration testing framework.

Project description

License Platforms Supported python version Build status Documentation Status codecov CodeFactor Last commit Commits since latest version

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)

Link to Eclipse Project

https://projects.eclipse.org/projects/iot.kiso-testing

Requirements

  • Python 3.10+
  • pip/poetry (used to get the rest of the requirements)

Install

pip install pykiso # Core framework
pip install pykiso[plugins] # For installing all plugins
pip install pykiso[all] # For installing all what we have to offer

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

cd kiso-testing
poetry install --all-extras
poetry shell

Pre-Commit

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

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

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

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] refactor!:
  • [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

Generate Changelog

After you installed the dev dependencies from the pipfile you are able to autogenerate the Changelog.

invoke changelog

Usage

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

Usage: pykiso [OPTIONS]

  Embedded Integration Test Framework - CLI Entry Point.

  TAG Filters: any additional option to be passed to the test as tag through
  the pykiso call. Multiple values must be separated with a comma.

  For example: pykiso -c your_config.yaml --branch-level dev,master --variant
  delta

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
  --step-report PATH              generate the step report at the specified
                                  path
  --failfast                      stop the test run on the first error or
                                  failure
  -v, --verbose                   activate the internal framework logs
  -p, --pattern TEXT              test filter pattern, e.g. 'test_suite_1.py'
                                  or 'test_*.py'. Or even more granularly
                                  'test_suite_1.py::test_class::test_name'
  --version                       Show the version and exit.
  -h, --help                      Show this message and exit.
  --logger                        Change the logger class used in pykiso, value
                                  is the import path to the logger class, example
                                  'logging.Logger'

Suitable config files are available in the examples folder.

Demo using example config

invoke run

Running the Tests

invoke test

or

pytest

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-1.3.4.tar.gz (186.1 kB view details)

Uploaded Source

Built Distribution

pykiso-1.3.4-py3-none-any.whl (267.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pykiso-1.3.4.tar.gz
  • Upload date:
  • Size: 186.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.10 Linux/6.8.0-1029-azure

File hashes

Hashes for pykiso-1.3.4.tar.gz
Algorithm Hash digest
SHA256 76887290f2724662cb20c0a97d3f7f19b0e7da77b3a35a971c05856a072396be
MD5 40ffe8fdc1b7c952a98ed04dcd147a29
BLAKE2b-256 53ac4021602c29605b5f04246e07d5a42c8f6b6c6dd97bd6135010f7b3b231ea

See more details on using hashes here.

File details

Details for the file pykiso-1.3.4-py3-none-any.whl.

File metadata

  • Download URL: pykiso-1.3.4-py3-none-any.whl
  • Upload date:
  • Size: 267.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.10 Linux/6.8.0-1029-azure

File hashes

Hashes for pykiso-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 00738d8e5d627de47a9ec0ba01b1e08b33b1b6fbeaa29b002fe69d01d64663a0
MD5 0ed30af8fb0a40fc1ad6f13c7deb9248
BLAKE2b-256 b0d6a03a8ea0e6d0549db52d11b1c2729225d52d1445550892067dde993a5fa5

See more details on using hashes here.

Supported by

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