feature/m1-project-repos #74

Merged
freemo merged 1 commits from feature/m1-project-repos into master 2026-02-17 04:51:38 +00:00
4 changed files with 16 additions and 15 deletions
+8 -11
View File
@@ -9,23 +9,20 @@ Feature: CLI Main Coverage
And the shell output should contain "1.0.0"
Scenario: CLI help displays correctly
When I run shell command "cleveragents --help"
Then the shell command should succeed
And the shell output should contain "Usage"
When I call the main function directly with "--help"
Then it should return 0
Scenario: CLI info command runs
When I run shell command "cleveragents info"
Then the shell command should succeed
And the shell output should contain "CleverAgents Information"
When I call the main function directly with "info"
Then it should return 0
Scenario: CLI diagnostics command runs
When I run shell command "cleveragents diagnostics"
Then the shell command should succeed
And the shell output should contain "CleverAgents Diagnostics"
When I call the main function directly with "diagnostics"
Then it should return 0
Scenario: Invalid command returns error
When I run shell command "cleveragents invalid-command"
Then the command should fail with exit code 2
When I call the main function directly with "invalid-command"
Then it should return 2
Scenario: Direct main function call with no args
When I call the main function directly with no args
+1 -1
View File
@@ -41,7 +41,7 @@ def step_run_shell_command(context, command):
# Use shell=True to handle quoted arguments correctly
result = subprocess.run(
command, capture_output=True, text=True, timeout=60, cwd=cwd, shell=True
command, capture_output=True, text=True, timeout=120, cwd=cwd, shell=True
)
context.exit_code = result.returncode
context.output = result.stdout + result.stderr
+5 -2
View File
@@ -22,9 +22,12 @@ BEHAVE_PARALLEL_URL = (
def _default_processes() -> int:
try:
return len(os.sched_getaffinity(0)) or 1
cpus = len(os.sched_getaffinity(0)) or 1
except AttributeError:
return os.cpu_count() or 1
cpus = os.cpu_count() or 1
# Cap parallelism to avoid excessive resource usage in constrained
# environments (CI containers, cgroups, etc.)
return min(cpus, 8)
def _behave_parallel_args(posargs: list[str]) -> list[str]:
+2 -1
View File
@@ -31,6 +31,7 @@ from tenacity import (
from cleveragents.core.exceptions import (
CleverAgentsError,
DatabaseError,
NetworkError,
ProviderError,
RateLimitError,
@@ -121,7 +122,7 @@ RETRY_CATEGORIES: dict[str, dict[str, Any]] = {
"database": {
"max_attempts": 3,
"wait": wait_fixed(0.5),
"exceptions": (Exception,), # Will be refined with DB exceptions
"exceptions": (DatabaseError,),
},
"file_operation": {
"max_attempts": 3,