Page MenuHomePhabricator

wikibase_tests fails for TestOwnClient.test_own_client_wikidatatest
Closed, ResolvedPublic

Description

C:\pwb\GIT\core>pwb.py tests/wikibase_tests -v TestOwnClient.test_own_client_wikidatatest
tests: max_retries reduced from 25 to 1
test_own_client_wikidatatest (__main__.TestOwnClient)
Test that a data repository family can be its own client on wikidata:test ... ER
ROR

======================================================================
ERROR: test_own_client_wikidatatest (__main__.TestOwnClient)
Test that a data repository family can be its own client on wikidata:test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\pwb\GIT\core\tests\aspects.py", line 697, in wrapped_method
    func(self, key)
  File ".\tests\wikibase_tests.py", line 1139, in test_own_client
    item = pywikibot.ItemPage.fromPage(page)
  File "C:\pwb\GIT\core\pywikibot\page.py", line 3844, in fromPage
    raise pywikibot.NoPage(i)
NoPage: Page [[wikidata:test:-1]] doesn't exist.

----------------------------------------------------------------------
Ran 1 test in 5.359s

FAILED (errors=1)

C:\pwb\GIT\core>

Event Timeline

Xqt triaged this task as Medium priority.May 7 2016, 3:51 PM

Change 287424 had a related patch set uploaded (by Xqt):
[bugfix] fix tests for wikidata

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

Change 287424 merged by jenkins-bot:
[bugfix] fix tests for wikidata

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

test wikidata main page now does have its own item , created by what appears to be automated testing: https://test.wikidata.org/wiki/Wikidata:Main_Page
https://test.wikidata.org/w/index.php?title=Q2432&action=history

This is causing an error on at least jobs 11 & 12
https://travis-ci.org/wikimedia/pywikibot-core/builds/134837554

Change 298713 had a related patch set uploaded (by Xqt):
[bugfix] Fix TestOwnClient.test_item_not_exists() test

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

Change 298452 had a related patch set uploaded (by John Vandenberg):
Revert "[bugfix] fix tests for wikidata"

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

The test class TestOwnClient exists only to confirm that a data repository also works as a client.
It was created when Wikibase first added the ability for a data repository to also be a client. Prior to that, a Wikibase site could not be a Wikibase client.
Now, Wikibase sites are always a Wikibase client, and this test class is almost unnecessary. TestOwnClient uses the two wikidata repositories to check that our code doesnt get confused between client and repository modes on the same server.

TestOwnClient.test_item_not_exists and .test_own_repository were added in 8816913e43 to fix this task, however that is not helpful and should be reverted.

test_own_repository adds explicit coverage of data_repository() and bool is_data_repository, which is good and it is reasonable to include it in this test class.

However, there are already tests for item not existing, and many other strange cases, in TestItemLoad. Specifically test_fromPage_invalid_title, test_fromPage_redirect, test_fromPage_missing and test_fromPage_noitem, and tests those scenarios in much greater detail.

Change 298713 abandoned by Xqt:
[bugfix] Fix TestOwnClient.test_item_not_exists() test

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

Change 298452 merged by jenkins-bot:
Revert "[bugfix] fix tests for wikidata"

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

Magul subscribed.

After creating item for Main Page on test.wikidata there nothing to be done here.

I'm closing it.