Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve operation messages and make them stateful #9245

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

refactor: ensure backward compatibility of deprecated `get_operation_…

c3648d9
Select commit
Loading
Failed to load commit list.
Draft

feat: improve operation messages and make them stateful #9245

refactor: ensure backward compatibility of deprecated `get_operation_…
c3648d9
Select commit
Loading
Failed to load commit list.
Cirrus CI / Tests / FreeBSD (Python 3.8) / pytest failed Aug 22, 2024 in 3m 10s

Task Summary

Instruction pytest failed in 01:26

Details

ℹ️ Scheduling was delayed due to a concurrency limit on community tasks

✅ 00:03 clone
✅ 01:22 bootstrap_poetry
✅ 00:15 setup_environment
❌ 01:26 pytest

    
>       assert tester.io.fetch_output() == expected
E       AssertionError: assert 'Using versio...ile written\n' == 'Using versio...g lock file\n'
E         
E           Using version ^0.2.0 for cachy
E           
E           Updating dependencies
E           Resolving dependencies...
E           
E           Package operations: 2 installs, 0 updates, 0 removals
E           
E             - Installing msgpack-python (0.5.6)
E             - Installing cachy (0.2.0)
E           
E         - Writing lock file
E         + Lock file written

/tmp/cirrus-ci-build/tests/console/commands/test_add.py:126: AssertionError
-------------- generated xml file: /tmp/cirrus-ci-build/junit.xml --------------
=========================== short test summary info ============================
SKIPPED [1] tests/utils/env/test_env_manager.py:1289: requires darwin
SKIPPED [1] tests/puzzle/test_solver.py:3799: Poetry no longer has critical package requirements
SKIPPED [1] tests/console/commands/test_run.py:88: Poetry only installs CMD script files for console scripts of editable dependencies on Windows
SKIPPED [1] tests/integration/test_utils_vcs_git.py:315: HTTP authentication credentials not available
SKIPPED [1] tests/utils/env/test_env.py:525: Windows only
SKIPPED [1] tests/installation/test_executor.py:306: https://github.com/python-poetry/poetry/issues/7983
SKIPPED [1] tests/installation/test_installer.py:1794: This is not working at the moment due to limitations in the resolver
FAILED tests/console/commands/self/test_install.py::test_self_install[[tool.poetry]\nname = "poetry-instance"\nversion = "1.2"\ndescription = ""\nauthors = []\nlicense = ""\n# no package-mode -> defaults to true\n\n[tool.poetry.dependencies]\npython = "3.9"\npoetry = "1.2"\n] - AssertionError: assert 'Updating dep...ile written\n' == 'Updating dep...g lock file\n'
  
    Updating dependencies
    Resolving dependencies...
    
  - Writing lock file
  + Lock file written
FAILED tests/console/commands/self/test_install.py::test_self_install[None] - AssertionError: assert 'Updating dep...ile written\n' == 'Updating dep...g lock file\n'
  
    Updating dependencies
    Resolving dependencies...
    
  - Writing lock file
  + Lock file written
FAILED tests/console/commands/test_add.py::test_add_no_constraint - AssertionError: assert 'Using versio...ile written\n' == 'Using versio...g lock file\n'
  
    Using version ^0.2.0 for cachy
    
    Updating dependencies
    Resolving dependencies...
    
    Package operations: 2 installs, 0 updates, 0 removals
    
      - Installing msgpack-python (0.5.6)
      - Installing cachy (0.2.0)
    
  - Writing lock file
  + Lock file written
============= 3 failed, 1710 passed, 7 skipped in 83.85s (0:01:23) =============

Annotations

Check failure on line 61 in tests/console/commands/test_install.py

See this annotation in the file changed.

@cirrus-ci cirrus-ci / Tests / FreeBSD (Python 3.8) / pytest

tests/console/commands/test_install.py#L61

tests.console.commands.self.test_install.test_self_install[[tool.poetry]\nname = "poetry-instance"\nversion = "1.2"\ndescription = ""\nauthors = []\nlicense = ""\n# no package-mode -> defaults to true\n\n[tool.poetry.dependencies]\npython = "3.9"\npoetry = "1.2"\n]
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0xa0ee16e4490>
pyproject_content = '[tool.poetry]\nname = "poetry-instance"\nversion = "1.2"\ndescription = ""\nauthors = []\nlicense = ""\n# no package-mode -> defaults to true\n\n[tool.poetry.dependencies]\npython = "3.9"\npoetry = "1.2"\n'

    @pytest.mark.parametrize(
        "pyproject_content",
        (
            None,
            """\
    [tool.poetry]
    name = "poetry-instance"
    version = "1.2"
    description = ""
    authors = []
    license = ""
    # no package-mode -> defaults to true
    
    [tool.poetry.dependencies]
    python = "3.9"
    poetry = "1.2"
    """,
        ),
    )
    def test_self_install(
        tester: CommandTester,
        pyproject_content: str | None,
    ) -> None:
        command = tester.command
        assert isinstance(command, SelfInstallCommand)
        pyproject_path = command.system_pyproject
        if pyproject_content:
            pyproject_path.write_text(pyproject_content, encoding="utf-8")
        else:
            assert not pyproject_path.exists()
    
        tester.execute()
    
        expected_output = """\
    Updating dependencies
    Resolving dependencies...
    
    Writing lock file
    """
    
>       assert tester.io.fetch_output() == expected_output
E       AssertionError: assert 'Updating dep...ile written\n' == 'Updating dep...g lock file\n'
E         
E           Updating dependencies
E           Resolving dependencies...
E           
E         - Writing lock file
E         + Lock file written

/tmp/cirrus-ci-build/tests/console/commands/self/test_install.py:61: AssertionError

Check failure on line 61 in tests/console/commands/test_install.py

See this annotation in the file changed.

@cirrus-ci cirrus-ci / Tests / FreeBSD (Python 3.8) / pytest

tests/console/commands/test_install.py#L61

tests.console.commands.self.test_install.test_self_install[None]
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0xa0ee62604c0>
pyproject_content = None

    @pytest.mark.parametrize(
        "pyproject_content",
        (
            None,
            """\
    [tool.poetry]
    name = "poetry-instance"
    version = "1.2"
    description = ""
    authors = []
    license = ""
    # no package-mode -> defaults to true
    
    [tool.poetry.dependencies]
    python = "3.9"
    poetry = "1.2"
    """,
        ),
    )
    def test_self_install(
        tester: CommandTester,
        pyproject_content: str | None,
    ) -> None:
        command = tester.command
        assert isinstance(command, SelfInstallCommand)
        pyproject_path = command.system_pyproject
        if pyproject_content:
            pyproject_path.write_text(pyproject_content, encoding="utf-8")
        else:
            assert not pyproject_path.exists()
    
        tester.execute()
    
        expected_output = """\
    Updating dependencies
    Resolving dependencies...
    
    Writing lock file
    """
    
>       assert tester.io.fetch_output() == expected_output
E       AssertionError: assert 'Updating dep...ile written\n' == 'Updating dep...g lock file\n'
E         
E           Updating dependencies
E           Resolving dependencies...
E           
E         - Writing lock file
E         + Lock file written

/tmp/cirrus-ci-build/tests/console/commands/self/test_install.py:61: AssertionError

Check failure on line 126 in tests/console/commands/test_add.py

See this annotation in the file changed.

@cirrus-ci cirrus-ci / Tests / FreeBSD (Python 3.8) / pytest

tests/console/commands/test_add.py#L126

tests.console.commands.test_add.test_add_no_constraint
Raw output
app = <tests.helpers.PoetryTestApplication object at 0x1c01b6a74b20>
tester = <cleo.testers.command_tester.CommandTester object at 0x1c01c11003d0>

    def test_add_no_constraint(app: PoetryTestApplication, tester: CommandTester) -> None:
        tester.execute("cachy")
    
        expected = """\
    Using version ^0.2.0 for cachy
    
    Updating dependencies
    Resolving dependencies...
    
    Package operations: 2 installs, 0 updates, 0 removals
    
      - Installing msgpack-python (0.5.6)
      - Installing cachy (0.2.0)
    
    Writing lock file
    """
    
>       assert tester.io.fetch_output() == expected
E       AssertionError: assert 'Using versio...ile written\n' == 'Using versio...g lock file\n'
E         
E           Using version ^0.2.0 for cachy
E           
E           Updating dependencies
E           Resolving dependencies...
E           
E           Package operations: 2 installs, 0 updates, 0 removals
E           
E             - Installing msgpack-python (0.5.6)
E             - Installing cachy (0.2.0)
E           
E         - Writing lock file
E         + Lock file written

/tmp/cirrus-ci-build/tests/console/commands/test_add.py:126: AssertionError