public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
Date: Mon, 10 Feb 2020 02:29:11 +0000 (UTC)	[thread overview]
Message-ID: <1581301451.b98dbb357b711f64c8fc1e305c5bca38be203f1d.zmedico@gentoo> (raw)

commit:     b98dbb357b711f64c8fc1e305c5bca38be203f1d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 10 01:10:14 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 10 02:24:11 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b98dbb35

test_virtual_w3m: add realistic case, deps copied from real ebuilds

Since virtual/w3m-0 is not removed in the depclean case,
this test fails to reproduce bug 649622.

Bug: https://bugs.gentoo.org/649622
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/tests/resolver/test_or_choices.py | 142 ++++++++++++++++++++++++++
 1 file changed, 142 insertions(+)

diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py
index a7ede1fac..f31a5ff22 100644
--- a/lib/portage/tests/resolver/test_or_choices.py
+++ b/lib/portage/tests/resolver/test_or_choices.py
@@ -581,6 +581,148 @@ class OrChoicesTestCase(TestCase):
 			playground.cleanup()
 
 
+	def test_virtual_w3m_realistic(self):
+		"""
+		Test for bug 649622 with realistic www-client/w3m dependencies copied
+		from real ebuilds.
+		"""
+		ebuilds = {
+
+			'app-misc/neofetch-6.1.0': {
+				'EAPI': '7',
+				'RDEPEND': 'www-client/w3m'
+			},
+
+			'app-text/xmlto-0.0.28-r1' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )'
+			},
+
+			'mail-client/neomutt-20191207': {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/lynx www-client/w3m www-client/elinks )'
+			},
+
+			'www-client/elinks-0.13_pre_pre20180225' : {
+				'EAPI': '7',
+			},
+
+			'www-client/lynx-2.9.0_pre4' : {
+				'EAPI': '7',
+			},
+
+			'virtual/w3m-0' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )'
+			},
+
+			'www-client/w3m-0.5.3_p20190105' : {
+				'EAPI': '7',
+			},
+
+			'www-client/w3mmee-0.3.2_p24-r10' : {
+				'EAPI': '7',
+			},
+
+			'x11-base/xorg-server-1.20.7' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/links www-client/lynx www-client/w3m ) app-text/xmlto',
+			}
+		}
+
+		installed = {
+
+			'app-misc/neofetch-6.1.0': {
+				'EAPI': '7',
+				'RDEPEND': 'www-client/w3m'
+			},
+
+			'app-text/xmlto-0.0.28-r1' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )'
+			},
+
+			'mail-client/neomutt-20191207': {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/lynx www-client/w3m www-client/elinks )'
+			},
+
+			'www-client/lynx-2.9.0_pre4' : {
+				'EAPI': '7',
+			},
+
+			'www-client/w3m-0.5.3_p20190105' : {
+				'EAPI': '7',
+			},
+
+			'x11-base/xorg-server-1.20.7' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/links www-client/lynx www-client/w3m ) app-text/xmlto',
+			}
+		}
+
+		world = ['app-misc/neofetch', 'mail-client/neomutt', 'www-client/lynx', 'x11-base/xorg-server']
+
+		test_cases = (
+
+			# Test for bug 649622 (with www-client/w3m installed via
+			# xorg-server dependency), where virtual/w3m was pulled in
+			# only to be removed by the next emerge --depclean.
+			ResolverPlaygroundTestCase(
+				['@world'],
+				options = {'--update': True, '--deep': True},
+				success = True,
+				mergelist=['virtual/w3m-0'],
+			),
+
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds,
+			installed=installed, world=world, debug=False)
+		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.debug = False
+			playground.cleanup()
+
+
+		installed = dict(itertools.chain(installed.items(), {
+
+			'virtual/w3m-0' : {
+				'EAPI': '7',
+				'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )'
+			},
+
+		}.items()))
+
+		test_cases = (
+
+			# Test for bug 649622, where virtual/w3m is removed by
+			# emerge --depclean immediately after it's installed
+			# by a world update. Since virtual/w3m-0 is not removed
+			# here, this case fails to reproduce bug 649622.
+			ResolverPlaygroundTestCase(
+				[],
+				options={'--depclean': True},
+				success=True,
+				cleanlist=[],
+			),
+
+		)
+
+		playground = ResolverPlayground(ebuilds=ebuilds,
+			installed=installed, world=world, debug=False)
+		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.debug = False
+			playground.cleanup()
+
+
 class OrChoicesLibpostprocTestCase(TestCase):
 
 	def testOrChoicesLibpostproc(self):


             reply	other threads:[~2020-02-10  2:29 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10  2:29 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-05-26 18:58 [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/ Zac Medico
2024-05-26 18:48 Zac Medico
2024-02-09 21:40 Zac Medico
2023-12-24 19:30 Zac Medico
2023-11-28 22:26 Sam James
2023-11-18  1:16 Zac Medico
2023-06-19 21:17 Sam James
2023-06-16  3:34 Sam James
2023-06-16  3:34 Sam James
2023-05-26 15:45 Sam James
2023-05-26 15:45 Sam James
2023-05-26 15:45 Sam James
2023-02-19 19:19 Sam James
2023-01-02 20:45 Mike Gilbert
2022-07-25 22:01 Zac Medico
2022-07-25 20:44 Mike Gilbert
2022-02-14  0:14 Zac Medico
2021-05-24  6:33 Zac Medico
2021-03-28  6:21 Zac Medico
2021-03-06  9:53 Zac Medico
2021-03-01  8:56 Zac Medico
2021-03-01  6:43 Zac Medico
2021-02-23 22:39 Zac Medico
2021-01-11  3:40 Zac Medico
2020-12-02 17:33 Zac Medico
2020-11-15  5:56 Zac Medico
2020-09-19 20:28 Zac Medico
2020-08-30 22:39 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 21:42 Zac Medico
2020-08-03 19:30 Zac Medico
2020-04-11 23:50 Zac Medico
2020-02-10  3:19 Zac Medico
2020-02-09 23:57 Zac Medico
2020-02-09 23:15 Zac Medico
2020-02-08  8:35 Zac Medico
2020-02-01  4:48 Zac Medico
2020-01-26  6:27 Zac Medico
2020-01-26  0:20 Zac Medico
2020-01-25 22:37 Zac Medico
2020-01-21  2:37 Zac Medico
2019-12-25  8:18 Zac Medico
2019-12-22  0:35 Zac Medico
2019-12-22  0:28 Zac Medico
2019-12-21 23:54 Zac Medico
2019-11-16  9:57 Zac Medico
2019-10-21  8:26 Zac Medico
2019-10-11  4:00 Zac Medico
2019-09-15  3:36 Zac Medico
2019-09-12 19:43 Zac Medico
2019-09-12 19:05 Zac Medico
2019-01-20 19:27 Zac Medico
2018-12-30  2:34 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1581301451.b98dbb357b711f64c8fc1e305c5bca38be203f1d.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox