Testplan Testing Framework

repository·main·Indexed 42 days ago

https://github.com/morganstanley/testplan

A multi-testing framework for Python designed for functional and system integration testing. It manages local live environments, mocks, and service connections, providing specialized packages for remote automation (testplan.common.remote), reporting (testplan.common.report), data serialization, and C++ testing integration for GoogleTest, CppUnit, and Hobbestest.

Tokens
83.5K
Snippets
275
Records
441
Agent score
51%

What's inside Testplan

  1. What is Testplan?

    main

    Testplan is a Python testing framework designed primarily for integration tests and application black-box testing. It has the capability to integrate with external unit testing frameworks like GTest and BoostTest.

    Key features include:

    • Local Live Environments: Starts interconnected environments (e.g., Client $\rightarrow$ Application $\rightarrow$ Service) to execute test scenarios.
    • Dynamic Configuration: Dynamically retrieves process/service endpoints and instantiates configuration files from templates using a context mechanism.
    • Lifecycle Fixtures: Provides hooks like setup, teardown, after_start, and after_stop to customize test execution.
    • Rich Reporting: Supports multiple output formats including Console, PDF, XML, and JSON.
  2. Explore the testplan package subpackages

    main

    The testplan framework is organized into several specialized subpackages. Depending on your testing needs, you will interact with one or more of the following:

    • testplan.common: Shared utilities and common components.
    • testplan.exporters: Tools for exporting test data or results.
    • testplan.testing: Core testing logic and utilities.
    • testplan.report: Functionality for generating and managing test reports.
    • testplan.runners: Components responsible for executing test suites or individual runnables.
    • testplan.runnable: The abstraction for units of work that can be executed within the framework.
  3. Use the testplan.common.serialization package for data serialization

    main

    The testplan.common.serialization package provides tools for serializing and deserializing data within the testplan framework. It is organized into submodules for handling specific data types and schema definitions.

    Key submodules include:

    • testplan.common.serialization.fields: Contains field definitions used to specify how individual data elements should be serialized.
    • testplan.common.serialization.schemas: Provides schema definitions to structure and validate complex data objects during serialization processes.
  4. Explore the testplan.testing package structure

    main

    The testplan.testing package is a multi-testing framework composed of several specialized subpackages and modules. Depending on your testing requirements, you can use different testing paradigms or integration modules:

    Testing Paradigms (Subpackages)

    • testplan.testing.multitest: For running multiple tests.
    • testplan.testing.cpp: For C++ integration testing.
    • testplan.testing.bdd: For Behavior-Driven Development (BDD) style testing.

    Core Functionality (Modules)

    • testplan.testing.base: Base testing functionality.
    • testplan.testing.filtering: Logic for filtering which tests to run.
    • testplan.testing.listing: Capabilities for listing available tests.
    • testplan.testing.ordering: Logic for determining the execution order of tests.
    • testplan.testing.result: Handling and reporting of test results.
    • testplan.testing.tagging: Managing test metadata via tags.

    Test Runner Integrations

    • testplan.testing.py_test: Integration with standard Python testing.
    • testplan.testing.pyunit: Integration with PyUnit.
    • testplan.testing.junit: Integration with JUnit-style reporting/execution.
  5. Explore the testplan.common.report package submodules

    main

    The testplan.common.report package provides reporting capabilities for the testplan framework. It is organized into several submodules that handle different aspects of report generation and data structure:

    • testplan.common.report.base: Contains the base classes and fundamental logic for report implementations.
    • testplan.common.report.log: Provides functionality for logging-based reporting.
    • testplan.common.report.schemas: Defines the data schemas and structures used within reports to ensure consistency and validation.
  6. Available driver modules in testplan.testing.multitest.driver

    main

    The testplan.testing.multitest.driver package includes several specialized modules for managing different types of test infrastructure and data stores:

    • app: Application-level driver logic.
    • base: Base driver classes and fundamental abstractions.
    • sqlite: Drivers for SQLite database interactions.
    • kafka: Drivers for Apache Kafka messaging.
    • zookeeper: Drivers for Apache ZooKeeper coordination.
  7. Core testplan modules

    main

    The main testplan package provides access to several foundational modules used to build and manage testing workflows:

    • testplan.base: Provides the base classes and fundamental abstractions for the framework.
    • testplan.defaults: Contains default configurations or settings used across the framework.
    • testplan.environment: Manages the execution environment and context for tests.
    • testplan.parser: Handles parsing of test definitions or configuration files.
    • testplan: The top-level module providing the primary entry points for the framework.
  8. Use the testplan.testing.cpp package for C++ testing

    main
    The testplan.testing.cpp package provides integration support for common C++ testing frameworks within the Testplan ecosystem. It allows you to leverage existing C++ test suites (like GoogleTest, CppUnit, or Hobbestest) as part of your Testplan execution flow. The package is organized into submodules, each dedicated to a specific C++ testing framework.
  9. Available driver subpackages in testplan.testing.multitest.driver

    main

    The testplan.testing.multitest.driver package provides specialized drivers for different communication protocols and testing scenarios. Depending on your system integration needs, you can use the following subpackages:

    • tcp: For TCP-based communication.
    • zmq: For ZeroMQ-based communication.
    • fix: For Financial Information eXchange (FIX) protocol testing.
    • http: For HTTP-based communication.
    • connection: For connection-related driver logic.