Files
cleveragents-core/robot/architecture.robot
T
brent.edwards e8aa5ac268 fix(ci): restore venv PATH, use absolute resource paths, and add timeouts in robot tests
- Restore session.env["PATH"] in integration_tests nox session to ensure
  Run Process uses venv Python instead of system Python
- Convert bare Resource references to ${CURDIR}/ absolute paths across
  30 robot files to fix CI resolution failures
- Add timeout=30s to all Run Process calls in rxpy_route_validation.robot
  to prevent hanging tests
- Tag 2 rxpy tests as slow (require running actors unavailable on CI)
- Fix LangGraph test to use correct config file (LANGGRAPH_CONFIG)
- All 204 tests pass (4 excluded: 2 slow + 2 discovery)
2026-02-13 02:42:57 +00:00

109 lines
4.7 KiB
Plaintext

*** Settings ***
Documentation Architecture and dependency validation tests
Library OperatingSystem
Library Collections
Library String
Resource ${CURDIR}/common.resource
*** Variables ***
${SRC_DIR} ${CURDIR}/../src/cleveragents
*** Test Cases ***
Package Structure Should Follow Layered Architecture
[Documentation] Verify package structure matches ADR-001
Directory Should Exist ${SRC_DIR}
# Check main packages exist
Directory Should Exist ${SRC_DIR}/cli
Directory Should Exist ${SRC_DIR}/runtime
Directory Should Exist ${SRC_DIR}/application
Directory Should Exist ${SRC_DIR}/domain
Directory Should Exist ${SRC_DIR}/infrastructure
Directory Should Exist ${SRC_DIR}/providers
Directory Should Exist ${SRC_DIR}/config
Directory Should Exist ${SRC_DIR}/core
Directory Should Exist ${SRC_DIR}/shared
Package Init Files Should Have Docstrings
[Documentation] Verify packages document their responsibilities
@{packages}= List Directories In Directory ${SRC_DIR}
FOR ${package} IN @{packages}
${init_file}= Set Variable ${SRC_DIR}/${package}/__init__.py
${exists}= Run Keyword And Return Status File Should Exist ${init_file}
IF ${exists}
${content}= Get File ${init_file}
${has_docstring}= Run Keyword And Return Status Should Contain ${content} """
Run Keyword If not ${has_docstring} Log Missing docstring in ${package}/__init__.py WARN
END
END
Development Tools Should Be Configured
[Documentation] Verify development tools are properly configured
File Should Exist ${CURDIR}/../pyproject.toml
File Should Exist ${CURDIR}/../noxfile.py
# Check tool configurations in pyproject.toml
${pyproject}= Get File ${CURDIR}/../pyproject.toml
Should Contain ${pyproject} [tool.ruff]
Should Contain ${pyproject} [tool.pyright]
Should Contain ${pyproject} [tool.coverage]
Should Contain ${pyproject} [tool.hatch]
Modern Tooling Should Be Used
[Documentation] Verify no legacy helper scripts - using modern tooling instead
# Verify we're NOT using legacy scripts (intentionally removed)
File Should Not Exist ${CURDIR}/../scripts/install.py
File Should Not Exist ${CURDIR}/../scripts/sync.py
# Verify modern tooling configuration exists
${pyproject}= Get File ${CURDIR}/../pyproject.toml
Should Contain ${pyproject} [tool.hatch] Modern build backend (Hatch) should be configured
Should Contain ${pyproject} [project.optional-dependencies] Dependency groups should be defined
Type Marker Should Exist
[Documentation] Verify py.typed marker for type hints
File Should Exist ${SRC_DIR}/py.typed
Configuration Should Use CLEVERAGENTS Prefix
[Documentation] Verify environment variables use correct prefix
${settings_file}= Set Variable ${SRC_DIR}/config/settings.py
${exists}= Run Keyword And Return Status File Should Exist ${settings_file}
IF ${exists}
${content}= Get File ${settings_file}
# Check for CLEVERAGENTS_ prefix
${matches}= Get Regexp Matches ${content} CLEVERAGENTS_[A-Z_]+
${count}= Get Length ${matches}
Should Be True ${count} > 0 No CLEVERAGENTS_ variables found in settings
END
Core Exception Hierarchy Should Be Defined
[Documentation] Verify exception hierarchy from ADR-005
${exceptions_file}= Set Variable ${SRC_DIR}/core/exceptions.py
${exists}= Run Keyword And Return Status File Should Exist ${exceptions_file}
IF ${exists}
${content}= Get File ${exceptions_file}
Should Contain ${content} class CleverAgentsError
Should Contain ${content} class DomainError
Should Contain ${content} class InfrastructureError
Should Contain ${content} class ValidationError
END
*** Keywords ***
List Files In Directory
[Arguments] ${directory} ${pattern}=*
@{files}= OperatingSystem.List Files In Directory ${directory} ${pattern}
RETURN @{files}
List Directories In Directory
[Arguments] ${directory}
@{items}= List Directory ${directory}
@{dirs}= Create List
FOR ${item} IN @{items}
${path}= Set Variable ${directory}/${item}
${is_dir}= Run Keyword And Return Status Directory Should Exist ${path}
IF ${is_dir} and not '${item}'.startswith('__')
Append To List ${dirs} ${item}
END
END
RETURN @{dirs}