Skip to content

Commit

Permalink
Add test count to test gen diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Aug 18, 2021
1 parent 5a17fa6 commit 5a918db
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def run_generator(generator_name, test_providers: Iterable[TestProvider]):
if len(presets) != 0:
print(f"Filtering test-generator runs to only include presets: {', '.join(presets)}")

generated_test_count = 0
skipped_test_count = 0
for tprov in test_providers:
# runs anything that we don't want to repeat for every test case.
tprov.prepare()
Expand Down Expand Up @@ -149,6 +151,7 @@ def output_part(out_kind: str, name: str, fn: Callable[[Path, ], None]):
output_part("ssz", name, dump_ssz_fn(data, name, file_mode))
except SkippedTest as e:
print(e)
skipped_test_count += 1
shutil.rmtree(case_dir)
continue

Expand All @@ -172,10 +175,13 @@ def output_part(out_kind: str, name: str, fn: Callable[[Path, ], None]):
if not written_part:
shutil.rmtree(case_dir)
else:
generated_test_count += 1
# Only remove `INCOMPLETE` tag file
os.remove(incomplete_tag_file)

print(f"completed {generator_name}")
summary_message = f"completed generation of {generator_name} with {generated_test_count} tests"
summary_message += f" ({skipped_test_count} skipped tests)"
print(summary_message)


def dump_yaml_fn(data: Any, name: str, file_mode: str, yaml_encoder: YAML):
Expand Down

0 comments on commit 5a918db

Please sign in to comment.