55 lines
3.2 KiB
Plaintext
55 lines
3.2 KiB
Plaintext
*** Settings ***
|
|
Documentation Integration smoke test for session create DI error (bug #570).
|
|
... TDD-style tests — expected to FAIL until the DI container fix
|
|
... lands. The bug is that ``_get_session_service()`` calls
|
|
... ``container.db()`` but the DI container has no ``db`` provider,
|
|
... causing an ``AttributeError``. Same root cause as bug #554.
|
|
Resource ${CURDIR}/common.resource
|
|
Library Process
|
|
Library OperatingSystem
|
|
Suite Setup Setup Test Environment
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Test Cases ***
|
|
Session Create After Init Should Not Error
|
|
[Documentation] After agents init, session create --format plain should
|
|
... exit 0 and produce a new session rather than a DI
|
|
... AttributeError.
|
|
[Tags] tdd_bug tdd_bug_570 tdd_expected_fail
|
|
${tmpdir}= Evaluate __import__('tempfile').mkdtemp(prefix='sce_570_')
|
|
${init}= Run Process ${PYTHON} -m cleveragents init sce-test
|
|
... timeout=60s cwd=${tmpdir}
|
|
Should Be Equal As Integers ${init.rc} 0
|
|
... msg=agents init should exit 0 but got ${init.rc}. stderr: ${init.stderr}
|
|
${create}= Run Process ${PYTHON} -m cleveragents session create --format plain
|
|
... timeout=60s cwd=${tmpdir}
|
|
Should Be Equal As Integers ${create.rc} 0
|
|
... msg=session create should exit 0 but got ${create.rc}. stderr: ${create.stderr}
|
|
Should Not Contain ${create.stderr} AttributeError
|
|
... msg=session create should not raise AttributeError: ${create.stderr}
|
|
[Teardown] Remove Directory ${tmpdir} recursive=True
|
|
|
|
Session Create Then List Shows Created Session
|
|
[Documentation] After creating a session, listing should show it.
|
|
[Tags] tdd_bug tdd_bug_570 tdd_expected_fail
|
|
${tmpdir}= Evaluate __import__('tempfile').mkdtemp(prefix='sce_570_list_')
|
|
${init}= Run Process ${PYTHON} -m cleveragents init sce-list
|
|
... timeout=60s cwd=${tmpdir}
|
|
Should Be Equal As Integers ${init.rc} 0
|
|
... msg=agents init should exit 0 but got ${init.rc}. stderr: ${init.stderr}
|
|
${create}= Run Process ${PYTHON} -m cleveragents session create --format plain
|
|
... timeout=60s cwd=${tmpdir}
|
|
Should Be Equal As Integers ${create.rc} 0
|
|
... msg=session create should exit 0 but got ${create.rc}. stderr: ${create.stderr}
|
|
Should Not Contain ${create.stderr} AttributeError
|
|
... msg=session create should not raise AttributeError: ${create.stderr}
|
|
${list}= Run Process ${PYTHON} -m cleveragents session list --format plain
|
|
... timeout=60s cwd=${tmpdir}
|
|
Should Be Equal As Integers ${list.rc} 0
|
|
... msg=session list should exit 0 but got ${list.rc}. stderr: ${list.stderr}
|
|
Should Contain ${list.stdout} total:
|
|
... msg=Expected 'total:' in plain output: ${list.stdout}
|
|
Should Not Contain ${list.stdout} total: 0
|
|
... msg=Expected at least one session in list output: ${list.stdout}
|
|
[Teardown] Remove Directory ${tmpdir} recursive=True
|