integration-test-plugin


Nameintegration-test-plugin JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/Bacondish2023/integration_test_plugin
SummaryA plugin which enable testing of target executables on Python3 unittest framework.
upload_time2024-02-12 07:14:02
maintainer
docs_urlNone
authorHidekazu TAKAHASHI
requires_python>=3.6
licenseMIT License
keywords development testing-tool
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Integration Test Plugin

A plugin which enable testing of target executables on Python3 unittest framework.

Intended user

* The person who wants to test executable with automated method. And the executable outputs stream.


## Introduction

**Integration Test Plugin** is a Python package which adds testing functionality for executable to Python unittest.
It supports automation because it is designed to be used with Python unittest together.
And it works on various platforms.

![Concept](doc/development/20_design/image/concept.png)

User can define their own test case on python3 code using this package.

The Integration Test Plugin verifies behavior of process under test through stream such as stdout, stderr, log file.
These verifies have timeout.
When tested process crashes, the crash is detected as timeout.


## Features

* **Verification**
    * Tests can check expected patterns are in stream output.
    * Tests can check exit of process and exit code.
    * Tests can check presence of file, directory.
* **Crash detection**
    * Tests can detect and make the result NG if the process under test crashes.
* **Automation support**
    * All test cases can be discovered and run by command-line operation.


## Motivation

