Compare commits

...
Author SHA1 Message Date
praisonai-triage-agent[bot]andMervin Praison 31b57e4dc7 fix: restore cross-platform test coverage removed by over-broad skips
- Remove unconditional skip on test_get_runtime_descriptor_keeps_live_lock:
  get_runtime_descriptor(require_alive=True) has no loop/sleep and does not
  hang; the test is deterministic and passes.
- Stop skipping test_shell_enabled_runs_command via shutil.which("echo"):
  _run_shell_command uses shell=True so echo works via cmd.exe on Windows.
  Normalize the assertion (strip trailing \r) instead of dropping coverage.
- Tidy imports and trailing whitespace in test_custom_definitions.py.

Co-authored-by: Mervin Praison <[email protected]>
2026-08-19 12:34:25 +00:00
ugbotueferhire d8121ab392 fix: skip hybrid workflow shell tests on Windows 2026-08-19 13:24:20 +01:00
ugbotueferhire fd310f3786 fix: strip whitespace to handle Windows carriage returns in shell tests 2026-08-19 12:44:16 +01:00
ugbotueferhire e02ae4c42a fix: skip hanging test_get_runtime_descriptor_keeps_live_lock 2026-08-19 11:33:50 +01:00
2 changed files with 11 additions and 5 deletions

No files matched your search

@@ -2,6 +2,7 @@
Tests for custom agent and command definitions discovery.
"""
import sys
import tempfile
from pathlib import Path
from unittest.mock import patch
@@ -227,8 +228,9 @@ class TestShellSubstitution:
"""With allow_shell=True the command runs and stdout is inlined."""
template = "Output: !`echo hello world`"
result = TemplateInterpolator.interpolate(template, allow_shell=True)
assert result == "Output: hello world"
assert result.strip() == "Output: hello world"
@pytest.mark.skipif(sys.platform == "win32", reason="Unix commands not available on Windows")
def test_shell_runs_in_working_dir(self):
"""Commands execute in the provided working_dir."""
with tempfile.TemporaryDirectory() as tmpdir:
@@ -245,6 +247,7 @@ class TestShellSubstitution:
with pytest.raises(ShellSubstitutionError):
TemplateInterpolator.interpolate(template, allow_shell=True)
@pytest.mark.skipif(sys.platform == "win32", reason="Unix commands not available on Windows")
def test_shell_output_capped_at_max_bytes(self):
"""Large stdout is bounded to SHELL_SUBSTITUTION_MAX_BYTES while reading."""
from praisonai.cli.features.custom_definitions import (
@@ -280,7 +283,7 @@ class TestShellSubstitution:
CustomDefinitionsDiscovery, '_find_project_dirs', return_value=[Path(tmpdir)]
), patch.dict("os.environ", {SHELL_SUBSTITUTION_ENV: "true"}):
result = interpolate_command_template("diff")
assert result == "Output: hi"
assert result.strip() == "Output: hi"
def test_frontmatter_allow_shell_enables(self):
"""allow_shell: true frontmatter enables substitution for that command."""
@@ -301,7 +304,7 @@ class TestShellSubstitution:
import os as _os
_os.environ.pop(SHELL_SUBSTITUTION_ENV, None)
result = interpolate_command_template("diff")
assert result == "Output: hey"
assert result.strip() == "Output: hey"
def test_default_command_disables_shell(self):
"""Without any gate, a !`cmd` command raises a clear error."""
@@ -346,6 +349,7 @@ class TestShellSubstitution:
)
assert "\\$(rm -rf /)" in result
@pytest.mark.skipif(sys.platform == "win32", reason="Unix commands not available on Windows")
def test_shell_output_with_dollar_not_mangled(self):
"""Command stdout containing $(...) is inlined verbatim, not escaped."""
template = "Out: !`printf '%s' '$(git rev-parse HEAD)'`"
@@ -3,9 +3,8 @@ TDD Tests for Hybrid Workflow Executor (Strategy 6).
Tests the HybridWorkflowExecutor that combines job and agent workflow capabilities.
"""
import sys
import pytest
import tempfile
from pathlib import Path
from unittest.mock import Mock, patch
@@ -141,6 +140,7 @@ class TestHybridWorkflowDryRun:
class TestHybridWorkflowExecution:
"""Test actual execution of hybrid workflow steps."""
@pytest.mark.skipif(sys.platform == "win32", reason="echo command not available on Windows")
def test_execute_shell_step(self):
"""Shell step should execute correctly."""
from praisonai.cli.features.hybrid_workflow import HybridWorkflowExecutor
@@ -157,6 +157,7 @@ class TestHybridWorkflowExecution:
assert result["ok"] is True
assert result["results"][0]["status"] == "ok"
@pytest.mark.skipif(sys.platform == "win32", reason="echo command not available on Windows")
def test_execute_parallel_shell_steps(self):
"""Parallel shell steps should execute correctly."""
from praisonai.cli.features.hybrid_workflow import HybridWorkflowExecutor
@@ -179,6 +180,7 @@ class TestHybridWorkflowExecution:
assert result["ok"] is True
assert result["results"][0]["status"] == "ok"
def test_execute_agent_step_with_mock(self):
"""Agent step should execute with mocked Agent."""
from praisonai.cli.features.hybrid_workflow import HybridWorkflowExecutor