Feat: Added in plan and project commands and functionality
This commit is contained in:
@@ -9,13 +9,13 @@ Suite Setup Setup Test Environment
|
||||
Suite Teardown Cleanup Test Environment
|
||||
|
||||
*** Variables ***
|
||||
${TEST_DIR} ${TEMPDIR}/cleveragents_robot_test
|
||||
${TEST_DIR} ${TEMPDIR}${/}cleveragents_robot_test
|
||||
${PROJECT_NAME} test-project
|
||||
|
||||
*** Test Cases ***
|
||||
Test CLI Help Shows All Commands
|
||||
[Documentation] Verify that CLI help displays all expected command groups
|
||||
${result} = Run Process cleveragents --help
|
||||
${result} = Run Process python -m cleveragents --help
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} AI-powered development assistant
|
||||
Should Contain ${result.stdout} project
|
||||
@@ -29,7 +29,7 @@ Test CLI Help Shows All Commands
|
||||
Test Project Initialization
|
||||
[Documentation] Test initializing a new CleverAgents project
|
||||
Create Directory ${TEST_DIR}/project1
|
||||
${result} = Run Process cleveragents init ${PROJECT_NAME}
|
||||
${result} = Run Process python -m cleveragents init ${PROJECT_NAME}
|
||||
... cwd=${TEST_DIR}/project1
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} Project '${PROJECT_NAME}' initialized successfully
|
||||
@@ -43,8 +43,8 @@ Test Project Initialization
|
||||
Test Project Cannot Initialize Twice
|
||||
[Documentation] Verify project cannot be initialized twice without force
|
||||
Create Directory ${TEST_DIR}/project2
|
||||
Run Process cleveragents init first-project cwd=${TEST_DIR}/project2
|
||||
${result} = Run Process cleveragents init second-project
|
||||
Run Process python -m cleveragents init first-project cwd=${TEST_DIR}/project2
|
||||
${result} = Run Process python -m cleveragents init second-project
|
||||
... cwd=${TEST_DIR}/project2
|
||||
Should Not Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stderr} Project already initialized
|
||||
@@ -53,8 +53,8 @@ Test Project Cannot Initialize Twice
|
||||
Test Force Reinitialize Project
|
||||
[Documentation] Test force reinitialization of a project
|
||||
Create Directory ${TEST_DIR}/project3
|
||||
Run Process cleveragents init first-project cwd=${TEST_DIR}/project3
|
||||
${result} = Run Process cleveragents init second-project --force
|
||||
Run Process python -m cleveragents init first-project cwd=${TEST_DIR}/project3
|
||||
${result} = Run Process python -m cleveragents init second-project --force
|
||||
... cwd=${TEST_DIR}/project3
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} Project 'second-project' initialized successfully
|
||||
@@ -62,9 +62,9 @@ Test Force Reinitialize Project
|
||||
Test Context Add Files
|
||||
[Documentation] Test adding files to context
|
||||
Create Directory ${TEST_DIR}/project4
|
||||
Run Process cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project4
|
||||
Run Process python -m cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project4
|
||||
Create File ${TEST_DIR}/project4/test.py print('hello world')
|
||||
${result} = Run Process cleveragents context add test.py
|
||||
${result} = Run Process python -m cleveragents context add test.py
|
||||
... cwd=${TEST_DIR}/project4
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} Added 1 file(s) to context
|
||||
@@ -73,12 +73,12 @@ Test Context Add Files
|
||||
Test Context List Files
|
||||
[Documentation] Test listing context files
|
||||
Create Directory ${TEST_DIR}/project5
|
||||
Run Process cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project5
|
||||
Run Process python -m cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project5
|
||||
Create File ${TEST_DIR}/project5/file1.py # File 1
|
||||
Create File ${TEST_DIR}/project5/file2.py # File 2
|
||||
Run Process cleveragents context add file1.py file2.py
|
||||
Run Process python -m cleveragents context add file1.py file2.py
|
||||
... cwd=${TEST_DIR}/project5
|
||||
${result} = Run Process cleveragents context list
|
||||
${result} = Run Process python -m cleveragents context list
|
||||
... cwd=${TEST_DIR}/project5
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} file1.py
|
||||
@@ -87,10 +87,10 @@ Test Context List Files
|
||||
Test Context Clear
|
||||
[Documentation] Test clearing context files
|
||||
Create Directory ${TEST_DIR}/project6
|
||||
Run Process cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project6
|
||||
Run Process python -m cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project6
|
||||
Create File ${TEST_DIR}/project6/test.py # Test file
|
||||
Run Process cleveragents context add test.py cwd=${TEST_DIR}/project6
|
||||
${result} = Run Process cleveragents context clear --yes
|
||||
Run Process python -m cleveragents context add test.py cwd=${TEST_DIR}/project6
|
||||
${result} = Run Process python -m cleveragents context clear --yes
|
||||
... cwd=${TEST_DIR}/project6
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} Cleared all files from context
|
||||
@@ -98,8 +98,8 @@ Test Context Clear
|
||||
Test Plan Creation With Tell
|
||||
[Documentation] Test creating a plan using tell command
|
||||
Create Directory ${TEST_DIR}/project7
|
||||
Run Process cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project7
|
||||
${result} = Run Process cleveragents tell Add error handling to main function
|
||||
Run Process python -m cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project7
|
||||
${result} = Run Process python -m cleveragents tell Add error handling to main function
|
||||
... cwd=${TEST_DIR}/project7
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} Plan created
|
||||
@@ -108,9 +108,9 @@ Test Plan Creation With Tell
|
||||
Test Plan Build
|
||||
[Documentation] Test building a plan
|
||||
Create Directory ${TEST_DIR}/project8
|
||||
Run Process cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project8
|
||||
Run Process cleveragents tell Create example code cwd=${TEST_DIR}/project8
|
||||
${result} = Run Process cleveragents build cwd=${TEST_DIR}/project8
|
||||
Run Process python -m cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project8
|
||||
Run Process python -m cleveragents tell Create example code cwd=${TEST_DIR}/project8
|
||||
${result} = Run Process python -m cleveragents build cwd=${TEST_DIR}/project8
|
||||
... env:CLEVERAGENTS_TESTING_USE_MOCK_AI=true
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} Plan built successfully
|
||||
@@ -120,11 +120,11 @@ Test Plan Build
|
||||
Test Plan Apply
|
||||
[Documentation] Test applying plan changes
|
||||
Create Directory ${TEST_DIR}/project9
|
||||
Run Process cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project9
|
||||
Run Process cleveragents tell Create example file cwd=${TEST_DIR}/project9
|
||||
Run Process cleveragents build cwd=${TEST_DIR}/project9
|
||||
Run Process python -m cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project9
|
||||
Run Process python -m cleveragents tell Create example file cwd=${TEST_DIR}/project9
|
||||
Run Process python -m cleveragents build cwd=${TEST_DIR}/project9
|
||||
... env:CLEVERAGENTS_TESTING_USE_MOCK_AI=true
|
||||
${result} = Run Process cleveragents apply --yes cwd=${TEST_DIR}/project9
|
||||
${result} = Run Process python -m cleveragents apply --yes cwd=${TEST_DIR}/project9
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} Successfully applied
|
||||
File Should Exist ${TEST_DIR}/project9/example.py
|
||||
@@ -132,20 +132,20 @@ Test Plan Apply
|
||||
Test Plan List
|
||||
[Documentation] Test listing plans
|
||||
Create Directory ${TEST_DIR}/project10
|
||||
Run Process cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project10
|
||||
Run Process cleveragents tell First plan cwd=${TEST_DIR}/project10
|
||||
Run Process cleveragents plan new second-plan cwd=${TEST_DIR}/project10
|
||||
${result} = Run Process cleveragents plan list cwd=${TEST_DIR}/project10
|
||||
Run Process python -m cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project10
|
||||
Run Process python -m cleveragents tell First plan cwd=${TEST_DIR}/project10
|
||||
Run Process python -m cleveragents plan new second-plan cwd=${TEST_DIR}/project10
|
||||
${result} = Run Process python -m cleveragents plan list cwd=${TEST_DIR}/project10
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} Plans (3 total)
|
||||
|
||||
Test Shortcut Commands Work
|
||||
[Documentation] Test that shortcut commands work properly
|
||||
Create Directory ${TEST_DIR}/project11
|
||||
Run Process cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project11
|
||||
Run Process python -m cleveragents init ${PROJECT_NAME} cwd=${TEST_DIR}/project11
|
||||
Create File ${TEST_DIR}/project11/test.txt Test content
|
||||
# Test context-load shortcut
|
||||
${result} = Run Process cleveragents context-load test.txt
|
||||
${result} = Run Process python -m cleveragents context-load test.txt
|
||||
... cwd=${TEST_DIR}/project11
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} Added 1 file(s) to context
|
||||
@@ -154,38 +154,38 @@ Test End To End Workflow
|
||||
[Documentation] Test complete workflow from init to apply
|
||||
Create Directory ${TEST_DIR}/project12
|
||||
# Initialize project
|
||||
${init} = Run Process cleveragents init workflow-project
|
||||
${init} = Run Process python -m cleveragents init workflow-project
|
||||
... cwd=${TEST_DIR}/project12
|
||||
Should Be Equal As Numbers ${init.rc} 0
|
||||
# Add context
|
||||
Create File ${TEST_DIR}/project12/input.py def main(): pass
|
||||
${add} = Run Process cleveragents context add input.py
|
||||
${add} = Run Process python -m cleveragents context add input.py
|
||||
... cwd=${TEST_DIR}/project12
|
||||
Should Be Equal As Numbers ${add.rc} 0
|
||||
# Create plan
|
||||
${tell} = Run Process cleveragents tell Add logging to main function
|
||||
${tell} = Run Process python -m cleveragents tell Add logging to main function
|
||||
... cwd=${TEST_DIR}/project12
|
||||
Should Be Equal As Numbers ${tell.rc} 0
|
||||
# Build plan
|
||||
${build} = Run Process cleveragents build cwd=${TEST_DIR}/project12
|
||||
${build} = Run Process python -m cleveragents build cwd=${TEST_DIR}/project12
|
||||
... env:CLEVERAGENTS_TESTING_USE_MOCK_AI=true
|
||||
Should Be Equal As Numbers ${build.rc} 0
|
||||
# Apply changes
|
||||
${apply} = Run Process cleveragents apply --yes cwd=${TEST_DIR}/project12
|
||||
${apply} = Run Process python -m cleveragents apply --yes cwd=${TEST_DIR}/project12
|
||||
Should Be Equal As Numbers ${apply.rc} 0
|
||||
# Verify file created
|
||||
File Should Exist ${TEST_DIR}/project12/example.py
|
||||
|
||||
Test Command Error Handling
|
||||
[Documentation] Test error handling for invalid commands
|
||||
${result} = Run Process cleveragents invalid-command
|
||||
${result} = Run Process python -m cleveragents invalid-command
|
||||
Should Not Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stderr} Invalid command
|
||||
|
||||
Test Project Status Without Project
|
||||
[Documentation] Test project status command without initialized project
|
||||
Create Directory ${TEST_DIR}/no_project
|
||||
${result} = Run Process cleveragents project status
|
||||
${result} = Run Process python -m cleveragents project status
|
||||
... cwd=${TEST_DIR}/no_project
|
||||
Should Not Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stderr} No project found
|
||||
@@ -193,8 +193,8 @@ Test Project Status Without Project
|
||||
Test Project Status With Project
|
||||
[Documentation] Test project status command with initialized project
|
||||
Create Directory ${TEST_DIR}/with_project
|
||||
Run Process cleveragents init status-test cwd=${TEST_DIR}/with_project
|
||||
${result} = Run Process cleveragents project status
|
||||
Run Process python -m cleveragents init status-test cwd=${TEST_DIR}/with_project
|
||||
${result} = Run Process python -m cleveragents project status
|
||||
... cwd=${TEST_DIR}/with_project
|
||||
Should Be Equal As Numbers ${result.rc} 0
|
||||
Should Contain ${result.stdout} Project: status-test
|
||||
|
||||
Reference in New Issue
Block a user