With stream, we can test behavior of whole executable easily.
[launch_testing](https://github.com/ros2/launch) is known as one of testing tool using stream.
It has useful assertions such as `assertWaitFor` verifies that expected string is in stream.
But, it is not available on out of ROS because it depends on ROS environment.

Therefore, this project aims to create a generic integration test tool that does not depend on specific platform.


## Prerequisites

#### Supported Platform

* Linux
* Windows
* MacOS

#### Required Software

* **Python 3** 3.6.8 or above


## How to Use

#### Install

```sh
pip install integration_test_plugin
```

#### Example

There are 2 examples.

###### Run

```sh
python -m unittest example.test_air_conditioner_simulation
python -m unittest example.test_mailer
```

###### Code

* [test_air_conditioner_simulation](example/test_air_conditioner_simulation.py)
* [test_mailer](example/test_mailer.py)

#### Verifier

Following verifiers are available on this project.
Details are on implementation comment.

|Verifier|Package|
|:---|:---|
|ProcessVerifier.assertExit()|integration_test_plugin.process_verifier|
|StreamVerifier.assertPattern()|integration_test_plugin.stream_verifier|
|assertFileExist()<br>assertFileNotExist()<br>assertDirectoryExist()<br>assertDirectoryNotExist()|integration_test_plugin.path_verifier|


## License

Copyright 2024 [Hidekazu TAKAHASHI](https://github.com/Bacondish2023).
This project is free and open-source software licensed
under the **MIT License**.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Bacondish2023/integration_test_plugin",
    "name": "integration-test-plugin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "development testing-tool",
    "author": "Hidekazu TAKAHASHI",
    "author_email": "139677991+Bacondish2023@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/0b/28/45843f307f160c8ad30642b482d38b677cb95483c13986a4e4f9ab4db054/integration_test_plugin-1.0.0.tar.gz",
    "platform": null,
    "description": "# Integration Test Plugin\n\nA plugin which enable testing of target executables on Python3 unittest framework.\n\nIntended user\n\n* The person who wants to test executable with automated method. And the executable outputs stream.\n\n\n## Introduction\n\n**Integration Test Plugin** is a Python package which adds testing functionality for executable to Python unittest.\nIt supports automation because it is designed to be used with Python unittest together.\nAnd it works on various platforms.\n\n![Concept](doc/development/20_design/image/concept.png)\n\nUser can define their own test case on python3 code using this package.\n\nThe Integration Test Plugin verifies behavior of process under test through stream such as stdout, stderr, log file.\nThese verifies have timeout.\nWhen tested process crashes, the crash is detected as timeout.\n\n\n## Features\n\n* **Verification**\n    * Tests can check expected patterns are in stream output.\n    * Tests can check exit of process and exit code.\n    * Tests can check presence of file, directory.\n* **Crash detection**\n    * Tests can detect and make the result NG if the process under test crashes.\n* **Automation support**\n    * All test cases can be discovered and run by command-line operation.\n\n\n## Motivation\n\nWith stream, we can test behavior of whole executable easily.\n[launch_testing](https://github.com/ros2/launch) is known as one of testing tool using stream.\nIt has useful assertions such as `assertWaitFor` verifies that expected string is in stream.\nBut, it is not available on out of ROS because it depends on ROS environment.\n\nTherefore, this project aims to create a generic integration test tool that does not depend on specific platform.\n\n\n## Prerequisites\n\n#### Supported Platform\n\n* Linux\n* Windows\n* MacOS\n\n#### Required Software\n\n* **Python 3** 3.6.8 or above\n\n\n## How to Use\n\n#### Install\n\n```sh\npip install integration_test_plugin\n```\n\n#### Example\n\nThere are 2 examples.\n\n###### Run\n\n```sh\npython -m unittest example.test_air_conditioner_simulation\npython -m unittest example.test_mailer\n```\n\n###### Code\n\n* [test_air_conditioner_simulation](example/test_air_conditioner_simulation.py)\n* [test_mailer](example/test_mailer.py)\n\n#### Verifier\n\nFollowing verifiers are available on this project.\nDetails are on implementation comment.\n\n|Verifier|Package|\n|:---|:---|\n|ProcessVerifier.assertExit()|integration_test_plugin.process_verifier|\n|StreamVerifier.assertPattern()|integration_test_plugin.stream_verifier|\n|assertFileExist()<br>assertFileNotExist()<br>assertDirectoryExist()<br>assertDirectoryNotExist()|integration_test_plugin.path_verifier|\n\n\n## License\n\nCopyright 2024 [Hidekazu TAKAHASHI](https://github.com/Bacondish2023).\nThis project is free and open-source software licensed\nunder the **MIT License**.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A plugin which enable testing of target executables on Python3 unittest framework.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/Bacondish2023/integration_test_plugin"
    },
    "split_keywords": [
        "development",
        "testing-tool"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "752b3fdfabe73460ff32c62534354d9232dffea776e1a7fd6cfb65a86a05e3f8",
                "md5": "b6bb9efb68f068c5ed43d17d3bf260f7",
                "sha256": "28fe306d83a1a4794cd694778d0581da862e324cd82e0cdbf4ad3a74a484ee95"
            },
            "downloads": -1,
            "filename": "integration_test_plugin-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b6bb9efb68f068c5ed43d17d3bf260f7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5776,
            "upload_time": "2024-02-12T07:14:00",
            "upload_time_iso_8601": "2024-02-12T07:14:00.636483Z",
            "url": "https://files.pythonhosted.org/packages/75/2b/3fdfabe73460ff32c62534354d9232dffea776e1a7fd6cfb65a86a05e3f8/integration_test_plugin-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b2845843f307f160c8ad30642b482d38b677cb95483c13986a4e4f9ab4db054",
                "md5": "78113b29cb121188fc5c38a810fe8caf",
                "sha256": "e401c49a0d750ff14e0bbcc704b93c1c17336316702212b9606eb444e449a5c8"
            },
            "downloads": -1,
            "filename": "integration_test_plugin-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "78113b29cb121188fc5c38a810fe8caf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5386,
            "upload_time": "2024-02-12T07:14:02",
            "upload_time_iso_8601": "2024-02-12T07:14:02.895518Z",
            "url": "https://files.pythonhosted.org/packages/0b/28/45843f307f160c8ad30642b482d38b677cb95483c13986a4e4f9ab4db054/integration_test_plugin-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-12 07:14:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Bacondish2023",
    "github_project": "integration_test_plugin",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "integration-test-plugin"
}
        
Elapsed time: 0.40080s