Files
openvino/docs/scripts/tests/conftest.py
Ilya Lavrenov e3098ece7e DOCS: port changes from releases/2022/1 (#11040)
* Added migration for deployment (#10800)

* Added migration for deployment

* Addressed comments

* more info after the What's new Sessions' questions (#10803)

* more info after the What's new Sessions' questions

* generalizing the optimal_batch_size vs explicit value message

* Update docs/OV_Runtime_UG/automatic_batching.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update docs/OV_Runtime_UG/automatic_batching.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update docs/OV_Runtime_UG/automatic_batching.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update docs/OV_Runtime_UG/automatic_batching.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update docs/OV_Runtime_UG/automatic_batching.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Update docs/OV_Runtime_UG/automatic_batching.md

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Perf Hints docs and General Opt Guide refactoring (#10815)

* Brushed the general optimization page

* Opt GUIDE, WIP

* perf hints doc placeholder

* WIP

* WIP2

* WIP 3

* added streams and few other details

* fixed titles, misprints etc

* Perf hints

* movin the runtime optimizations intro

* fixed link

* Apply suggestions from code review

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* some details on the FIL and other means when pure inference time is not the only factor

* shuffled according to general->use-case->device-specifics flow, minor brushing

* next iter

* section on optimizing for tput and latency

* couple of links to the features support matrix

* Links, brushing, dedicated subsections for Latency/FIL/Tput

* had to make the link less specific (otherwise docs compilations fails)

* removing the Temp/Should be moved to the Opt Guide

* shuffled the tput/latency/etc info into separated documents. also the following docs moved from the temp into specific feature, general product desc or corresponding plugins

-   openvino_docs_IE_DG_Model_caching_overview
-   openvino_docs_IE_DG_Int8Inference
-   openvino_docs_IE_DG_Bfloat16Inference
-   openvino_docs_OV_UG_NoDynamicShapes

* fixed toc for ov_dynamic_shapes.md

* referring the openvino_docs_IE_DG_Bfloat16Inference to avoid docs compilation errors

* fixed main product TOC, removed ref from the second-level items

* reviewers remarks

* reverted the openvino_docs_OV_UG_NoDynamicShapes

* reverting openvino_docs_IE_DG_Bfloat16Inference and openvino_docs_IE_DG_Int8Inference

* "No dynamic shapes" to the "Dynamic shapes" as TOC

* removed duplication

* minor brushing

* Caching to the next level in TOC

* brushing

* more on the perf counters ( for latency and dynamic cases)

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

* Updated common IE pipeline infer-request section (#10844)

* Updated common IE pipeline infer-reqest section

* Update ov_infer_request.md

* Apply suggestions from code review

Co-authored-by: Karol Blaszczak <karol.blaszczak@intel.com>

Co-authored-by: Maxim Shevtsov <maxim.y.shevtsov@intel.com>
Co-authored-by: Karol Blaszczak <karol.blaszczak@intel.com>

* DOCS: Removed useless 4 spaces in snippets (#10870)

* Updated snippets

* Added link to encryption

* [DOCS] ARM CPU plugin docs (#10885)

* initial commit

ARM_CPU.md added
ARM CPU is added to the list of supported devices

* Update the list of supported properties

* Update Device_Plugins.md

* Update CODEOWNERS

* Removed quotes in limitations section

* NVIDIA and Android are added to the list of supported devices

* Added See Also section and reg sign to arm

* Added Preprocessing acceleration section

* Update the list of supported layers

* updated list of supported layers

* fix typos

* Added support disclaimer

* update trade and reg symbols

* fixed typos

* fix typos

* reg fix

* add reg symbol back

Co-authored-by: Vitaly Tuzov <vitaly.tuzov@intel.com>

* Try to fix visualization (#10896)

* Try to fix visualization

* New try

* Update Install&Deployment for migration guide to 22/1 (#10933)

* updates

* update

* Getting started improvements (#10948)

* Onnx updates (#10962)

* onnx changes

* onnx updates

* onnx updates

* fix broken anchors api reference (#10976)

* add ote repo (#10979)

* DOCS: Increase content width (#10995)

* fixes

* fix

* Fixed compilation

Co-authored-by: Maxim Shevtsov <maxim.y.shevtsov@intel.com>
Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
Co-authored-by: Karol Blaszczak <karol.blaszczak@intel.com>
Co-authored-by: Aleksandr Voron <aleksandr.voron@intel.com>
Co-authored-by: Vitaly Tuzov <vitaly.tuzov@intel.com>
Co-authored-by: Ilya Churaev <ilya.churaev@intel.com>
Co-authored-by: Yuan Xu <yuan1.xu@intel.com>
Co-authored-by: Victoria Yashina <victoria.yashina@intel.com>
Co-authored-by: Nikolay Tyukaev <nikolay.tyukaev@intel.com>
2022-03-18 17:48:45 +03:00

164 lines
5.7 KiB
Python

# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
""" Configuration for tests.
Tests for documentation utilize pytest test framework for tests execution
and reports generation.
Documentation generation tests process Doxygen log to generate test per
documentation source file (.hpp, .md, etc. files). Source files
with errors can be skipped (--doxygen-skip) or excluded temporary
(--doxygen-xfail).
Usage:
pytest --doxygen doxygen.log --html doc-generation.html test_doc-generation.py
"""
import pytest
from utils.log import LogParser
def pytest_addoption(parser):
""" Define extra options for pytest options
"""
parser.addoption('--doxygen', help='Doxygen log path to run tests for')
parser.addoption('--sphinx', help='Sphinx log path to run tests for')
parser.addoption(
'--doxygen-strip',
default='tmp_docs/',
help='Path to strip from paths found in doxygen log')
parser.addoption(
'--sphinx-strip',
default='tmp_docs/',
help='Path to strip from paths found in sphinx log')
parser.addoption(
'--suppress-warnings',
action='append',
default=[],
help='A list of warning patterns to suppress')
parser.addoption(
'--doxygen-xfail',
action='append',
default=[],
help='A file with relative paths to a files with known failures')
parser.addoption(
'--doxygen-skip',
action='append',
default=[],
help='A file with relative paths to a files to exclude from validation')
parser.addoption(
'--include_omz',
action="store_true",
default=False,
help='Include link check for omz docs')
parser.addoption(
'--include_wb',
action="store_true",
default=False,
help='Include link check for workbench docs')
parser.addoption(
'--include_pot',
action="store_true",
default=False,
help='Include link check for pot docs')
parser.addoption(
'--include_gst',
action="store_true",
default=False,
help='Include link check for gst docs')
parser.addoption(
'--include_ovms',
action="store_true",
default=False,
help='Include link check for ovms')
parser.addoption(
'--include_ote',
action="store_true",
default=False,
help='Include link check for ote')
def read_lists(configs):
"""Read lines from files from configs. Return unique items.
"""
files = set()
for config_path in configs:
try:
with open(config_path, 'r', encoding='utf-8') as config:
files.update(map(str.strip, config.readlines()))
except OSError:
pass
return list(files)
def pytest_generate_tests(metafunc):
""" Generate tests depending on command line options
"""
exclude_links = {'open_model_zoo', 'workbench', 'pot', 'gst', 'omz', 'ovms', 'ote'}
if metafunc.config.getoption('include_omz'):
exclude_links.remove('open_model_zoo')
exclude_links.remove('omz')
if metafunc.config.getoption('include_wb'):
exclude_links.remove('workbench')
if metafunc.config.getoption('include_pot'):
exclude_links.remove('pot')
if metafunc.config.getoption('include_gst'):
exclude_links.remove('gst')
if metafunc.config.getoption('include_ovms'):
exclude_links.remove('ovms')
if metafunc.config.getoption('include_ote'):
exclude_links.remove('ote')
# warnings to ignore
suppress_warnings = read_lists(metafunc.config.getoption('suppress_warnings'))
for link in exclude_links:
doxy_ref_pattern = "unable to resolve reference to '{}".format(link)
sphinx_ref_pattern = "toctree contains reference to nonexisting document '{}".format(link)
sphinx_ref_pattern2 = "unknown document: {}".format(link)
suppress_warnings.append(doxy_ref_pattern)
suppress_warnings.append(sphinx_ref_pattern)
suppress_warnings.append(sphinx_ref_pattern2)
# read doxygen log
doxy_parser = LogParser(metafunc.config.getoption('doxygen'),
strip=metafunc.config.getoption('doxygen_strip'),
xfail_list=metafunc.config.getoption('doxygen_xfail'),
suppress_warnings=suppress_warnings)
doxy_parser.parse()
doxygen_warnings = doxy_parser.filter()
# read sphinx log
sphinx_parser = LogParser(metafunc.config.getoption('sphinx'),
strip=metafunc.config.getoption('sphinx_strip'),
xfail_list=metafunc.config.getoption('doxygen_xfail'),
suppress_warnings=suppress_warnings
)
sphinx_parser.parse()
sphinx_warnings = sphinx_parser.filter()
all_warnings = dict()
all_warnings.update(doxygen_warnings)
all_warnings.update(sphinx_warnings)
filtered_keys = filter(lambda line: not any([line.startswith(repo) for repo in exclude_links]), all_warnings)
files_with_errors = {key: all_warnings[key] for key in filtered_keys}
# read mute lists
marks = dict()
marks.update(
(name, pytest.mark.xfail)
for name in read_lists(metafunc.config.getoption('doxygen_xfail')))
marks.update(
(name, pytest.mark.skip)
for name in read_lists(metafunc.config.getoption('doxygen_skip')))
# generate tests
if 'doxygen_errors' in metafunc.fixturenames:
metafunc.parametrize(
'doxygen_errors', [
pytest.param(errors, marks=marks[file])
if file in marks else errors for file, errors in files_with_errors.items()
],
ids=list(files_with_errors.keys()))