Add test count to test gen diagnostics
This commit is contained in:
parent
5a17fa65b2
commit
5a918dbdf3
|
@ -96,6 +96,8 @@ def run_generator(generator_name, test_providers: Iterable[TestProvider]):
|
||||||
if len(presets) != 0:
|
if len(presets) != 0:
|
||||||
print(f"Filtering test-generator runs to only include presets: {', '.join(presets)}")
|
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:
|
for tprov in test_providers:
|
||||||
# runs anything that we don't want to repeat for every test case.
|
# runs anything that we don't want to repeat for every test case.
|
||||||
tprov.prepare()
|
tprov.prepare()
|
||||||
|
@ -149,6 +151,7 @@ def run_generator(generator_name, test_providers: Iterable[TestProvider]):
|
||||||
output_part("ssz", name, dump_ssz_fn(data, name, file_mode))
|
output_part("ssz", name, dump_ssz_fn(data, name, file_mode))
|
||||||
except SkippedTest as e:
|
except SkippedTest as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
skipped_test_count += 1
|
||||||
shutil.rmtree(case_dir)
|
shutil.rmtree(case_dir)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -172,10 +175,13 @@ def run_generator(generator_name, test_providers: Iterable[TestProvider]):
|
||||||
if not written_part:
|
if not written_part:
|
||||||
shutil.rmtree(case_dir)
|
shutil.rmtree(case_dir)
|
||||||
else:
|
else:
|
||||||
|
generated_test_count += 1
|
||||||
# Only remove `INCOMPLETE` tag file
|
# Only remove `INCOMPLETE` tag file
|
||||||
os.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):
|
def dump_yaml_fn(data: Any, name: str, file_mode: str, yaml_encoder: YAML):
|
||||||
|
|
Loading…
Reference in New Issue