Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/368520 )
Change subject: Fix broken tests (do not skip) ...................................................................... Fix broken tests (do not skip) Skipping should only be used as a short term measure. It's an anti-pattern - if tests are broken they should be either fixed promptly or removed. They may be masking real bugs that deserve debugging attention. Since articles are living breathing documents these integration tests should be run against the revisions they were written against where possible. This updates all queries to pass a known safe revision to test against where this fixes the problem "Page with IPA content" test is broken due to a change in the underlying content. Let's fix that. Where a test is being skipped because of an upstream problem mark it with the bug number. Change-Id: I6afd85f0f82df7d40ea7f84d0fa49a4fb6f3f94e --- M test/features/mobile-sections-lead/pagecontent.js M test/features/mobile-sections/pagecontent-v2.js M test/features/mobile-sections/pagecontent.js 3 files changed, 21 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/20/368520/1 diff --git a/test/features/mobile-sections-lead/pagecontent.js b/test/features/mobile-sections-lead/pagecontent.js index 95a612f..f0a1f9d 100644 --- a/test/features/mobile-sections-lead/pagecontent.js +++ b/test/features/mobile-sections-lead/pagecontent.js @@ -5,6 +5,9 @@ const server = require('../../utils/server.js'); const headers = require('../../utils/headers.js'); +const wikivoyageSectionsLead = 'en.wikivoyage.org/v1/page/mobile-sections-lead/'; +const wikiSectionsLead = 'en.wikipedia.org/v1/page/mobile-sections-lead/'; + describe('mobile-sections-lead', function() { this.timeout(20000); // eslint-disable-line no-invalid-this @@ -118,9 +121,9 @@ assert.deepEqual(lead.geo.longitude, 28.883055555556); }); }); - // TODO: FIX OR REMOVE - it.skip('Wikivoyage en Paris should have a lead object with a geo property', () => { - const uri = `${server.config.uri}en.wikivoyage.org/v1/page/mobile-sections-lead/Paris`; + it('Wikivoyage en Paris should have a lead object with a geo property', () => { + const rev = 3092864; + const uri = `${server.config.uri}${wikivoyageSectionsLead}Paris/${rev}`; return preq.get({ uri }) .then((res) => { const lead = res.body; @@ -136,6 +139,7 @@ assert.ok(!{}.hasOwnProperty.call(lead, 'geo')); }); }); + // T170325 it.skip('Barack Obama should have a pronunciation', () => { const title = 'Barack_Obama'; const uri = `${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/${title}`; @@ -156,6 +160,7 @@ 'The infobox has not been removed for backwards compatibility.'); }); }); + // T170325 it.skip('Enwiki Uranus loads successfully (no pronunciation parsing TypeErrors)', () => { const uri = `${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/Uranus`; const exp = '//upload.wikimedia.org/wikipedia/commons/1/1c/En-us-Uranus.ogg'; @@ -166,6 +171,7 @@ assert.deepEqual(lead.pronunciation.url, exp); }); }); + // T170325 it.skip('Enwiki Odisha loads successfully (no pronunciation parsing TypeErrors)', () => { const uri = `${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/Odisha`; const path = `//upload.wikimedia.org/wikipedia/commons/c/c2`; @@ -177,6 +183,7 @@ assert.deepEqual(lead.pronunciation.url, exp); }); }); + // T170325 it.skip('Enwiki Yazidis loads successfully (no pronunciation parsing TypeErrors)', () => { const uri = `${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/Yazidis`; const path = `//upload.wikimedia.org/wikipedia/commons/8/8d`; @@ -208,9 +215,9 @@ Actual text ${res.body.sections[0].text}`); }); }); - it.skip('Enwiki hatnotes are promoted to the lead object', () => { + it('Enwiki hatnotes are promoted to the lead object', () => { const title = `Chivalric%20order`; - const uri = `${server.config.uri}en.wikipedia.org/v1/page/mobile-sections-lead/${title}`; + const uri = `${server.config.uri}${wikiSectionsLead}${title}/699553745`; const anchor = `<a href="/wiki/Military_order_(society)" title="Military order (society)">`; return preq.get({ uri }) .then((res) => { diff --git a/test/features/mobile-sections/pagecontent-v2.js b/test/features/mobile-sections/pagecontent-v2.js index 5194690..0fbcb63 100644 --- a/test/features/mobile-sections/pagecontent-v2.js +++ b/test/features/mobile-sections/pagecontent-v2.js @@ -41,8 +41,9 @@ }); }); - it.skip('Hatnotes do not appear in the lead object', () => { - const uri = `${server.config.uri}en.wikipedia.org/v1/page/formatted/Chivalric%20order`; + it('Hatnotes do not appear in the lead object', () => { + const title = 'Chivalric%20order/699553745'; + const uri = `${server.config.uri}en.wikipedia.org/v1/page/formatted/${title}`; const anchor = '<a href="/wiki/Military_order_(society)" title="Military order (society)">'; return preq.get({ uri }) .then((res) => { @@ -133,12 +134,13 @@ }); }); - it.skip('Page with IPA content', () => { - const uri = `${server.config.uri}en.wikipedia.org/v1/page/formatted/Sunderland_A.F.C.`; + it('Page with IPA content', () => { + const title = 'Sunderland_A.F.C./738562635'; + const uri = `${server.config.uri}en.wikipedia.org/v1/page/formatted/${title}`; return preq.get({ uri }) .then((res) => { const text = res.body.lead.intro; - const regex = /<span class="nowrap mcs-ipa"><span class="noexcerpt">/; + const regex = /<span class="nowrap mcs-ipa"><span class="IPA nopopups noexcerpt">/; assert.ok(regex.test(text), res.body.lead.intro); }); }); diff --git a/test/features/mobile-sections/pagecontent.js b/test/features/mobile-sections/pagecontent.js index 933a8c9..acc43c0 100644 --- a/test/features/mobile-sections/pagecontent.js +++ b/test/features/mobile-sections/pagecontent.js @@ -333,8 +333,8 @@ }); }); - it.skip('Page with IPA content', () => { - const title = 'Sunderland_A.F.C.'; + it('Page with IPA content', () => { + const title = 'Sunderland_A.F.C./738562635'; const uri = `${server.config.uri}en.wikipedia.org/v1/page/mobile-sections/${title}`; return preq.get({ uri }) .then((res) => { -- To view, visit https://gerrit.wikimedia.org/r/368520 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6afd85f0f82df7d40ea7f84d0fa49a4fb6f3f94e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits