[pacman-dev] [PATCH] Add test case for the perl 5.20 dependency breakage
This test currently fails. Signed-off-by: Florian Pritz <bluewind@xinu.at> --- test/pacman/tests/sync-perl520-breakage.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/pacman/tests/sync-perl520-breakage.py diff --git a/test/pacman/tests/sync-perl520-breakage.py b/test/pacman/tests/sync-perl520-breakage.py new file mode 100644 index 0000000..3c1c145 --- /dev/null +++ b/test/pacman/tests/sync-perl520-breakage.py @@ -0,0 +1,21 @@ +self.description = "Upgrade a package that loose a provides entry which moves to a dedicated package" + +lp1 = pmpkg("perl", "5.18-1") +lp1.provides = ["perl-scalar-list-utils=1.27"] +lp2 = pmpkg("perl-data-optlist") +lp2.depends = ["perl-scalar-list-utils"] + +for p in lp1, lp2: + self.addpkg2db("local", p) + +p1 = pmpkg("perl", "5.20-1") +p2 = pmpkg("perl-scalar-list-utils", "1.38-1") + +for p in p1, p2: + self.addpkg2db("sync", p) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=perl-scalar-list-utils|1.38-1") +self.addrule("PKG_VERSION=perl|5.20-1") -- 1.9.2
On 06/01/14 at 02:21pm, Florian Pritz wrote:
This test currently fails.
Signed-off-by: Florian Pritz <bluewind@xinu.at> --- test/pacman/tests/sync-perl520-breakage.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/pacman/tests/sync-perl520-breakage.py
All tests need to be listed in tests/pacman/tests/TESTS and failing tests need to set self.expectfailure = True. This is also a rather more specific test name than any of our other tests.
diff --git a/test/pacman/tests/sync-perl520-breakage.py b/test/pacman/tests/sync-perl520-breakage.py new file mode 100644 index 0000000..3c1c145 --- /dev/null +++ b/test/pacman/tests/sync-perl520-breakage.py @@ -0,0 +1,21 @@ +self.description = "Upgrade a package that loose a provides entry which moves to a dedicated package" + +lp1 = pmpkg("perl", "5.18-1") +lp1.provides = ["perl-scalar-list-utils=1.27"] +lp2 = pmpkg("perl-data-optlist") +lp2.depends = ["perl-scalar-list-utils"] + +for p in lp1, lp2: + self.addpkg2db("local", p) + +p1 = pmpkg("perl", "5.20-1") +p2 = pmpkg("perl-scalar-list-utils", "1.38-1") + +for p in p1, p2: + self.addpkg2db("sync", p) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=perl-scalar-list-utils|1.38-1") +self.addrule("PKG_VERSION=perl|5.20-1") -- 1.9.2
On Sun, Jun 1, 2014 at 8:47 AM, Andrew Gregory <andrew.gregory.8@gmail.com> wrote:
On 06/01/14 at 02:21pm, Florian Pritz wrote:
This test currently fails.
Signed-off-by: Florian Pritz <bluewind@xinu.at> --- test/pacman/tests/sync-perl520-breakage.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/pacman/tests/sync-perl520-breakage.py
All tests need to be listed in tests/pacman/tests/TESTS and failing tests need to set self.expectfailure = True. This is also a rather more specific test name than any of our other tests.
Agreed on the first two points; I think it might be beneficial however to start naming tests like this. One could even write a script that parsed descriptions of existing tests and turned it into a possible filename. e.g. sync900.py: self.description = "Replace one package with another providing it" -> "sync-replace-package-another-providing.py" basically 1) grab the prefix, 2) drop the number, 3) drop common words*, 4) concat with hyphens. * common words in this were "one", "with", "it", but I can't imagine the dictionary is much bigger than 20 or so words. -Dan
On 01/06/14 22:21, Florian Pritz wrote:
This test currently fails.
Is this not the same as sync406.py?
Signed-off-by: Florian Pritz <bluewind@xinu.at> --- test/pacman/tests/sync-perl520-breakage.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/pacman/tests/sync-perl520-breakage.py
diff --git a/test/pacman/tests/sync-perl520-breakage.py b/test/pacman/tests/sync-perl520-breakage.py new file mode 100644 index 0000000..3c1c145 --- /dev/null +++ b/test/pacman/tests/sync-perl520-breakage.py @@ -0,0 +1,21 @@ +self.description = "Upgrade a package that loose a provides entry which moves to a dedicated package" + +lp1 = pmpkg("perl", "5.18-1") +lp1.provides = ["perl-scalar-list-utils=1.27"] +lp2 = pmpkg("perl-data-optlist") +lp2.depends = ["perl-scalar-list-utils"] + +for p in lp1, lp2: + self.addpkg2db("local", p) + +p1 = pmpkg("perl", "5.20-1") +p2 = pmpkg("perl-scalar-list-utils", "1.38-1") + +for p in p1, p2: + self.addpkg2db("sync", p) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=perl-scalar-list-utils|1.38-1") +self.addrule("PKG_VERSION=perl|5.20-1")
On 02.06.2014 01:39, Allan McRae wrote:
On 01/06/14 22:21, Florian Pritz wrote:
This test currently fails.
Is this not the same as sync406.py?
Not sure, could be. I just wrote the test because Dave asked me to. I didn't look at the existing tests.
On 06/02/14 at 09:39am, Allan McRae wrote:
On 01/06/14 22:21, Florian Pritz wrote:
This test currently fails.
Is this not the same as sync406.py?
Not quite. They're very similar, but sync406.py deals with packages in the active transaction, which requires smarter dependency resolution. This involves installed packages not part of the transaction, requiring us to change what is now just a check that the transaction doesn't break local packages to actually fixing those breakages. apg
Signed-off-by: Florian Pritz <bluewind@xinu.at> --- test/pacman/tests/sync-perl520-breakage.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/pacman/tests/sync-perl520-breakage.py
diff --git a/test/pacman/tests/sync-perl520-breakage.py b/test/pacman/tests/sync-perl520-breakage.py new file mode 100644 index 0000000..3c1c145 --- /dev/null +++ b/test/pacman/tests/sync-perl520-breakage.py @@ -0,0 +1,21 @@ +self.description = "Upgrade a package that loose a provides entry which moves to a dedicated package" + +lp1 = pmpkg("perl", "5.18-1") +lp1.provides = ["perl-scalar-list-utils=1.27"] +lp2 = pmpkg("perl-data-optlist") +lp2.depends = ["perl-scalar-list-utils"] + +for p in lp1, lp2: + self.addpkg2db("local", p) + +p1 = pmpkg("perl", "5.20-1") +p2 = pmpkg("perl-scalar-list-utils", "1.38-1") + +for p in p1, p2: + self.addpkg2db("sync", p) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=perl-scalar-list-utils|1.38-1") +self.addrule("PKG_VERSION=perl|5.20-1")
On 07/06/14 22:38, Andrew Gregory wrote:
On 06/02/14 at 09:39am, Allan McRae wrote:
On 01/06/14 22:21, Florian Pritz wrote:
This test currently fails.
Is this not the same as sync406.py?
Not quite. They're very similar, but sync406.py deals with packages in the active transaction, which requires smarter dependency resolution. This involves installed packages not part of the transaction, requiring us to change what is now just a check that the transaction doesn't break local packages to actually fixing those breakages.
Great - thanks for looking into this.
Signed-off-by: Florian Pritz <bluewind@xinu.at> --- test/pacman/tests/sync-perl520-breakage.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/pacman/tests/sync-perl520-breakage.py
Not convince about the name including perl520 in it. But I do agree with Dan about the need to rename most of our tests to be more descriptive. How about: sync-update-package-removing-required-provides
diff --git a/test/pacman/tests/sync-perl520-breakage.py b/test/pacman/tests/sync-perl520-breakage.py new file mode 100644 index 0000000..3c1c145 --- /dev/null +++ b/test/pacman/tests/sync-perl520-breakage.py @@ -0,0 +1,21 @@ +self.description = "Upgrade a package that loose a provides entry which moves to a dedicated package" + +lp1 = pmpkg("perl", "5.18-1")
I know using real package names is useful when constructing a test, but keeping them simple improves understanding when reading them later "pkg1", "1-1"
+lp1.provides = ["perl-scalar-list-utils=1.27"]
"provide=1"
+lp2 = pmpkg("perl-data-optlist")
"pkg2" etc...
+lp2.depends = ["perl-scalar-list-utils"] + +for p in lp1, lp2: + self.addpkg2db("local", p) + +p1 = pmpkg("perl", "5.20-1") +p2 = pmpkg("perl-scalar-list-utils", "1.38-1") + +for p in p1, p2: + self.addpkg2db("sync", p) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=perl-scalar-list-utils|1.38-1") +self.addrule("PKG_VERSION=perl|5.20-1")
This test currently fails. Signed-off-by: Florian Pritz <bluewind@xinu.at> --- v2: - changed filename - renamed packages in the testcase to more generic ones (I don't like "provides" as a provided package name so I chose "feature") - expectfailure = True - add to TESTS test/pacman/tests/TESTS | 1 + ...nc-update-package-removing-required-provides.py | 23 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/pacman/tests/sync-update-package-removing-required-provides.py diff --git a/test/pacman/tests/TESTS b/test/pacman/tests/TESTS index a987cff..dc47294 100644 --- a/test/pacman/tests/TESTS +++ b/test/pacman/tests/TESTS @@ -140,6 +140,7 @@ TESTS += test/pacman/tests/sync-nodepversion03.py TESTS += test/pacman/tests/sync-nodepversion04.py TESTS += test/pacman/tests/sync-nodepversion05.py TESTS += test/pacman/tests/sync-nodepversion06.py +TESTS += test/pacman/tests/sync-update-package-removing-required-provides.py TESTS += test/pacman/tests/sync001.py TESTS += test/pacman/tests/sync002.py TESTS += test/pacman/tests/sync003.py diff --git a/test/pacman/tests/sync-update-package-removing-required-provides.py b/test/pacman/tests/sync-update-package-removing-required-provides.py new file mode 100644 index 0000000..19bfd92 --- /dev/null +++ b/test/pacman/tests/sync-update-package-removing-required-provides.py @@ -0,0 +1,23 @@ +self.description = "Upgrade a package that loose a provides entry which moves to a dedicated package" + +lp1 = pmpkg("pkg1", "1-1") +lp1.provides = ["feature=1"] +lp2 = pmpkg("pkg2") +lp2.depends = ["feature"] + +for p in lp1, lp2: + self.addpkg2db("local", p) + +sp1 = pmpkg("pkg1", "2-1") +# NOTE: no provides for feature anymore +sp2 = pmpkg("feature", "2-1") + +for p in sp1, sp2: + self.addpkg2db("sync", p) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=feature|2-1") +self.addrule("PKG_VERSION=pkg1|2-1") +self.expectfailure = True -- 2.0.0
On 09/06/14 22:21, Florian Pritz wrote:
This test currently fails.
Signed-off-by: Florian Pritz <bluewind@xinu.at> ---
v2: - changed filename - renamed packages in the testcase to more generic ones (I don't like "provides" as a provided package name so I chose "feature") - expectfailure = True - add to TESTS
Thanks, Allan
participants (4)
-
Allan McRae
-
Andrew Gregory
-
Dan McGee
-
Florian Pritz