How to use the ptr.test_result function in ptr

To help you get started, we’ve selected a few ptr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebookincubator / ptr / ptr_tests_fixtures.py View on Github external
),
    runtime=0,
    timeout=False,
)
EXPECTED_PTR_COVERAGE_FAIL_RESULT = test_result(
    setup_py_path=Path("unittest/setup.py"),
    returncode=3,
    output=(
        f"The following files did not meet coverage requirements:\n  tg{sep}tg.py: "
        + "22 < 99 - Missing: 39-59, 62-73, 121, 145-149, 153-225, 231-234, 238\n  "
        + "TOTAL: 40 < 99 - Missing: \n"
    ),
    runtime=0,
    timeout=False,
)
EXPECTED_PTR_COVERAGE_MISSING_FILE_RESULT = test_result(
    setup_py_path=Path("unittest/setup.py"),
    returncode=3,
    output=(
        "fake_file.py has not reported any coverage. Does the file exist? "
        + "Does it get ran during tests? Remove from setup config."
    ),
    runtime=0,
    timeout=False,
)

EXPECTED_COVERAGE_RESULTS = [
    test_result(
        setup_py_path=Path("project69/setup.py"),
        returncode=0,
        output="Killed it",
        runtime=4,
github facebookincubator / ptr / ptr_tests_fixtures.py View on Github external
runtime=0,
    timeout=False,
)
EXPECTED_PTR_COVERAGE_MISSING_FILE_RESULT = test_result(
    setup_py_path=Path("unittest/setup.py"),
    returncode=3,
    output=(
        "fake_file.py has not reported any coverage. Does the file exist? "
        + "Does it get ran during tests? Remove from setup config."
    ),
    runtime=0,
    timeout=False,
)

EXPECTED_COVERAGE_RESULTS = [
    test_result(
        setup_py_path=Path("project69/setup.py"),
        returncode=0,
        output="Killed it",
        runtime=4,
        timeout=False,
    ),
    test_result(
        setup_py_path=Path("project1/setup.py"),
        returncode=2,
        output="Timeout during Running project1/tests.py tests via coverage",
        runtime=1,
        timeout=True,
    ),
    test_result(
        setup_py_path=Path("project2/setup.py"),
        returncode=1,
github facebookincubator / ptr / ptr_tests.py View on Github external
async def fake_test_steps_runner(
    *args: Any, **kwargs: Any
) -> Tuple[Optional[ptr.test_result], int]:
    return (None, TOTAL_REPORTER_TESTS)
github facebookincubator / ptr / ptr_tests_fixtures.py View on Github external
# Disabled is set as we --run-disabled the run in CI
EXPECTED_TEST_PARAMS = {
    "disabled": True,
    "entry_point_module": "ptr",
    "test_suite": "ptr_tests",
    "test_suite_timeout": 120,
    "required_coverage": {"ptr.py": 85, "TOTAL": 90},
    "run_black": True,
    "run_mypy": True,
    "run_flake8": True,
    "run_pylint": True,
    "run_pyre": True,
}

EXPECTED_COVERAGE_FAIL_RESULT = test_result(
    setup_py_path=Path("unittest/setup.py"),
    returncode=3,
    output=(
        "The following files did not meet coverage requirements:\n"
        + f"  unittest{sep}ptr.py: 69 < 99 - Missing: 70-72, 76-94, 98\n"
    ),
    runtime=0,
    timeout=False,
)
EXPECTED_PTR_COVERAGE_FAIL_RESULT = test_result(
    setup_py_path=Path("unittest/setup.py"),
    returncode=3,
    output=(
        f"The following files did not meet coverage requirements:\n  tg{sep}tg.py: "
        + "22 < 99 - Missing: 39-59, 62-73, 121, 145-149, 153-225, 231-234, 238\n  "
        + "TOTAL: 40 < 99 - Missing: \n"
github facebookincubator / ptr / ptr_tests_fixtures.py View on Github external
"run_flake8": True,
    "run_pylint": True,
    "run_pyre": True,
}

EXPECTED_COVERAGE_FAIL_RESULT = test_result(
    setup_py_path=Path("unittest/setup.py"),
    returncode=3,
    output=(
        "The following files did not meet coverage requirements:\n"
        + f"  unittest{sep}ptr.py: 69 < 99 - Missing: 70-72, 76-94, 98\n"
    ),
    runtime=0,
    timeout=False,
)
EXPECTED_PTR_COVERAGE_FAIL_RESULT = test_result(
    setup_py_path=Path("unittest/setup.py"),
    returncode=3,
    output=(
        f"The following files did not meet coverage requirements:\n  tg{sep}tg.py: "
        + "22 < 99 - Missing: 39-59, 62-73, 121, 145-149, 153-225, 231-234, 238\n  "
        + "TOTAL: 40 < 99 - Missing: \n"
    ),
    runtime=0,
    timeout=False,
)
EXPECTED_PTR_COVERAGE_MISSING_FILE_RESULT = test_result(
    setup_py_path=Path("unittest/setup.py"),
    returncode=3,
    output=(
        "fake_file.py has not reported any coverage. Does the file exist? "
        + "Does it get ran during tests? Remove from setup config."