Bug#922081: pyparted: Please enable build-time tests in pyparted

2019-02-27 Thread Steve Langasek
On Wed, Feb 27, 2019 at 08:55:13AM -0300, Herbert Fortes wrote:
> > The last try is here:

> > mips,  mips64el and  mipsel are important
> > for release and they fail.

> The test I skip for these archs has this first
> assert:

> self.assertGreater(len(parted.getLabels()), 0)

> The __init__.py file inside parted has:

> def getLabels(arch=None):
> [...]
> for label, regex in __archLabels:
> if re.match(regex, arch):
> labels.add(label)
> 
> return labels

> __archLabels is a tuple without mips*. I think this is
> why test fails.

> https://sources.debian.org/src/pyparted/3.11.2-9/src/parted/__init__.py/#L362

> Can you give me your opinion on that?

I have no opinion on the internals of pyparted.  There should certainly be
some partition table types recognized as valid on mips, but I'm also not a
mips porter so can't say which.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developer   https://www.debian.org/
slanga...@ubuntu.com vor...@debian.org


signature.asc
Description: PGP signature


Bug#922081: pyparted: Please enable build-time tests in pyparted

2019-02-27 Thread Herbert Fortes
Hi,

> The last try is here:
> 
> mips,  mips64el and  mipsel are important
> for release and they fail.
> 

The test I skip for these archs has this first
assert:

self.assertGreater(len(parted.getLabels()), 0)

The __init__.py file inside parted has:

def getLabels(arch=None):
[...]
for label, regex in __archLabels:
if re.match(regex, arch):
labels.add(label)

return labels


__archLabels is a tuple without mips*. I think this is
why test fails.

https://sources.debian.org/src/pyparted/3.11.2-9/src/parted/__init__.py/#L362

Can you give me your opinion on that?



Regards,
Herbert



Bug#922081: pyparted: Please enable build-time tests in pyparted

2019-02-26 Thread Herbert Fortes
On 2/26/19 7:55 AM, Herbert Fortes wrote:
> On 2/26/19 6:07 AM, Steve Langasek wrote:
>> On Mon, Feb 25, 2019 at 01:43:03PM -0300, Herbert Fortes wrote:
>>> On Wed, 20 Feb 2019 17:37:35 -0300 Herbert Fortes  wrote:
>>

>> It looks like this build has passed now:
>> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/pyparted.html
>>
>> Are you happy to close this bug?
>>
> 
> Honestly not yet.
> 
> There are two patches that I have to remove. One I am
> confidence to do so.
> 
> 
> armhf failed, but I think it is not the problem we treat
> here.
> 
> arm64 and i386 still missing.
> 
> kFreebsd and Hurd have problems. But it is ok.
> 
> I will upload a revision without one patch and Debian CI
> like debhelper does.
> 
> Don't worry. At the end everything will be fine.
> 

The last try is here:

mips,  mips64el and  mipsel are important
for release and they fail.

https://buildd.debian.org/status/package.php?p=pyparted=sid

E: pybuild pybuild:338: test: plugin distutils failed with: exit code=1: cd 
/<>/.pybuild/cpython2_2.7_parted/build; python2.7 -m unittest 
discover -v 

exit code=1

They are similar error message that happens to amrhf in
reproducible-builds:

https://tests.reproducible-builds.org/debian/rb-pkg/unstable/armhf/pyparted.html

E: pybuild pybuild:338: test: plugin distutils failed with: exit code=134: cd 
/build/pyparted-3.11.2/2nd/.pybuild/cpython2_2.7_parted/build; python2.7 -m 
unittest discover -v 

exit code=134

For release, 4 architectures still in 'needs-build'.

I was honestly confidence for  this one, but I will put back 
the patch I removed ( skip_0gt0.patch file). Let's not make 
this a big thing.

My wild-guess is that the env is not appropriated to parted.

I will talk to upstream about the 'find' anyway.



Bug#922081: pyparted: Please enable build-time tests in pyparted

2019-02-26 Thread Herbert Fortes
On 2/26/19 6:07 AM, Steve Langasek wrote:
> On Mon, Feb 25, 2019 at 01:43:03PM -0300, Herbert Fortes wrote:
>> On Wed, 20 Feb 2019 17:37:35 -0300 Herbert Fortes  wrote:
> 
>>> On 2/20/19 1:55 PM, Steve Langasek wrote:
 Package: pyparted
 Version: 3.11.2-6
 Followup-For: Bug #922081
 User: ubuntu-de...@lists.ubuntu.com
 Usertags: origin-ubuntu disco ubuntu-patch
