Last modified: 2014-05-07 19:23:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58057, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56057 - Tests should not rely on the existence of specific pages (be wiki agnostic)
Tests should not rely on the existence of specific pages (be wiki agnostic)
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Quality Assurance (Other open bugs)
wmf-deployment
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 58939
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-23 18:04 UTC by Jon
Modified: 2014-05-07 19:23 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jon 2013-10-23 18:04:46 UTC
On MobileFrontend there is a newly added test that expects the Barack Obama article to be setup in a certain way.

It fails on mine as my Barack Obama doesn't have an external links directory.
Ideally I would like to see QA tests setup pages e.g. QA_TestPage1, QA_TestPage2 (or maybe a QA namespace might make sense here) for the purpose of the test or at least be customisable to point to different pages..

Feature: Validate External Links

  Scenario: External Links resolve                       # features/external_links.feature:3
    Given I am on the Barack_Obama article               # features/step_definitions/external_links_steps.rb:1
    When I expand External Links Section                 # features/step_definitions/external_links_steps.rb:5
      timed out after 5 seconds, waiting for {:id=>"External_links", :tag_name=>"span"} to become present (Watir::Wait::TimeoutError)
      ./features/step_definitions/external_links_steps.rb:6:in `/^I expand External Links Section$/'
      features/external_links.feature:5:in `When I expand External Links Section'
    And I click on the White House official website link # features/step_definitions/external_links_steps.rb:9
    Then I receive White House official website page     # features/step_definitions/external_links_steps.rb:13
Comment 1 Chris McMahon 2013-10-23 20:05:14 UTC
This is by design. 


Browser tests in the public repo are intended to use the beta cluster, test2wiki, and/or production as targets, and we are in a position to manage the contents of those test environments.  We put this in place from the very beginning to a) avoid the "works on my machine" problems b) keep the setup/teardown overhead to a minimum and c) run the tests in a complex environment that approximates production as closely as possible. 

We have a few tests that create new pages where it makes sense to test creating new pages. There is no reasonable mechanism by which to delete pages in Mediawiki. 

So, if you want a suite of tests to run against a local Mediawiki environment, you could do a number of things: 

* maintain a branch of tests that do not depend on particular test data being in place
* at runtime, swap out the existing foo_page.rb files for similar files that point to the URL of your choice, override the browser.url variable, or otherwise alter the existing value for e.g. Barack_Obama
* maintain a minimal set of test data in your local env for the tests to pass without alteration
Comment 2 Željko Filipin 2013-10-24 11:15:40 UTC
I agree that each test should make sure everything it needs exists and create users, pages, files (...) if they already do not exist.

If deleting pages is hard, that is a separate problem that should be fixed.
Comment 3 Željko Filipin 2014-01-28 12:55:57 UTC
Duplicate of bug #60347?
Comment 4 Gerrit Notification Bot 2014-04-09 21:19:33 UTC
Change 125008 had a related patch set uploaded by Jdlrobson:
QA: WIP Make the test environment agnostic of existing pages

https://gerrit.wikimedia.org/r/125008
Comment 5 Gerrit Notification Bot 2014-04-14 20:13:18 UTC
Change 125857 had a related patch set uploaded by Jdlrobson:
QA: Make the test environment agnostic of existing pages #2

https://gerrit.wikimedia.org/r/125857
Comment 6 Gerrit Notification Bot 2014-04-14 20:13:23 UTC
Change 125859 had a related patch set uploaded by Jdlrobson:
QA: Remove dependency on Duel Masters article

https://gerrit.wikimedia.org/r/125859
Comment 7 Gerrit Notification Bot 2014-04-14 20:13:28 UTC
Change 125861 had a related patch set uploaded by Jdlrobson:
QA: Remove dependency on "Foo bar" article

https://gerrit.wikimedia.org/r/125861
Comment 8 Gerrit Notification Bot 2014-04-14 20:13:33 UTC
Change 125864 had a related patch set uploaded by Jdlrobson:
QA: Remove dependency on Barack Obama article

https://gerrit.wikimedia.org/r/125864
Comment 9 Gerrit Notification Bot 2014-04-15 17:49:20 UTC
Change 125008 merged by jenkins-bot:
QA: Remove dependency on San Francisco article

https://gerrit.wikimedia.org/r/125008
Comment 10 Gerrit Notification Bot 2014-04-15 19:34:46 UTC
Change 125857 merged by jenkins-bot:
QA: Make the test environment agnostic of existing pages #2

https://gerrit.wikimedia.org/r/125857
Comment 11 Gerrit Notification Bot 2014-04-15 19:35:23 UTC
Change 125859 merged by jenkins-bot:
QA: Remove dependency on Duel Masters article

https://gerrit.wikimedia.org/r/125859
Comment 12 Gerrit Notification Bot 2014-04-15 21:40:47 UTC
Change 125861 merged by jenkins-bot:
QA: Remove dependency on "Foo bar" article

https://gerrit.wikimedia.org/r/125861
Comment 13 Jon 2014-05-07 17:40:08 UTC
Can someone review https://gerrit.wikimedia.org/r/125864 - getting it merged will resolve this bug as it will mean MobileFrontend has no page specific code.
Comment 14 Gerrit Notification Bot 2014-05-07 17:54:49 UTC
Change 125864 merged by jenkins-bot:
QA: Remove dependency on Barack Obama article

https://gerrit.wikimedia.org/r/125864
Comment 15 Jon 2014-05-07 19:23:13 UTC
Win.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links