*** Settings ***
Documentation    Smoke tests for the Actor Compiler (GRAPH → LangGraph)
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER}    ${CURDIR}/helper_actor_compiler.py

*** Test Cases ***
Compile Simple Graph Actor YAML
    [Documentation]    Compile the simple_graph example and verify node/edge counts
    [Tags]    slow
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    compile    ${CURDIR}/../examples/actors/simple_graph.yaml    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    actor-compiler-ok

Compile Graph Workflow Actor YAML
    [Documentation]    Compile the graph_workflow example and verify success
    [Tags]    slow
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    compile    ${CURDIR}/../examples/actors/graph_workflow.yaml    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    actor-compiler-ok

Retrieve Compilation Metadata
    [Documentation]    Verify metadata output from the compiler contains node IDs
    [Tags]    slow
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    metadata    ${CURDIR}/../examples/actors/simple_graph.yaml    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    actor-compiler-metadata

Reject LLM Actor Compilation
    [Documentation]    Attempt to compile an LLM-type actor and expect failure
    [Tags]    slow
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    compile-fail    ${CURDIR}/../examples/actors/simple_llm.yaml    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    actor-compiler-expected-fail
    Should Contain    ${result.stdout}    GRAPH