> 
 I think the remaining issue is entirely a bug in the debian/rules
> 
>> When I try to build the package in a VM, I have no problems.
> 
>> When I try  to build the package in a 'chroot' it is not possible to build
>> the package.  No matter what.
> 
>> Debian CI have no problem, I will not touch it.
> 
>> I will upload a revision without the override:
> 
>>  - If reproducible-build does not complain.  Everybody is happy.
> 
>>  - If one test fails in reproducible-builds like here.
>>    It is only one more test to skip. Everybody is happy.
> 
> It looks like this build has passed now:
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/pyparted.html
> 
> Are you happy to close this bug?
> 

Honestly not yet.

There are two patches that I have to remove. One I am
confidence to do so.


armhf failed, but I think it is not the problem we treat
here.

arm64 and i386 still missing.

kFreebsd and Hurd have problems. But it is ok.

I will upload a revision without one patch and Debian CI
like debhelper does.

Don't worry. At the end everything will be fine.



Bug#922081: pyparted: Please enable build-time tests in pyparted

2019-02-26 Thread Steve Langasek
On Mon, Feb 25, 2019 at 01:43:03PM -0300, Herbert Fortes wrote:
> On Wed, 20 Feb 2019 17:37:35 -0300 Herbert Fortes  wrote:

> > On 2/20/19 1:55 PM, Steve Langasek wrote:
> > > Package: pyparted
> > > Version: 3.11.2-6
> > > Followup-For: Bug #922081
> > > User: ubuntu-de...@lists.ubuntu.com
> > > Usertags: origin-ubuntu disco ubuntu-patch

> > > I think the remaining issue is entirely a bug in the debian/rules

> When I try to build the package in a VM, I have no problems.

> When I try  to build the package in a 'chroot' it is not possible to build
> the package.  No matter what.

> Debian CI have no problem, I will not touch it.

> I will upload a revision without the override:

>  - If reproducible-build does not complain.  Everybody is happy.

>  - If one test fails in reproducible-builds like here.
>    It is only one more test to skip. Everybody is happy.

It looks like this build has passed now:
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/pyparted.html

Are you happy to close this bug?

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developer   https://www.debian.org/
slanga...@ubuntu.com vor...@debian.org


signature.asc
Description: PGP signature


Bug#922081: pyparted: Please enable build-time tests in pyparted

2019-02-25 Thread Herbert Fortes
Hi,


On Wed, 20 Feb 2019 17:37:35 -0300 Herbert Fortes  wrote:

> On 2/20/19 1:55 PM, Steve Langasek wrote:
> > Package: pyparted
> > Version: 3.11.2-6
> > Followup-For: Bug #922081
> > User: ubuntu-de...@lists.ubuntu.com
> > Usertags: origin-ubuntu disco ubuntu-patch
> >
> > I think the remaining issue is entirely a bug in the debian/rules


When I try to build the package in a VM, I have no

problems.


When I try  to build the package in a 'chroot' it

is not possible to build the package. No matter what.


Debian CI have no problem, I will not touch it.


I will upload a revision without the override:

 

 - If reproducible-build does not complain. Everybody

   is happy.

 - If one test fails in reproducible-builds like here.

   It is only one more test to skip. Everybody is happy.




Regards,

Herbert



Bug#922081: pyparted: Please enable build-time tests in pyparted

2019-02-20 Thread Herbert Fortes
On 2/20/19 1:55 PM, Steve Langasek wrote:
> Package: pyparted
> Version: 3.11.2-6
> Followup-For: Bug #922081
> User: ubuntu-de...@lists.ubuntu.com
> Usertags: origin-ubuntu disco ubuntu-patch
> 
> I think the remaining issue is entirely a bug in the debian/rules
> override_dh_auto_test rule.  When I dropped this override entirely in
> Ubuntu, the package builds fine.

The problem is reproducible-builds. Did you see the log? The
tests have a random problem.

> 
> The bug is that this override tries to use 'find | head', and expects that
> the result returned is the right directory for use when running the test
> suite under python3.  But the order in which results are returned from find
> is undefined, and likely filesystem-dependent; so on the builders for some
> architectures, it returns the python2.7 build instead of the python3 build.

I copy and paste from Makefile the 'find | head'.

Please, see this CI log:
https://ci.debian.net/data/autopkgtest/unstable/amd64/p/pyparted/1918396/log.gz

