1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-12 14:53:49 +01:00
This commit is contained in:
J. Nick Koston
2025-10-09 14:42:39 -10:00
parent 2d398db26c
commit e5994c1fed
3 changed files with 31 additions and 15 deletions

View File

@@ -196,9 +196,19 @@ def run_esphome_test(
print(" (using --testing-mode)")
try:
result = subprocess.run(cmd, check=not continue_on_fail)
return result.returncode == 0, cmd_str
result = subprocess.run(cmd, check=False)
success = result.returncode == 0
if not success and not continue_on_fail:
# Print command immediately for failed tests
print(f"\n{'=' * 80}")
print("FAILED - Command to reproduce:")
print(f"{'=' * 80}")
print(cmd_str)
print()
raise subprocess.CalledProcessError(result.returncode, cmd)
return success, cmd_str
except subprocess.CalledProcessError:
# Re-raise if we're not continuing on fail
if not continue_on_fail:
raise
return False, cmd_str
@@ -295,9 +305,19 @@ def run_grouped_test(
print(" (using --testing-mode)")
try:
result = subprocess.run(cmd, check=not continue_on_fail)
return result.returncode == 0, cmd_str
result = subprocess.run(cmd, check=False)
success = result.returncode == 0
if not success and not continue_on_fail:
# Print command immediately for failed tests
print(f"\n{'=' * 80}")
print("FAILED - Command to reproduce:")
print(f"{'=' * 80}")
print(cmd_str)
print()
raise subprocess.CalledProcessError(result.returncode, cmd)
return success, cmd_str
except subprocess.CalledProcessError:
# Re-raise if we're not continuing on fail
if not continue_on_fail:
raise
return False, cmd_str