test(hashview): skip job tests when server lacks cracked-hash history

The live upload-hashfile-job subprocess tests hard-failed when pointed at
a hash type the Hashview server has no cracked-hash history for: the
hashfile upload succeeds, but Hashview's task planner refuses to create a
job ("Not enough data to determine effective tasks for this hash type").
That is a server-side data limitation, not a client defect.

Treat that specific message as a skip (after asserting the hashfile
upload itself succeeded) across all three upload-job tests, so results
don't depend on which hash types have cracked data on the target
instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Justin Bollinger
2026-07-01 16:17:38 -04:00
co-authored by Claude Opus 4.8
parent 41b29fc55a
commit 0c4f291174
@@ -223,6 +223,15 @@ def test_hashview_subcommands_live_upload_hashfile_job(tmp_path):
pytest.skip(
"HASHVIEW_CUSTOMER_ID does not exist for this API key. Update the env or create the customer."
)
# The hashfile upload itself succeeded, but Hashview's task planner refuses
# to create a job when the server has no cracked-hash history for this hash
# type. That's a server-side data limitation, not a client defect, so treat
# it as a skip rather than a failure.
if "Not enough data to determine effective tasks" in output:
assert ("Hashfile uploaded" in output) or ("Hashfile added" in output), output
pytest.skip(
"Hashview has no cracked-hash history for this hash type; cannot plan job tasks."
)
assert run.returncode == 0, output
assert ("Hashfile uploaded" in output) or ("Hashfile added" in output)
# Success surfaces the server's job id ("Job ID: N"); a graceful failure
@@ -316,6 +325,15 @@ def test_hashview_subcommands_live_upload_hashfile_job_pwdump(tmp_path):
pytest.skip(
"HASHVIEW_CUSTOMER_ID does not exist for this API key. Update the env or create the customer."
)
# The hashfile upload itself succeeded, but Hashview's task planner refuses
# to create a job when the server has no cracked-hash history for this hash
# type. That's a server-side data limitation, not a client defect, so treat
# it as a skip rather than a failure.
if "Not enough data to determine effective tasks" in output:
assert ("Hashfile uploaded" in output) or ("Hashfile added" in output), output
pytest.skip(
"Hashview has no cracked-hash history for this hash type; cannot plan job tasks."
)
assert run.returncode == 0, output
assert ("Hashfile uploaded" in output) or ("Hashfile added" in output)
# Success surfaces the server's job id ("Job ID: N"); a graceful failure
@@ -403,6 +421,15 @@ def test_hashview_subcommands_live_upload_hashfile_job_hashonly(tmp_path):
env=env,
)
output = run.stdout + run.stderr
# The hashfile upload itself succeeded, but Hashview's task planner refuses
# to create a job when the server has no cracked-hash history for this hash
# type. That's a server-side data limitation, not a client defect, so treat
# it as a skip rather than a failure.
if "Not enough data to determine effective tasks" in output:
assert ("Hashfile uploaded" in output) or ("Hashfile added" in output), output
pytest.skip(
"Hashview has no cracked-hash history for this hash type; cannot plan job tasks."
)
assert run.returncode == 0, output
assert ("Hashfile uploaded" in output) or ("Hashfile added" in output)
# Success surfaces the server's job id ("Job ID: N"); a graceful failure