But it is true that it tries to use _ped.so from Python 2. The random
behavior can be from find. I put an find for each version. And got one 
more assertGreater error.

==
FAIL: runTest (tests.test__ped_ped.DeviceGetNextTestCase)
--
Traceback (most recent call last):
  File "/home/pyparted-3.11.2/tests/test__ped_ped.py", line 210, in runTest
self.assertGreater(len(lst), 0)
AssertionError: 0 not greater than 0

--

Only remove the override does not work. I tried now. I also tried a build 
for one Python version with an override with a find for it only.
./.pybuild/cpython2_2.7_parted/

AssertionError

version 3.11.2-3 has only the patch you sent. I did not work for everybody.

You can check upstream Makefile.



Regards,
Herbert



Bug#922081: pyparted: Please enable build-time tests in pyparted

2019-02-20 Thread Steve Langasek
Package: pyparted
Version: 3.11.2-6
Followup-For: Bug #922081
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu disco ubuntu-patch

I think the remaining issue is entirely a bug in the debian/rules
override_dh_auto_test rule.  When I dropped this override entirely in
Ubuntu, the package builds fine.

The bug is that this override tries to use 'find | head', and expects that
the result returned is the right directory for use when running the test
suite under python3.  But the order in which results are returned from find
is undefined, and likely filesystem-dependent; so on the builders for some
architectures, it returns the python2.7 build instead of the python3 build.

And furthermore, if this override DID work, it would be skipping testing for
the python2 module and only testing the python3 module.

So by deleting the override entirely, the test suite passes for me and does
the right thing of testing all the binaries.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developer   https://www.debian.org/
slanga...@ubuntu.com vor...@debian.org
diff -Nru pyparted-3.11.2/debian/rules pyparted-3.11.2/debian/rules
--- pyparted-3.11.2/debian/rules2019-02-14 13:49:15.0 +0100
+++ pyparted-3.11.2/debian/rules2019-02-18 06:57:48.0 +0100
@@ -13,12 +13,6 @@
rm -rf debian/python-parted-dbg/usr/lib/python2.7/dist-packages/parted/
rm -rf debian/python3-parted-dbg/usr/lib/python3*/dist-packages/parted/
 
-override_dh_auto_test:
-#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-#  PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs 
dirname):src/parted:src \
-# python3 -m unittest discover -v
-#endif
-
 override_dh_clean:
dh_clean
rm -fr debian/python3-parted-dbg


Bug#922081: pyparted: Please enable build-time tests in pyparted

2019-02-12 Thread Herbert Fortes
On 2/11/19 6:45 PM, Steve Langasek wrote:
> Package: pyparted
> Version: 3.11.2-2
> Severity: normal
> Tags: patch
> User: ubuntu-de...@lists.ubuntu.com
> Usertags: origin-ubuntu disco ubuntu-patch
> 
> Dear Herbert,
> 
> In Ubuntu, we have applied the attached patch to pyparted in order to enable
> build-time tests of the package.  It appears you have similarly tried to fix
> the tests with one of your distro patches, however the dh_auto_test target
> is still empty in your package and no tests are run, so perhaps this work
> was incomplete?
> 
> With the attached patch, the tests run and pass on all Ubuntu architectures. 
> I notice that you had skipped some of the tests as "failing on some
> architectures", but I assume that the build-dependency fixes are sufficient
> to let the tests pass on all other Debian architectures as well.
> 
> Hope that helps,
> 

Big thanks Steve and Łukasz!

Uploaded.



Regards,
Herbert



Bug#922081: pyparted: Please enable build-time tests in pyparted

2019-02-11 Thread Steve Langasek
Package: pyparted
Version: 3.11.2-2
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu disco ubuntu-patch

Dear Herbert,

In Ubuntu, we have applied the attached patch to pyparted in order to enable
build-time tests of the package.  It appears you have similarly tried to fix
the tests with one of your distro patches, however the dh_auto_test target
is still empty in your package and no tests are run, so perhaps this work
was incomplete?

With the attached patch, the tests run and pass on all Ubuntu architectures. 
I notice that you had skipped some of the tests as "failing on some
architectures", but I assume that the build-dependency fixes are sufficient
to let the tests pass on all other Debian architectures as well.

Hope that helps,
-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developer   https://www.debian.org/
slanga...@ubuntu.com vor...@debian.org
diff -Nru pyparted-3.11.2/debian/control pyparted-3.11.2/debian/control
--- pyparted-3.11.2/debian/control  2019-02-06 04:24:54.0 -0800
+++ pyparted-3.11.2/debian/control  2019-02-11 12:19:23.0 -0800
@@ -5,12 +5,12 @@
 Build-Depends: debhelper (>= 11),
