Skip to content

test_async_query_callback fails: session fixture can't find .env #393

Description

@gaurav

tests/frontend/test_callback.py::test_async_query_callback errors at setup (not a test failure, a fixture error). Docker is running, so this is not the usual "Docker not up" case — the session fixture in tests/conftest.py cannot find a .env file, and the subsequent docker-compose ... port r3 8080 lookup exits non-zero.

Repro

pytest tests/frontend/test_callback.py::test_async_query_callback

Error

ERROR at setup of test_async_query_callback

request = <SubRequest 'session' for <Function test_async_query_callback>>
>   nn_service_name = compose.get_service_host(service_name="r3", port=8080)
tests/conftest.py:23:
...
>   raise CalledProcessError(retcode, process.args, ...)
E   subprocess.CalledProcessError: Command '['docker-compose', '-f', 'docker-compose-test.yml',
E     '--env-file', '.env', 'port', 'r3', '8080']' returned non-zero exit status 1.

---------------------------- Captured stderr setup -----------------------------
starting docker container
couldn't find env file: .../.env
couldn't find env file: .../.env
couldn't find env file: .../.env

Notes

  • The session fixture (tests/conftest.py:~19) constructs DockerCompose(filepath=".", compose_file_name="docker-compose-test.yml", env_file=".env", build=True, pull=True). There is no .env in the repo (only sample.env), so the --env-file .env argument fails and the port r3 8080 call returns exit 1.
  • Likely fixes to consider later: provide/generate a .env (or point env_file at sample.env), or skip the test cleanly when no .env/compose stack is available (this test was previously marked skip).

Not fixing now — filing for later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions