forked from HAL9000/cleveragents-core
95 lines
4.3 KiB
Plaintext
95 lines
4.3 KiB
Plaintext
*** Settings ***
|
|
Documentation Integration tests for ContextAnalysisAgent workflow
|
|
Library Process
|
|
Library OperatingSystem
|
|
Library Collections
|
|
Library String
|
|
|
|
*** Variables ***
|
|
${SRC_DIR} ${CURDIR}/../src
|
|
${HELPER} ${CURDIR}/test_context_analysis.py
|
|
|
|
*** Test Cases ***
|
|
|
|
Context Analysis Agent Module Can Be Imported
|
|
[Documentation] Verify the context analysis module can be imported
|
|
${result}= Run Process python3 -c
|
|
... import sys; sys.path.insert(0, '${SRC_DIR}'); from cleveragents.agents.context_analysis import ContextAnalysisAgent; print('SUCCESS')
|
|
... shell=True
|
|
Should Contain ${result.stdout} SUCCESS
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
|
|
Context Analysis Agent Can Be Instantiated With Default Parameters
|
|
[Documentation] Create ContextAnalysisAgent with defaults
|
|
${script}= Catenate SEPARATOR=${\n}
|
|
... import sys${\n}sys.path.insert(0, '${SRC_DIR}')
|
|
... from cleveragents.agents.context_analysis import ContextAnalysisAgent
|
|
... agent = ContextAnalysisAgent()
|
|
... assert agent is not None
|
|
... assert agent.chunk_size == 2000
|
|
... assert agent.chunk_overlap == 200
|
|
... assert agent.llm is not None
|
|
... print('Agent initialized successfully')
|
|
${result}= Run Process python3 -c ${script} shell=True
|
|
Should Contain ${result.stdout} initialized successfully
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
|
|
Context Analysis Agent Can Be Instantiated With Custom Chunk Settings
|
|
[Documentation] Create ContextAnalysisAgent with custom chunk_size and overlap
|
|
${script}= Catenate SEPARATOR=${\n}
|
|
... import sys${\n}sys.path.insert(0, '${SRC_DIR}')
|
|
... from cleveragents.agents.context_analysis import ContextAnalysisAgent
|
|
... agent = ContextAnalysisAgent(chunk_size=1000, chunk_overlap=100)
|
|
... assert agent.chunk_size == 1000
|
|
... assert agent.chunk_overlap == 100
|
|
... print('Chunk size: ' + str(agent.chunk_size) + ', overlap: ' + str(agent.chunk_overlap))
|
|
${result}= Run Process python3 -c ${script} shell=True
|
|
Should Contain ${result.stdout} Chunk size: 1000
|
|
Should Contain ${result.stdout} overlap: 100
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
|
|
Context Analysis Agent Workflow Contains Expected Nodes
|
|
[Documentation] Verify all workflow nodes are present using helper script
|
|
${result}= Run Process python3 ${HELPER} nodes
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Contain ${result.stdout} SUCCESS
|
|
Should Contain ${result.stdout} All nodes present
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
|
|
Context Analysis Agent Can Load Files
|
|
[Documentation] Test file loading functionality using helper script
|
|
${result}= Run Process python3 ${HELPER} load_files
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Contain ${result.stdout} SUCCESS
|
|
Should Contain ${result.stdout} Loaded
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
|
|
Context Analysis Agent Handles Missing Files
|
|
[Documentation] Test error handling for missing files using helper script
|
|
${result}= Run Process python3 ${HELPER} missing_file
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Contain ${result.stdout} SUCCESS
|
|
Should Contain ${result.stdout} Error handled
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
|
|
Context Analysis Agent Invoke Returns Complete Result
|
|
[Documentation] Test complete workflow execution via invoke using helper script
|
|
${result}= Run Process python3 ${HELPER} invoke
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Contain ${result.stdout} SUCCESS
|
|
Should Contain ${result.stdout} Workflow completed
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
|
|
Context Analysis Agent Streaming Produces Updates
|
|
[Documentation] Test streaming workflow execution using helper script
|
|
${result}= Run Process python3 ${HELPER} streaming
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Contain ${result.stdout} SUCCESS
|
|
Should Contain ${result.stdout} stream updates
|
|
Should Be Equal As Integers ${result.rc} 0
|