Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12910 closed (fixed)

xgettext now required to run tests

Reported by: Karen Tracey Owned by: Jannis Leidel
Component: Uncategorized Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Attempting to run tests on a Windows machine with no xgettext package install now dies a horrible death. The failure to find an xgettext executable causes the whole test run to just quit:

Installed 62 object(s) from 5 fixture(s)
......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Error: errors happened while running xgettext on __init__.py
'xgettext' is not recognized as an internal or external command,
operable program or batch file.


C:\u\kmt\django\trunk\tests>

I think we need to somehow figure out if xgettext is available and if not, skip running tests that require it.

Attachments (1)

12910.1.diff (9.3 KB ) - added by Jannis Leidel 15 years ago.
Patch to only perform extraction tests if xgettext is found in PATH.

Download all attachments as: .zip

Change History (9)

comment:1 by Jannis Leidel, 15 years ago

Hm, does that only occur for Django's tests or for app tests as well?

in reply to:  1 ; comment:2 by Ramiro Morales, 15 years ago

Replying to jezdez:

Hm, does that only occur for Django's tests or for app tests as well?

I suspect it is just the Django test suite with our new makemessages regression test. I can reproduce this by just running it (it seems there are other test failures when xgettext.exe does exist too).

And I suspect it could be related to this:

Summary: The old os.popen3 simply ignored the condition of a missing xgettext (or msgmerge or msgfmt) and we used that to our advantage (creating an empty .po file). Now subprocess.Popen() raises an OSError exception instead.

I had seen this and made a mental note about testing this under win32, but forgot to do it later.

Problem was I couldn't get Popen() to raise that OSError under Linux when trying to execute a non-existing external command (e.g. Popen('foo', shell=True, stdout=PIPE, stderr=PIPE, close_fds=False, universal_newlines=True).communicate())

comment:3 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedAccepted

in reply to:  2 comment:4 by Jannis Leidel, 15 years ago

Replying to ramiro:

Replying to jezdez:

Hm, does that only occur for Django's tests or for app tests as well?

I suspect it is just the Django test suite with our new makemessages regression test. I can reproduce this by just running it (it seems there are other test failures when xgettext.exe does exist too).

Russ and me we thinking about making the makemessages tests optional just like we do with YAML tests for example, e.g. by a conditional import in the makemessages/tests.py if a call to xgettext succeeds.

And I suspect it could be related to this:

Summary: The old os.popen3 simply ignored the condition of a missing xgettext (or msgmerge or msgfmt) and we used that to our advantage (creating an empty .po file). Now subprocess.Popen() raises an OSError exception instead.

I had seen this and made a mental note about testing this under win32, but forgot to do it later.

Problem was I couldn't get Popen() to raise that OSError under Linux when trying to execute a non-existing external command (e.g. Popen('foo', shell=True, stdout=PIPE, stderr=PIPE, close_fds=False, universal_newlines=True).communicate())

Oddly enough Popen() will only raise the OSError for me if I pass it shell=False.

by Jannis Leidel, 15 years ago

Attachment: 12910.1.diff added

Patch to only perform extraction tests if xgettext is found in PATH.

comment:5 by Jannis Leidel, 15 years ago

Owner: changed from nobody to Jannis Leidel
Status: newassigned

comment:6 by Jannis Leidel, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [12475]) Fixed #12910 - Only test extracting translation strings if xgettext can be found on PATH.

comment:7 by Jannis Leidel, 15 years ago

(In [12589]) [1.1.X] Fixed #12910 - Only test extracting translation strings if xgettext can be found on PATH.

Backport from r12475.

comment:8 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top