Status

support.mozilla.org
Code Quality
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: willkg, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

When running the unit tests on my machine, I get two failures every time:

FAIL: kitsune.wiki.tests.test_parser:TestWikiVideo.test_video_english
  vim +446 kitsune/wiki/tests/test_parser.py  # test_video_english
    doc('video').html())
  vim +31  vendor/packages/nose/nose/tools.py  # eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: u'<source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.webm" type="video/webm"><source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.ogv" type="video/ogg"/></source>' != u'\n          <source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.webm" type="video/webm">\n          <source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.ogv" type="video/ogg">\n      </source></source>'

FAIL: kitsune.wiki.tests.test_parser:TestWikiVideo.test_video_fallback_french
  vim +455 kitsune/wiki/tests/test_parser.py  # test_video_fallback_french
    self.test_video_english()
  vim +446 kitsune/wiki/tests/test_parser.py  # test_video_english
    doc('video').html())
  vim +31  vendor/packages/nose/nose/tools.py  # eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: u'<source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.webm" type="video/webm"><source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.ogv" type="video/ogg"/></source>' != u'\n          <source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.webm" type="video/webm">\n          <source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.ogv" type="video/ogg">\n      </source></source>'


These and the code they test hasn't really been changed in ages, so I suspect the reason they fail is that I did a system update and picked up a new libxml2 version (2.8 -> 2.9). It's difficult to verify that theory.

One thing to note is that both the expected and actual output of these tests look wrong. For example:

<source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.webm" type="video/webm"><source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.ogv" type="video/ogg"/></source>

vs. 

\n          <source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.webm" type="video/webm">\n          <source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.ogv" type="video/ogg">\n      </source></source>

The source tag in HTML5 doesn't allow for child tags and it doesn't have an end tag. So this really should be something like this:

<source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.webm" type="video/webm">
<source src="/media/uploads/gallery/videos/2013-07-11-11-29-37-098f6b.ogv" type="video/ogg">

Ergo, I'm not sure the tests (or the code) were ever correct.
To chime in, I'm having these same test failures, and willkg's libxml2 theory sounds likely to me. I am also running libxml2 2.9.
Threw together a PR that accepts both possibilities as acceptable output.

https://github.com/mozilla/kitsune/pull/1488
Marking as FIXED since this just fixes a test that fails for some of us because of environmental issues.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.