Bug 191795 - [PATCH] devel/py-nose: Fix tests under Python 3.x
Summary: [PATCH] devel/py-nose: Fix tests under Python 3.x
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kubilay Kocak
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2014-07-10 21:41 UTC by Melvyn Sopacua
Modified: 2014-07-31 22:09 UTC (History)
1 user (show)

See Also:


Attachments
fix-tests-py-nose.patch (2.01 KB, patch)
2014-07-10 21:41 UTC, Melvyn Sopacua
no flags Details | Diff
Updated patch incorporating feedback. (2.17 KB, patch)
2014-07-27 14:22 UTC, Melvyn Sopacua
no flags Details | Diff
nose 1.3.3 test output (2 failing tests) (1.99 KB, text/plain)
2014-07-27 15:29 UTC, Kubilay Kocak
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Melvyn Sopacua 2014-07-10 21:41:18 UTC
Created attachment 144564 [details]
fix-tests-py-nose.patch

regression-test fails because build_tests isn't run and because the expected
output is not formatted correctly. Will see about upstreaming it, when I have more time.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2014-07-10 23:05:00 UTC
Assign to maintainer.

nivit@ I can take this if you like.

Melvyn,

`test` is the standard test command for Python packages, and I've tested it's use locally instead of build_tests, and it works:

-       @cd ${WRKSRC} && ${PYTHON_CMD} selftest.py
+       @cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test

Having as many Python ports as possible use that target will help when we add these as the default test mechanism to the Python ports framework bits.

While you're here patching nose, I can see it needs:

- LICENSE_FILE
- #Python3 ready comment removed
- A minor patch to setup.py for the nosetests.1 man page (would be cool if this wasnt needed)

Can you give these a go too along with an updated patch for tests? :)
Comment 2 Melvyn Sopacua 2014-07-11 19:46:27 UTC
Sure, I can do that.
Comment 3 Nicola Vitale freebsd_committer freebsd_triage 2014-07-11 23:31:06 UTC
Assign to koobs@, who want to take the mantainership of this port.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2014-07-13 01:14:35 UTC
Updated patch pending
Comment 5 Melvyn Sopacua 2014-07-27 14:22:55 UTC
Created attachment 145031 [details]
Updated patch incorporating feedback.

Updated patch:
- build_tests only needed for python 3 (see setup3lib.py)
- use PYDISTUTILS_SETUP
- use standard test command for PYDISTUTILS_SETUP
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2014-07-27 14:51:41 UTC
Thanks Melvyn, I was just about to commit a nose 1.3.3 update when I saw your updated patch come in.

Why is it necessary to add PYTHON_REL bits to Makefile when setup.py checks for and imports setup3lib, which then runs self.run_command('build_tests') ?

From my reading running build_tests is only necessary if executing the tests via selftests.py rather than the setuptools test command.

I see the following running regression-test under Python 3.4:

===>   py34-nose-1.3.3 depends on file: /usr/local/bin/python3.4 - found
running test
running build_tests

Granted the tests fail miserably.
Comment 7 commit-hook freebsd_committer freebsd_triage 2014-07-27 15:23:11 UTC
A commit references this bug:

Author: koobs
Date: Sun Jul 27 15:22:36 UTC 2014
New revision: 363074
URL: http://svnweb.freebsd.org/changeset/ports/363074

Log:
  devel/py-nose: Update to 1.3.3, Fix tests

  - Update to 1.3.3
  - Add LICENSE_FILE
  - Remove Python3 ready comment
  - Fix tests under Python 3.x
  - Remove patch to comment out man file installation

  PR:		191795
  Submitted by:	Melvyn Sopacua <melvyn at magemana dot nl>

Changes:
  head/devel/py-nose/Makefile
  head/devel/py-nose/distinfo
  head/devel/py-nose/files/
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2014-07-27 15:28:34 UTC
I've skipped the patches to test_config_defaults.rst since they don't seem to be affecting the 2 failing tests under Python 3.x

Ran 384 tests in 41.317s - FAILED (SKIP=10, failures=2)

See attached test log for details
Comment 9 Kubilay Kocak freebsd_committer freebsd_triage 2014-07-27 15:29:25 UTC
Created attachment 145033 [details]
nose 1.3.3 test output (2 failing tests)
Comment 10 Melvyn Sopacua 2014-07-29 20:26:28 UTC
I added it cause build_tests wouldn't work under 2.x. I failed to check if build_tests was still needed on 3.x with the new invocation.

The two failing tests you uploaded are unrelated to the patch I provided for the previous version. Perhaps stuff got fixed already in 1.3.3. Those two failures are likely related to sysvsem stuff or perhaps bash being a (hidden) test dependency. I haven't looked into the details.
Comment 11 Kubilay Kocak freebsd_committer freebsd_triage 2014-07-31 22:09:01 UTC
I took your changes after investigating further, thank you for looking into it.

Longer term it would be great to get tests working for Python 2.x and 3.x invoked via the `test` command without special treatment. 

This is left as an upstream exercise :)