*** Settings ***
Documentation    Smoke tests for execution environment routing
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

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

*** Test Cases ***
Resolve Default Returns Host
    [Documentation]    Resolver returns host when nothing configured
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    resolve-default    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    resolve-default-ok

Resolve Priority Chain
    [Documentation]    Priority: tool > plan > project > default
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    resolve-priority    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    resolve-priority-ok

Container Availability Validation
    [Documentation]    Raises ContainerUnavailableError when no container resource
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    container-validation    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    container-validation-ok

Enum Values
    [Documentation]    ExecutionEnvironment enum has host and container values
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    enum-values    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    enum-values-ok

Container Resource Types
    [Documentation]    CONTAINER_RESOURCE_TYPES contains expected types
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    resource-types    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    resource-types-ok
