Page MenuHomePhabricator

site detection failures
Closed, ResolvedPublic

Description

These changes are likely caused by external factors, but they need to be investigated and corrected.

FAIL: test_detect_failure (tests.site_detect_tests.SiteDetectionTestCase)
Test detection failure for MediaWiki sites with an API.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/site_detect_tests.py", line 217, in test_detect_failure
    self.assertAllError()
  File "tests/site_detect_tests.py", line 122, in assertAllError
    self.assertEqual(self.failures, {})
AssertionError: {u'http://hackerspaces.org/wiki/$1': AssertionError('<pywikibot.site_detect.MWSi [truncated]... != {}
- {u'http://hackerspaces.org/wiki/$1': AssertionError('<pywikibot.site_detect.MWSite object at 0x7fbba1bc3f10> is not None',)}
+ {}

======================================================================
FAIL: test_detect_site (tests.site_detect_tests.SiteDetectionTestCase)
Test detection of MediaWiki sites.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/site_detect_tests.py", line 184, in test_detect_site
    self.assertAllPass()
  File "tests/site_detect_tests.py", line 115, in assertAllPass
    self.assertEqual(set(self.passes), set(self.all) - set(self.skips))
AssertionError: Items in the second set but not the first:
u'http://botwiki.sno.cc/wiki/$1'

Event Timeline

jayvdb created this task.Mar 6 2016, 1:23 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMar 6 2016, 1:24 AM
Xqt added a subscriber: Xqt.Mar 6 2016, 12:18 PM

I got:

C:\pwb\GIT\core>pwb.py tests/site_detect_tests -v SiteDetectionTestCase.test_det
ect_failure
tests: max_retries reduced from 25 to 1
test_detect_failure (__main__.SiteDetectionTestCase)
Test detection failure for MediaWiki sites with an API. ... expected failure
Out of 1 sites, 0 tests passed, 1 tests failed, 0 tests skiped and 0 tests raise
d an error
Results:
FAIL http://hackerspaces.org/wiki/$1 : <pywikibot.site_detect.MWSite object at 0
x02F6A490> is not None

----------------------------------------------------------------------
Ran 1 test in 2.489s

OK (expected failures=1)

ok, maybe the hackerspaces problem is Python version specific (and maybe unittest vs unittest2).

The hackerspaces problem doesnt appear in Travis or Appveyor builds, so I'll need to debug my local configuration that caused the error.

I think http://botwiki.sno.cc/wiki/$1 might also be causing problems. Looks like the domain has expired.

Xqt closed this task as Resolved.Mar 9 2016, 5:08 PM
Xqt claimed this task.
Lokal_Profil reopened this task as Open.Mar 9 2016, 5:15 PM

I'm now getting an "unexpected success" when running the test. Commenting out https://gerrit.wikimedia.org/r/#/c/269929/ makes it work again though.

Maybe revert that one?

Xqt added a comment.Mar 9 2016, 5:27 PM

Lokal_Profil can't find that failure in last builds.

Hum. Another looks like another discrepancy between Travis and running the test locally :/

hackerspaces does appear in CircleCI builds. https://circleci.com/gh/jayvdb/pywikibot-core/511

Xqt triaged this task as Medium priority.Mar 18 2016, 2:46 PM
Xqt added a comment.Apr 22 2016, 9:40 AM

Seems we have a similar problem for another wiki:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\Administrator>cd ..

C:\Users>cd ..

C:\>cd pwb/git/core

C:\pwb\GIT\core>pwb.py tests/site_detect_tests -v SiteDetectionTestCase.test_det
ect_site
tests: max_retries reduced from 25 to 1
test_detect_site (__main__.SiteDetectionTestCase)
Test detection of MediaWiki sites. ... failure http://www.wikichristian.org/inde
x.php?title=$1 on <type 'exceptions.AttributeError'>: 'MWSite' object has no att
ribute 'private_wiki'
FAIL
 15.254s Out of 9 sites, 8 tests passed, 0 tests failed, 0 tests skiped and 1 te
sts raised an error
Results:
PASS http://www.hrwiki.org/index.php/$1                : <pywikibot.site_detect.
MWSite object at 0x032D05F0>
PASS http://www.proofwiki.org/wiki/$1                  : <pywikibot.site_detect.
MWSite object at 0x032ED330>
PASS http://www.ck-wissen.de/ckwiki/index.php?title=$1 : <pywikibot.site_detect.
MWSite object at 0x032D0FB0>
PASS http://en.citizendium.org/wiki/$1                 : <pywikibot.site_detect.
MWSite object at 0x032D0650>
PASS http://www.lojban.org/tiki/tiki-index.php?page=$1 : <pywikibot.site_detect.
MWSite object at 0x032ED950>
PASS https://en.wikifur.com/wiki/$1                    : <pywikibot.site_detect.
MWSite object at 0x032ED510>
PASS http://bluwiki.com/go/$1                          : <pywikibot.site_detect.
MWSite object at 0x032ED930>
PASS http://kino.skripov.com/index.php/$1              : <pywikibot.site_detect.
MWSite object at 0x032D06F0>
ERR  http://www.wikichristian.org/index.php?title=$1   : 'MWSite' object has no
attribute 'private_wiki'

======================================================================
FAIL: test_detect_site (__main__.SiteDetectionTestCase)
Test detection of MediaWiki sites.
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".\tests\site_detect_tests.py", line 183, in test_detect_site
    self.assertAllPass()
  File ".\tests\site_detect_tests.py", line 115, in assertAllPass
    self.assertEqual(set(self.passes), set(self.all) - set(self.skips))
AssertionError: Items in the second set but not the first:
u'http://www.wikichristian.org/index.php?title=$1'

----------------------------------------------------------------------
Ran 1 test in 15.260s

FAILED (failures=1)

C:\pwb\GIT\core>
Xqt added a comment.Apr 24 2016, 3:27 PM

I found newlines and BOM on top of the json file which caused that bug.

Change 285071 had a related patch set uploaded (by Xqt):
[bugfix] Enable test_detect_site for wikichristian.org

https://gerrit.wikimedia.org/r/285071

Change 285071 merged by jenkins-bot:
[bugfix] Enable test_detect_site for wikichristian.org

https://gerrit.wikimedia.org/r/285071

Xqt closed this task as Resolved.May 7 2016, 2:43 PM