Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion conformance/results/mypy/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
version = "mypy 1.17.1"
test_duration = 2.04
1 change: 0 additions & 1 deletion conformance/results/pyright/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
version = "pyright 1.1.403"
test_duration = 1.83
4 changes: 0 additions & 4 deletions conformance/results/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,12 @@ <h3>Python Type System Conformance Test Results</h3>
<div class="table_container"><table><tbody>
<tr><th class="col1">&nbsp;</th>
<th class='tc-header'><div class='tc-name'>mypy 1.17.1</div>
<div class='tc-time'>2.0sec</div>
</th>
<th class='tc-header'><div class='tc-name'>pyright 1.1.403</div>
<div class='tc-time'>1.8sec</div>
</th>
<th class='tc-header'><div class='tc-name'>pyre 0.9.25</div>
<div class='tc-time'>10.3sec</div>
</th>
<th class='tc-header'><div class='tc-name'>zuban 0.0.19</div>
<div class='tc-time'>0.35sec</div>
</th>
</tr>
<tr><th class="column" colspan="5">
Expand Down
1 change: 0 additions & 1 deletion conformance/results/zuban/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
version = "zuban 0.0.19"
test_duration = 0.35
13 changes: 5 additions & 8 deletions conformance/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ def run_tests(
root_dir: Path,
type_checker: TypeChecker,
test_cases: Sequence[Path],
skip_timing: bool = False,
):
print(f"Running tests for {type_checker.name}")

test_start_time = time()
tests_output = type_checker.run_tests([file.name for file in test_cases])
test_duration = time() - test_start_time

print(f"Completed tests for {type_checker.name} in {test_duration:.2f} seconds")

for _, output in tests_output.items():
type_checker.parse_errors(output.splitlines())

Expand All @@ -40,7 +41,7 @@ def run_tests(
type_checker, results_dir, test_case, tests_output.get(test_case.name, "")
)

update_type_checker_info(type_checker, root_dir, test_duration, skip_timing=skip_timing)
update_type_checker_info(type_checker, root_dir)


def get_expected_errors(test_case: Path) -> tuple[
Expand Down Expand Up @@ -217,9 +218,7 @@ def update_output_for_test(
tomlkit.dump(existing_results, f)


def update_type_checker_info(
type_checker: TypeChecker, root_dir: Path, test_duration: float, skip_timing: bool = False
):
def update_type_checker_info(type_checker: TypeChecker, root_dir: Path):
# Record the version of the type checker used for the latest run.
version_file = root_dir / "results" / type_checker.name / "version.toml"

Expand All @@ -234,8 +233,6 @@ def update_type_checker_info(
existing_info = {}

existing_info["version"] = type_checker.get_version()
if not skip_timing:
existing_info["test_duration"] = round(test_duration, 2)

version_file.parent.mkdir(parents=True, exist_ok=True)
with open(version_file, "w") as f:
Expand Down Expand Up @@ -266,7 +263,7 @@ def main():
if not type_checker.install():
print(f"Skipping tests for {type_checker.name}")
else:
run_tests(root_dir, type_checker, test_cases, skip_timing=options.skip_timing)
run_tests(root_dir, type_checker, test_cases)

# Generate a summary report.
generate_summary(root_dir)
Expand Down
6 changes: 0 additions & 6 deletions conformance/src/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
@dataclass
class _Options:
report_only: bool | None
skip_timing: bool


def parse_options(argv: list[str]) -> _Options:
Expand All @@ -20,10 +19,5 @@ def parse_options(argv: list[str]) -> _Options:
action="store_true",
help="regenerates the test suite report from past results",
)
reporting_group.add_argument(
"--skip-timing",
action="store_true",
help="do not update timing information in the output files",
)
ret = _Options(**vars(parser.parse_args(argv)))
return ret
7 changes: 0 additions & 7 deletions conformance/src/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,8 @@ def generate_summary_html(root_dir: Path) -> str:
existing_info = {}

version = existing_info["version"] or "Unknown version"
test_duration = existing_info.get("test_duration")

summary_html.append(f"<th class='tc-header'><div class='tc-name'>{version}</div>")
if test_duration is not None:
if test_duration < 1:
duration = f"{test_duration:.2f}"
else:
duration = f"{test_duration:.1f}"
summary_html.append(f"<div class='tc-time'>{duration}sec</div>")
summary_html.append("</th>")

summary_html.append("</tr>")
Expand Down