testplan.runnable package
Subpackages
- testplan.runnable.interactive package
- Submodules
- testplan.runnable.interactive.base
TestRunnerIHandler
TestRunnerIHandler.CONFIG
TestRunnerIHandler.STATUS
TestRunnerIHandler.abort_dependencies()
TestRunnerIHandler.aborting()
TestRunnerIHandler.all_tests()
TestRunnerIHandler.all_tests_operation()
TestRunnerIHandler.environment_resource_context()
TestRunnerIHandler.environment_resource_operation()
TestRunnerIHandler.environment_resource_start()
TestRunnerIHandler.environment_resource_stop()
TestRunnerIHandler.exit_code
TestRunnerIHandler.exporters
TestRunnerIHandler.get_driver_info_report()
TestRunnerIHandler.get_environment()
TestRunnerIHandler.get_environment_context()
TestRunnerIHandler.get_environment_resource()
TestRunnerIHandler.http_handler_info
TestRunnerIHandler.reload()
TestRunnerIHandler.reload_report()
TestRunnerIHandler.report
TestRunnerIHandler.reset_all_tests()
TestRunnerIHandler.reset_test()
TestRunnerIHandler.run()
TestRunnerIHandler.run_all_tests()
TestRunnerIHandler.run_test()
TestRunnerIHandler.run_test_case()
TestRunnerIHandler.run_test_case_param()
TestRunnerIHandler.run_test_suite()
TestRunnerIHandler.setup()
TestRunnerIHandler.start_environment()
TestRunnerIHandler.start_resource()
TestRunnerIHandler.start_test_resources()
TestRunnerIHandler.start_tests()
TestRunnerIHandler.stop_environment()
TestRunnerIHandler.stop_resource()
TestRunnerIHandler.stop_test_resources()
TestRunnerIHandler.stop_tests()
TestRunnerIHandler.target
TestRunnerIHandler.teardown()
TestRunnerIHandler.test()
TestRunnerIHandler.test_case_report()
TestRunnerIHandler.test_report()
TestRunnerIHandler.test_resource()
TestRunnerIHandler.test_resource_operation()
TestRunnerIHandler.test_resource_start()
TestRunnerIHandler.test_resource_stop()
TestRunnerIHandlerConfig
- testplan.runnable.interactive.http
- testplan.runnable.interactive.reloader
- testplan.runnable.interactive.resource_loader
- testplan.runnable.interactive.base
- Module contents
- Submodules
Submodules
testplan.runnable.base module
Tests runner module.
- class testplan.runnable.base.TaskInformation(target: testplan.testing.base.Test | testplan.runners.pools.tasks.base.Task | Callable, materialized_test: testplan.testing.base.Test, uid: str)[source]
Bases:
object
- uid: str
- class testplan.runnable.base.TestRunner(**options)[source]
Bases:
Runnable
Adds tests to test
executor
resources and invoke reportexporter
objects to create theTestRunnerResult
.- Parameters:
name (
str
) – Name of test runner.description (
str
) – Description of test runner.logger_level (
int
) – Logger level for stdout.runpath (
str
orcallable
) – Input runpath.path_cleanup (
bool
) – Clean previous runpath entries.all_tasks_local (
bool
) – Schedule all tasks in local poolshuffle (
list
ofstr
) – Shuffle strategy.shuffle_seed (
float
) – Shuffle seed.exporters (
list
) – Exporters for reports creation.stdout_style (
Style
) – Styling output options.report_dir (
str
) – Report directory.xml_dir (
str
) – XML output directory.pdf_path (
str
) – PDF output path <PATH>/*.pdf.json_path (
str
) – JSON output path <PATH>/*.json.pdf_style (
Style
) – PDF creation styling options.http_url (
str
) – Web url for posting test report.report_tags (
list
) – Matches tests marked with any of the given tags.report_tags_all (
list
) – Match tests marked with all of the given tags.merge_scheduled_parts (
bool
) – Merge report of scheduled MultiTest parts.browse (
bool
orNoneType
) – Open web browser to display the test report.ui_port (
int
orNoneType
) – Port of web server for displaying test report.web_server_startup_timeout (
int
) – Timeout for starting web server.test_filter (Subclass of
BaseFilter
) – Tests filtering class.test_sorter (Subclass of
BaseSorter
) – Tests sorting class.test_lister (Subclass of
BaseLister
) – Tests listing class.verbose (
bool
) – Enable or disable verbose mode.debug (
bool
) – Enable or disable debug mode.timeout (
NoneType
orint
(greater than 0).) – Timeout value for test execution.abort_wait_timeout (
int
) – Timeout for test runner abort.interactive_handler (Subclass of :py:class: TestRunnerIHandler <testplan.runnable.interactive.base.TestRunnerIHandler>) – Handler for interactive mode execution.
extra_deps (
list
ofmodule
orstr
) – Extra module dependencies for interactive reload, or paths of these modules.label (
str
orNoneType
) – Label the test report with the given name, useful to categorize or classify similar reports .runtime_data (
dict
) – Historical runtime data which will be used for Multitest auto-part and weight-based Task smart-schedulingauto_part_runtime_limit (
int
orfloat
) – The runtime limitation for auto-part taskplan_runtime_target (
int
orfloat
) – The testplan total runtime limitation for smart schedule
- Param:
file_log_level: Logger level for file.
Also inherits all
Runnable
options.- CONFIG
alias of
TestRunnerConfig
- RESULT
alias of
TestRunnerResult
- STATUS
alias of
TestRunnerStatus
- add(target: Test | Task | Callable, resource: str | None = None) str | None [source]
Adds a
runnable
test entity, or aTask
, or a callable that returns a test entity to aExecutor
resource.
- add_environment(env: EnvironmentCreator, resource: Environments | None = None)[source]
Adds an environment to the target resource holder.
- Parameters:
env (Subclass of
EnvironmentCreator
) – Environment creator instance.resource (Subclass of
Environments
) – Target environments holder resource.
- Returns:
Environment uid.
- Return type:
str
- add_exporters(exporters: List[BaseExporter])[source]
Add a list of
report exporters
for outputting test report.- Parameters:
exporters (
list
ofExecutor
) – Test exporters to be added.
- add_remote_service(remote_service: RemoteService)[source]
Adds a remote service
RemoteService
object to test runner.- Parameters:
remote_service – RemoteService object
remote_service –
RemoteService
- add_resource(resource: Resource, uid: str | None = None) str [source]
Adds a test
executor
resource in the test runner environment.- Parameters:
resource – Test executor to be added.
uid – Optional input resource uid. We now force its equality with resource’s own uid.
- Returns:
Resource uid assigned.
- calculate_pool_size() None [source]
Calculate the right size of the pool based on the weight (runtime) of the tasks, so that runtime of all tasks meets the plan_runtime_target.
- calculate_pool_size_by_tasks(tasks: Collection[Task]) int [source]
Calculate the right size of the pool based on the weight (runtime) of the tasks, so that runtime of all tasks meets the plan_runtime_target.
- discard_pending_tasks(exec_selector: Expr, report_status: Status = Status.NONE, report_reason: str = '')[source]
- discover(path: str = '.', name_pattern: str | Pattern = '.*\\.py$') List[Task] [source]
Discover task targets under path in the modules that matches name pattern, and return the created Task object.
- Parameters:
path – the root path to start a recursive walk and discover, default is current directory.
name_pattern – a regex pattern to match the file name.
- Returns:
A list of Task objects
- property exporters
Return a list of
report exporters
.
- get_default_exporters()[source]
Instantiate certain exporters if related cmdline argument (e.g. –pdf) or programmatic arguments (e.g. pdf_path) is passed but there are not any exporter declarations.
- property report: TestReport
Tests report.
- schedule(task: Task | None = None, resource: str | None = None, **options) str | None [source]
Schedules a serializable
Task
in a task runnerPool
executor resource.- Parameters:
task (
Task
) – Input task, if it is None, a new Task will be constructed using the options parameter.resource (
str
orNoneType
) – Name of the target executor, which is usually a Pool, default value None indicates using local executor.options (
dict
) – Task input options.
- Return uid:
Assigned uid for task.
- Return type:
str
orNoneType
- schedule_all(path: str = '.', name_pattern: str | Pattern = '.*\\.py$', resource: str | None = None)[source]
Discover task targets under path in the modules that matches name pattern, create task objects from them and schedule them to resource (usually pool) for execution.
- Parameters:
path (
str
) – the root path to start a recursive walk and discover, default is current directory.name_pattern (
str
) – a regex pattern to match the file name.resource (
str
orNoneType
) – Name of the target executor, which is usually a Pool, default value None indicates using local executor.
- class testplan.runnable.base.TestRunnerConfig(**options)[source]
Bases:
RunnableConfig
Configuration object for
TestRunner
runnable object.- ignore_extra_keys = True
- class testplan.runnable.base.TestRunnerResult[source]
Bases:
RunnableResult
Result object of a
TestRunner
runnable object.- property success
Run was successful.
- class testplan.runnable.base.TestRunnerStatus[source]
Bases:
RunnableStatus
Status of a
TestRunner
runnable object.
- testplan.runnable.base.collate_for_merging(es: List[TestGroupReport | TestCaseReport]) List[List[TestGroupReport | TestCaseReport]] [source]
Group report entries into buckets, where synthesized ones in the same bucket containing the previous non-synthesized one.
- testplan.runnable.base.get_exporters(values)[source]
Validation function for exporter declarations.
- Parameters:
values – Single or a list of exporter declaration(s).
- Returns:
List of initialized exporter objects.