commit: cb1aac839eac339862b03704798e0b35b73cde56 Author: Alfred Wingate <parona <AT> protonmail <DOT> com> AuthorDate: Mon Jan 6 07:45:50 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sun Mar 9 21:54:05 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=cb1aac83
tests: resolver: Add xfail test for Ada bootstrap chain (bug #947587) Bug: https://bugs.gentoo.org/947587 Signed-off-by: Alfred Wingate <parona <AT> protonmail.com> Signed-off-by: Sam James <sam <AT> gentoo.org> lib/portage/tests/resolver/meson.build | 1 + lib/portage/tests/resolver/test_bootstrap_deps.py | 76 +++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/lib/portage/tests/resolver/meson.build b/lib/portage/tests/resolver/meson.build index ea948982e7..7569af8cd0 100644 --- a/lib/portage/tests/resolver/meson.build +++ b/lib/portage/tests/resolver/meson.build @@ -16,6 +16,7 @@ py.install_sources( 'test_binary_pkg_ebuild_visibility.py', 'test_blocker.py', 'test_broken_deps.py', + 'test_bootstrap_deps.py', 'test_changed_deps.py', 'test_circular_choices.py', 'test_circular_choices_rust.py', diff --git a/lib/portage/tests/resolver/test_bootstrap_deps.py b/lib/portage/tests/resolver/test_bootstrap_deps.py new file mode 100644 index 0000000000..ac8f4eecd1 --- /dev/null +++ b/lib/portage/tests/resolver/test_bootstrap_deps.py @@ -0,0 +1,76 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +import pytest + +from portage.tests import TestCase +from portage.tests.resolver.ResolverPlayground import ( + ResolverPlayground, + ResolverPlaygroundTestCase, +) + + +class BootstrapChainTestCase(TestCase): + @pytest.mark.xfail(reason="bug #947587") + def testBootstrapChainWithShortcut(self): + ebuilds = { + "dev-libs/A-1": { + "EAPI": "8", + "SLOT": "1", + "IUSE": "B", + "BDEPEND": "B? ( || ( <dev-libs/B-2 dev-libs/A:1[B] ) )", + }, + "dev-libs/A-2": { + "EAPI": "8", + "SLOT": "2", + "IUSE": "B", + "BDEPEND": "B? ( || ( <dev-libs/B-3 dev-libs/A:2[B] <dev-libs/A-2[B] ) )", + }, + "dev-libs/A-3": { + "EAPI": "8", + "SLOT": "3", + "IUSE": "B", + "BDEPEND": "B? ( || ( <dev-libs/B-4 dev-libs/A:3[B] <dev-libs/A-3[B] ) )", + }, + "dev-libs/A-4": { + "EAPI": "8", + "SLOT": "4", + "IUSE": "B", + "BDEPEND": "B? ( || ( <dev-libs/B-5 dev-libs/A:4[B] <dev-libs/A-4[B] ) )", + }, + "dev-libs/B-1": {}, + "dev-libs/B-2": {}, + "dev-libs/B-3": {}, + "dev-libs/B-4": {}, + } + + installed = { + "dev-libs/A-4": { + "SLOT": "4", + "IUSE": "B", + "USE": "", + "BDEPEND": "B? ( || ( <dev-libs/B-5 <dev-libs/A:4[B] dev-libs/A-4[B]) )", + }, + } + + user_config = { + "package.use": ("dev-libs/A B",), + } + + test_cases = ( + ResolverPlaygroundTestCase( + ["dev-libs/A:4"], + success=True, + mergelist=["dev-libs/B-4", "dev-libs/A-4"], + ), + ) + + playground = ResolverPlayground( + ebuilds=ebuilds, installed=installed, user_config=user_config, debug=True + ) + try: + for test_case in test_cases: + playground.run_TestCase(test_case) + self.assertEqual(test_case.test_success, True, test_case.fail_msg) + finally: + playground.cleanup()
