*** Settings ***
Documentation    Smoke tests for skill add persistence (issue #620)
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

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

*** Test Cases ***
Skill Add Persists Across Service Instances
    [Documentation]    Verify that a skill added via SkillService is visible from a fresh instance
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    persist-round-trip    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    skill-add-persist-round-trip-ok

Multiple Skills Persist
    [Documentation]    Verify that multiple added skills are all visible from a fresh instance
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    persist-multiple    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    skill-add-persist-multiple-ok

Skill Remove Persists Deletion
    [Documentation]    Verify that removing a skill is reflected in fresh service instances
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    persist-remove    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    skill-add-persist-remove-ok