dh-python,
libparted-dev,
+   parted,
pkg-config,
-   python-all-dbg (>= 2.6.6-13~),
python-all-dev (>= 2.6.6-13~),
python-six,
-   python3-all-dbg,
-   python3-all-dev
+   python3-all-dev,
+   python3-six
 Standards-Version: 4.3.0
 Homepage: https://github.com/dcantrell/pyparted
 Vcs-Git: https://salsa.debian.org/debian/pyparted.git
diff -Nru pyparted-3.11.2/debian/patches/fix-unit-tests.patch 
pyparted-3.11.2/debian/patches/fix-unit-tests.patch
--- pyparted-3.11.2/debian/patches/fix-unit-tests.patch 1969-12-31 
16:00:00.0 -0800
+++ pyparted-3.11.2/debian/patches/fix-unit-tests.patch 2017-07-17 
03:39:45.0 -0700
@@ -0,0 +1,26 @@
+Description: Fix two unit tests failing due to expecting wrong exceptions
+ _ped's *_flag_get_name methods now throw a PartedException instead of
+ ValueError on unsupported flags.
+Author: Łukasz 'sil2100' Zemczak 
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/pyparted/+bug/1695058
+Forwarded: https://github.com/dcantrell/pyparted/pull/43
+--- a/tests/test__ped_ped.py
 b/tests/test__ped_ped.py
+@@ -48,7 +48,7 @@
+ self.assertNotEqual(_ped.partition_flag_get_name(attr), "", 
"Could not get name for flag _ped.%s" % f)
+ 
+ self.assertRaises(ValueError, _ped.partition_flag_get_name, -1)
+-self.assertRaises(ValueError, _ped.partition_flag_get_name, 1000)
++self.assertRaises(_ped.PartedException, _ped.partition_flag_get_name, 
1000)
+ 
+ class PartitionFlagGetByNameTestCase(unittest.TestCase):
+ def runTest(self):
+@@ -82,7 +82,7 @@
+ self.assertNotEqual(_ped.disk_flag_get_name(f), "", "Could not 
get name for flag %s" % f)
+ 
+ self.assertRaises(ValueError, _ped.disk_flag_get_name, -1)
+-self.assertRaises(ValueError, _ped.disk_flag_get_name, 1000)
++self.assertRaises(_ped.PartedException, _ped.disk_flag_get_name, 1000)
+ 
+ class DiskFlagGetByNameTestCase(unittest.TestCase):
+ def runTest(self):
diff -Nru pyparted-3.11.2/debian/patches/series 
pyparted-3.11.2/debian/patches/series
--- pyparted-3.11.2/debian/patches/series   2019-02-06 04:09:49.0 
-0800
+++ pyparted-3.11.2/debian/patches/series   2019-02-11 12:11:07.0 
-0800
@@ -2,4 +2,4 @@
 typo_iff.patch
 typo-pydisck-h.patch
 no-last-flag-check.patch
-unknow_parttition_flag.patch
+fix-unit-tests.patch
diff -Nru pyparted-3.11.2/debian/patches/unknow_parttition_flag.patch 
pyparted-3.11.2/debian/patches/unknow_parttition_flag.patch
--- pyparted-3.11.2/debian/patches/unknow_parttition_flag.patch 2019-02-06 
04:09:49.0 -0800
+++ pyparted-3.11.2/debian/patches/unknow_parttition_flag.patch 1969-12-31 
16:00:00.0 -0800
@@ -1,69 +0,0 @@
-Description: comment assertRaises
- skip DiskNewLabeledTestCase
- skip FileSystemProbeTestCase - because of CI
- skip FileSystemProbeSpecificTestCase - because of CI
- skip GetLabelsTestCase. It fails on some archs
-Author: Herbert Parentes Fortes Neto 
-Last-Update: 2018-06-25
-Index: pyparted/tests/test__ped_ped.py
-===
 pyparted.orig/tests/test__ped_ped.py
-+++ pyparted/tests/test__ped_ped.py
-@@ -48,7 +48,7 @@ class PartitionFlagGetNameTestCase(unitt
- self.assertNotEqual(_ped.partition_flag_get_name(attr), "", 
"Could not get name for flag _ped.%s" % f)
- 
- self.assertRaises(ValueError, _ped.partition_flag_get_name, -1)
--