Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-185: Output most detailed error messages for each version tested #186

Closed
wants to merge 7 commits into from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
doc/_build
build
dist
.python-version
25 changes: 17 additions & 8 deletions zkg
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def cmd_test(manager, args, config, configfile):
name = info.package.qualified_name()

if "test_command" not in info.metadata:
print(f"{name}: no test_command found in metadata, skipping")
print(f"{name} {version}: no test_command found in metadata, skipping")
continue

error_msg, passed, test_dir = manager.test(
Expand All @@ -562,21 +562,30 @@ def cmd_test(manager, args, config, configfile):
test_dependencies=True,
)

clone_dir = os.path.join(
os.path.join(test_dir, "clones"),
info.package.name,
)

if error_msg:
all_passed = False
print_error(f'error: failed to run tests for "{name}": {error_msg}')
print_error(
f'error: failed to run tests for "{name} {version}": {error_msg},'
f" inspect contents of {test_dir} for details, especially"
' any "zkg.test_command.{{stderr,stdout}}"'
f" files within {clone_dir}",
)
continue
ottobackwards marked this conversation as resolved.
Show resolved Hide resolved

if passed:
print(f"{name}: all tests passed")
print(
f"{name} {version}: all tests passed. The contents of {test_dir} and {clone_dir} "
'can be inspected for details, especially any "zkg.test_command.{stderr,stdout}"',
)
else:
all_passed = False
clone_dir = os.path.join(
os.path.join(test_dir, "clones"),
info.package.name,
)
print_error(
f'error: package "{name}" tests failed, inspect'
f'error: package "{name} {version}" tests failed, inspect'
f" contents of {test_dir} for details, especially"
' any "zkg.test_command.{{stderr,stdout}}"'
f" files within {clone_dir}",
Expand Down
Loading