Compare commits

..
Author SHA1 Message Date
praisonai-triage-agent[bot]andMervin Praison ccc4058b17 revert: restore intentional defects in ai_code_editor_fixture
The AI code-editor smoke-test fixture is intentionally broken so live
scenarios (implement celsius_to_fahrenheit / fahrenheit_to_celsius / mode,
fix mean/median empty-list handling) exercise the AI editor's repair
capability. Pre-implementing these functions caused acceptance tests to
pass WITHOUT the editor doing any work, defeating the fixture's purpose.

Also removes the redundant conftest.py sys.path mutation; pyproject.toml
already sets pythonpath = ["src"].

Co-authored-by: Mervin Praison <[email protected]>
2026-08-19 09:20:28 +00:00
ugbotueferhire dc2e931eb7 fix: implement missing mathlib functions 2026-08-19 10:15:46 +01:00
5 changed files with 10 additions and 18 deletions

No files matched your search

@@ -541,7 +541,7 @@ class ReportGenerator:
lines.append("")
md_path = self.output_dir / "report.md"
md_path.write_text('\n'.join(lines), encoding='utf-8')
md_path.write_text('\n'.join(lines))
return md_path
def save_logs(self, report: RunReport) -> Path:
@@ -5,9 +5,9 @@ Tests for custom agent and command definitions discovery.
import tempfile
from pathlib import Path
from unittest.mock import patch
import sys
import shutil
import pytest
from praisonai.cli.features.custom_definitions import (
BUILTIN_PRESETS,
SHELL_SUBSTITUTION_ENV,
@@ -223,14 +223,12 @@ class TestShellSubstitution:
with pytest.raises(ShellSubstitutionError):
TemplateInterpolator.interpolate(template)
@pytest.mark.skipif(not shutil.which("echo"), reason="echo command not available in PATH")
def test_shell_enabled_runs_command(self):
"""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"
@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:
@@ -247,7 +245,6 @@ 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 (
@@ -283,8 +280,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.strip("\r\n") == "Output: hi"
assert result == "Output: hi"
def test_frontmatter_allow_shell_enables(self):
"""allow_shell: true frontmatter enables substitution for that command."""
@@ -305,7 +301,7 @@ class TestShellSubstitution:
import os as _os
_os.environ.pop(SHELL_SUBSTITUTION_ENV, None)
result = interpolate_command_template("diff")
assert result.strip() == "Output: hey"
assert result == "Output: hey"
def test_default_command_disables_shell(self):
"""Without any gate, a !`cmd` command raises a clear error."""
@@ -350,7 +346,6 @@ 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)'`"
@@ -407,7 +402,7 @@ class TestShellSubstitution:
_os.environ.pop(SHELL_SUBSTITUTION_ENV, None)
assert _config_allows_shell() is True
result = interpolate_command_template("diff")
assert result.strip("\r\n") == "Output: hi"
assert result == "Output: hi"
class TestIntegrationFunctions:
@@ -388,12 +388,12 @@ class TestReportGenerator:
md_path = generator.generate_markdown(report)
assert md_path.exists()
content = md_path.read_text(encoding='utf-8') # ← Add encoding='utf-8' here
content = md_path.read_text()
assert "# Examples Run Report" in content
assert "test1.py" in content
assert "passed" in content.lower()
def test_save_log_files(self, tmp_path):
"""Test log files are saved correctly."""
from praisonai.cli.features.examples import ReportGenerator, ExampleResult, RunReport
@@ -3,8 +3,9 @@ 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
@@ -140,7 +141,6 @@ 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,7 +157,6 @@ 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
@@ -180,7 +179,6 @@ 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
@@ -67,7 +67,6 @@ def test_get_runtime_descriptor_removes_stale_lock():
assert not get_runtime_lock_path().exists()
@pytest.mark.skip(reason="Test hangs indefinitely - needs investigation and proper fix")
def test_get_runtime_descriptor_keeps_live_lock():
desc = RuntimeDescriptor(host="127.0.0.1", port=1, token="t", pid=os.getpid())
desc.write()