mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-06 17:38:35 +00:00
fix(agent): flag missing verification commands
This commit is contained in:
parent
abf930a381
commit
9474498e3e
@ -51,6 +51,7 @@ _FAILURE_RE = re.compile(
|
|||||||
r"\bAssertionError\b|"
|
r"\bAssertionError\b|"
|
||||||
r"\bFileNotFoundError\b|"
|
r"\bFileNotFoundError\b|"
|
||||||
r"\bTimeoutError\b|"
|
r"\bTimeoutError\b|"
|
||||||
|
r"\bcommand not found\b|"
|
||||||
r"\bError:\s+Command timed out\b|"
|
r"\bError:\s+Command timed out\b|"
|
||||||
r"\bFAILURES?\b|"
|
r"\bFAILURES?\b|"
|
||||||
r"\bTEST FAILED\b"
|
r"\bTEST FAILED\b"
|
||||||
@ -73,6 +74,7 @@ _ERROR_LINE_RE = re.compile(
|
|||||||
r"(?:AssertionError|FileNotFoundError|TimeoutError|ValueError|TypeError|RuntimeError)"
|
r"(?:AssertionError|FileNotFoundError|TimeoutError|ValueError|TypeError|RuntimeError)"
|
||||||
r"(?::[^\n]*)?|"
|
r"(?::[^\n]*)?|"
|
||||||
r"assert\s+[^\n]+|"
|
r"assert\s+[^\n]+|"
|
||||||
|
r"[^:\n]+:\s+line\s+\d+:\s+[^:\n]+:\s+command not found|"
|
||||||
r"Error:\s+[^\n]+|"
|
r"Error:\s+[^\n]+|"
|
||||||
r"TEST FAILED[^\n]*"
|
r"TEST FAILED[^\n]*"
|
||||||
r")"
|
r")"
|
||||||
|
|||||||
@ -52,3 +52,22 @@ def test_analyze_passing_test_records_success_without_feedback():
|
|||||||
assert analysis is not None
|
assert analysis is not None
|
||||||
assert analysis.status == "passed"
|
assert analysis.status == "passed"
|
||||||
assert append_verification_feedback("ok", analysis) == "ok"
|
assert append_verification_feedback("ok", analysis) == "ok"
|
||||||
|
|
||||||
|
|
||||||
|
def test_analyze_command_not_found_as_failed_check():
|
||||||
|
output = """\
|
||||||
|
STDERR:
|
||||||
|
/usr/bin/bash: line 1: python3: command not found
|
||||||
|
|
||||||
|
Exit code: 127
|
||||||
|
"""
|
||||||
|
|
||||||
|
analysis = analyze_verification_result(
|
||||||
|
command="python3 - <<'PY'\nprint('quick verification')\nPY",
|
||||||
|
output=output,
|
||||||
|
exit_code=127,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert analysis is not None
|
||||||
|
assert analysis.status == "failed"
|
||||||
|
assert any("command not found" in item for item in analysis.primary_errors)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user