prefapp / firestarter-workflows

Repository with all firestarter workflows
0 stars 0 forks source link

Some unit tests are failing in `firestarter-workflows` application #132

Closed alambike closed 1 month ago

alambike commented 1 month ago

Python 3.11.5 poetry 1.8.3

poetry install
poetry install -E build_images
$ poetry run pytest                                               
==================================================================================================================================================================================================================================== test session starts =====================================================================================================================================================================================================================================
platform linux -- Python 3.11.5, pytest-7.4.4, pluggy-1.5.0
rootdir: /tmp/firestarter-workflows
plugins: anyio-3.6.2
collected 7 items                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

firestarter/tests/test_dagger_workflow.py F                                                                                                                                                                                                                                                                                                                                                                                                                                            [ 14%]
firestarter/tests/test_preprocessor.py ...                                                                                                                                                                                                                                                                                                                                                                                                                                             [ 57%]
firestarter/tests/test_workflow_validate.py ...                                                                                                                                                                                                                                                                                                                                                                                                                                        [100%]

========================================================================================================================================================================================================================================== FAILURES ==========================================================================================================================================================================================================================================
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_dagger_workflow ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________

    def test_dagger_workflow() -> None:

        def myTestFunc(context: Context) -> None:
            tm: TaskManager = TaskManager()
            tm.context = context
            tm.load(
                os.path.join(
                    os.path.dirname(__file__), 'fixtures/test_workflow.yaml',
                ),
                '../workflows/ci/schema.json',
            )
            tm.run()

>       anyio.run(lambda: Context().start(myTestFunc))

firestarter/tests/test_dagger_workflow.py:20: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/alambike/.cache/pypoetry/virtualenvs/firestarter-workflows-guuNLrIx-py3.11/lib/python3.11/site-packages/anyio/_core/_eventloop.py:70: in run
    return asynclib.run(func, *args, **backend_options)
/home/alambike/.cache/pypoetry/virtualenvs/firestarter-workflows-guuNLrIx-py3.11/lib/python3.11/site-packages/anyio/_backends/_asyncio.py:292: in run
    return native_run(wrapper(), debug=debug)
/home/alambike/.asdf/installs/ivm-python/3.11.5/lib/python3.11/asyncio/runners.py:190: in run
    return runner.run(main)
/home/alambike/.asdf/installs/ivm-python/3.11.5/lib/python3.11/asyncio/runners.py:118: in run
    return self._loop.run_until_complete(task)
/home/alambike/.asdf/installs/ivm-python/3.11.5/lib/python3.11/asyncio/base_events.py:653: in run_until_complete
    return future.result()
/home/alambike/.cache/pypoetry/virtualenvs/firestarter-workflows-guuNLrIx-py3.11/lib/python3.11/site-packages/anyio/_backends/_asyncio.py:287: in wrapper
    return await func(*args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <firestarter.workflows.ci.dagger_context.Context object at 0x778bcde03f50>, fn = <function test_dagger_workflow.<locals>.myTestFunc at 0x778bcddf9ee0>

    async def start(self, fn: Callable) -> None:
>       with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client:
E       TypeError: 'Connection' object does not support the context manager protocol

firestarter/workflows/ci/dagger_context.py:18: TypeError
================================================================================================================================================================================================================================== short test summary info ===================================================================================================================================================================================================================================
FAILED firestarter/tests/test_dagger_workflow.py::test_dagger_workflow - TypeError: 'Connection' object does not support the context manager protocol
================================================================================================================================================================================================================================ 1 failed, 6 passed in 0.66s =====