b122ec7ed5
CI / lint (pull_request) Successful in 23s
CI / quality (pull_request) Successful in 51s
CI / typecheck (pull_request) Successful in 1m0s
CI / security (pull_request) Successful in 55s
CI / build (pull_request) Successful in 25s
CI / helm (pull_request) Successful in 32s
CI / push-validation (pull_request) Successful in 26s
CI / e2e_tests (pull_request) Successful in 3m38s
CI / integration_tests (pull_request) Successful in 6m42s
CI / unit_tests (pull_request) Successful in 8m19s
CI / docker (pull_request) Successful in 13s
CI / coverage (pull_request) Successful in 15m23s
CI / status-check (pull_request) Successful in 2s
Remove the local ${PYTHON} python (and python3) variable definitions from
the *** Variables *** sections of all affected robot files. These local
definitions were overriding the pabot-injected venv Python path passed via
--variable PYTHON:/path/to/venv/python, causing tests to use the system
Python (which lacks required packages like structlog, sqlalchemy, etc.)
instead of the nox venv Python.
The correct ${PYTHON} value is already set by Setup Test Environment in
common.resource via sys.executable, and pabot passes it via --variable.
The local fallback definitions are redundant and harmful in parallel runs.
Audit found 56 robot files with the pattern (more than the 9 originally
identified in the issue). All occurrences have been removed.
ISSUES CLOSED: #1309
88 lines
3.9 KiB
Plaintext
88 lines
3.9 KiB
Plaintext
*** Settings ***
|
|
Documentation Integration tests for ChangeSet persistence via CLI plan artifacts output.
|
|
Library OperatingSystem
|
|
Library Process
|
|
Library Collections
|
|
|
|
Suite Setup Set Suite Variables
|
|
Force Tags changeset persistence
|
|
|
|
*** Variables ***
|
|
# Normal duration: ~5-10s per test. Timeout raised from 30s to 120s for
|
|
# pabot cold-start (16 parallel processes) + Alembic migration overhead.
|
|
${TIMEOUT} 120s
|
|
|
|
*** Keywords ***
|
|
Set Suite Variables
|
|
Set Suite Variable ${AGENTS} ${PYTHON} -m cleveragents.cli.main
|
|
|
|
Run Agents Command
|
|
[Arguments] @{args}
|
|
${result}= Run Process ${PYTHON} -m cleveragents.cli.main @{args}
|
|
... timeout=${TIMEOUT} on_timeout=kill
|
|
... env:CLEVERAGENTS_TESTING_USE_MOCK_AI=true
|
|
... env:CLEVERAGENTS_AUTO_APPLY_MIGRATIONS=true
|
|
... env:NO_COLOR=1
|
|
RETURN ${result}
|
|
|
|
*** Test Cases ***
|
|
Plan Artifacts Shows Changeset ID Field
|
|
[Documentation] Verify plan artifacts output contains changeset_id field.
|
|
${result}= Run Agents Command plan artifacts --help
|
|
Should Contain ${result.stdout} plan_id
|
|
... msg=Plan artifacts help should mention plan_id
|
|
|
|
Plan Diff Help Shows Format Options
|
|
[Documentation] Verify plan diff command exposes format options.
|
|
${result}= Run Agents Command plan diff --help
|
|
Should Contain ${result.stdout} format
|
|
... msg=Plan diff help should mention format option
|
|
|
|
Plan Artifacts Help Contains Expected Text
|
|
[Documentation] Verify plan artifacts help text is present.
|
|
${result}= Run Agents Command plan artifacts --help
|
|
Should Contain ${result.stdout} artifacts
|
|
... msg=Help text should mention artifacts
|
|
|
|
Changeset Persistence Module Is Importable
|
|
[Documentation] Verify the changeset_repository module can be imported.
|
|
${result}= Run Process ${PYTHON} -c
|
|
... from cleveragents.infrastructure.database.changeset_repository import SqliteChangeSetStore; print("OK")
|
|
... timeout=${TIMEOUT} on_timeout=kill
|
|
... env:PYTHONPATH=src
|
|
Should Be Equal As Strings ${result.stdout.strip()} OK
|
|
|
|
SqliteChangeSetStore Round Trip Via CLI Script
|
|
[Documentation] Run a Python script that exercises SqliteChangeSetStore round-trip.
|
|
${script}= Catenate SEPARATOR=\n
|
|
... import sys
|
|
... from sqlalchemy import create_engine
|
|
... from sqlalchemy.orm import sessionmaker
|
|
... from cleveragents.infrastructure.database.models import Base
|
|
... from cleveragents.infrastructure.database.changeset_repository import SqliteChangeSetStore
|
|
... from cleveragents.domain.models.core.change import ChangeEntry, ChangeOperation
|
|
... engine = create_engine("sqlite:///:memory:", connect_args={"check_same_thread": False})
|
|
... Base.metadata.create_all(engine)
|
|
... factory = sessionmaker(bind=engine)
|
|
... store = SqliteChangeSetStore(factory)
|
|
... cs_id = store.start("plan-robot-1")
|
|
... entry = ChangeEntry(plan_id="plan-robot-1", resource_id="res-1", tool_name="file-write", operation=ChangeOperation.CREATE, path="src/test.py", after_hash="abc123")
|
|
... store.record(cs_id, entry)
|
|
... factory().commit()
|
|
... cs = store.get(cs_id)
|
|
... assert cs is not None
|
|
... assert len(cs.entries) == 1
|
|
... summary = store.summarize(cs_id)
|
|
... assert summary["total"] == 1
|
|
... assert summary["creates"] == 1
|
|
... store.delete_for_plan("plan-robot-1")
|
|
... factory().commit()
|
|
... cs2 = store.get(cs_id)
|
|
... assert cs2 is None or len(cs2.entries) == 0
|
|
... print("PASS")
|
|
${result}= Run Process ${PYTHON} -c ${script}
|
|
... timeout=${TIMEOUT} on_timeout=kill
|
|
... env:PYTHONPATH=src
|
|
Should Contain ${result.stdout} PASS
|
|
... msg=SqliteChangeSetStore round-trip failed: ${result.stderr}
|