Page MenuHomePhabricator

Tests failing on mobile-sections and mobile-sections-lead
Closed, ResolvedPublic

Description

  1. Checkout master
  2. npm test

Log here:

mobileapps (master %=) $ npm test

> service-mobileapp-node@0.2.0 test /Users/jkn/dev/wikimedia/mobileapps
> mocha



  express app
server options changed; restarting
    ✓ should get robots.txt (43ms)
    ✓ should set CORS headers
    ✓ should set CSP headers
    - should get static content gzipped
    ✓ should get static content uncompressed

  Swagger spec
    ✓ get the spec
    ✓ spec validation
    routes
      ✓ spec from root
      ✓ retrieve service info
      ✓ retrieve images and videos of en.wp Cat page via media route (2456ms)
      ✓ retrieve en-wiktionary definitions for 'cat' (1017ms)
      ✓ retrieve en.wp main page via mobile-sections (723ms)
      ✓ retrieve lead section of en.wp main page via mobile-sections-lead (755ms)
      ✓ retrieve lead section of en.wp San Francisco page via mobile-sections-lead (1296ms)
      ✓ retrieve lead section of en.wp Barack Obama page via mobile-sections-lead (1719ms)
      ✓ retrieve remaining sections of en.wp main page via mobile-sections-remaining (453ms)
      ✓ retrieve page preview of Dog page (972ms)
      ✓ retrieve the lite en.wp main page (355ms)

  definition
    ✓ should respond to GET request with expected headers, incl. CORS and CSP headers (908ms)
    ✓ en 'cat' request should have expected structure and content (940ms)
    ✓ missing definitions (576ms)
    ✓ non-term page (362ms)
    ✓ unsupported language
    ✓ non-English term on English Wiktionary returns valid results (788ms)
    ✓ translingual term (1090ms)

  service information
    ✓ should get the service name
    ✓ should get the service version
    ✓ should redirect to the service home page
    ✓ should get the service info

  media
    ✓ should respond to GET request with expected headers, incl. CORS and CSP headers (1027ms)
    ✓ return the sent ETag (555ms)
    ✓ Sections/deep page should have no media items (366ms)
    ✓ en Main page should have at least one image (759ms)
    ✓ Obama (redirect) should have a lead image, expected properties, and many media items (1447ms)
    ✓ Missing title should respond with 404 (846ms)

  mobile-sections
    ✓ should respond to GET request with expected headers, incl. CORS and CSP headers (406ms)
    ✓ return the sent ETag (411ms)
    1) Sections/deep page should have a lead object with expected properties
    ✓ en Main page should have a lead object with expected properties (774ms)
    ✓ Missing title should respond with 404 (336ms)
    ✓ Page with known past 'text-decoration' error should load successfully (617ms)
    ✓ Beta cluster request should load successfully (1206ms)
    ✓ Page with irregular Spoken Wikipedia template usage should load correctly (515ms)
    ✓ Page with HTML entity in redirected page title should load (358ms)
    ✓ Page with % in redirected page title should load (423ms)
    ✓ Page with % in redirected page title should load 2 (357ms)
    ✓ Page with % in section header of redirected page title should load (379ms)

  mobile-sections-lead
    ✓ should respond to GET request with expected headers, incl. CORS and CSP headers (771ms)
    2) Sections/deep page should have a lead object with expected properties
    ✓ en Cat page should have a lead object with expected properties (1671ms)
    ✓ en San Francisco should have a lead object with a geo property (1294ms)
    ✓ Barack Obama should have a pronunciation (1606ms)
    ✓ Enwiki Uranus loads successfully (no pronunciation parsing TypeErrors) (978ms)
    ✓ Enwiki Odisha loads successfully (no pronunciation parsing TypeErrors) (953ms)
    ✓ Enwiki Lead_paragraph_move has the infobox moved after the lead paragraph (346ms)

  pickPronunciationFilePageUrl
    ✓ spaces in title should not effect choice
    ✓ subset of filename should not effect choice

  mobile-sections-remaining
    ✓ should respond to GET request with expected headers, incl. CORS and CSP headers (379ms)

  mobile-summary
    ✓ should respond to GET request with expected headers, incl. CORS and CSP headers (365ms)
    ✓ Page should have expected properties (463ms)

  mobile-text
    ✓ should respond to GET request with expected headers, incl. CORS and CSP headers (320ms)
    ✓ should have the right meta fields in the JSON response (526ms)
    ✓ should have the right structure of section objects (511ms)
    ✓ should have the right structure of paragraph, image, and video objects (555ms)

  jshint
    ✓ should pass for working directory (687ms)

  lib:anchorencode
    ✓ anchorencode(empty) should return an empty string
    ✓ anchorencode("a") should return a
    ✓ anchorencode("Z") should return Z
    ✓ anchorencode("  Z  ") should return Z
    ✓ anchorencode("a b c") should return a_b_c
    ✓ anchorencode("a  b  c") should return a_b_c
    ✓ anchorencode("!@#$%^&*()") should return 21.40.23.24.25.5E.26.2A.28.29
    ✓ anchorencode(":") should not be converted

  lib:mwapi:image
    ✓ buildLeadImageUrls("a") should return all "a"s
    ✓ buildLeadImageUrls with size 1024px
    ✓ buildLeadImageUrls with size 555px should return size 320 for 320 and then 555 for rest
    ✓ buildLeadImageUrls with size 750px should return size 320, 640, and then 750 for rest
    ✓ buildLeadImageUrls with size 200px should return size 200 for all URLs

  lib:parsoid
    ✓ getSectionsText(empty) should produce an empty lead section
    ✓ getSectionsText() with just text should produce a lead section
    ✓ getSectionsText() with one h2 should produce two sections
    ✓ getSectionsText() with one h2 and h3 should produce three sections

  lib:transforms
    ✓ rmBracketSpans should remove the spans around brackets
    ✓ rmElementsWithSelectors should remove the spans with display:none


  81 passing (38s)
  1 pending
  2 failing

  1) mobile-sections Sections/deep page should have a lead object with expected properties:

      AssertionError: Page should not be protected
      + expected - actual

      -false
      +true

      at Request.<anonymous> (test/features/mobile-sections/pagecontent.js:35:24)
      at Request.tryCatcher (node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (node_modules/bluebird/js/release/promise.js:502:31)
      at Promise._settlePromise (node_modules/bluebird/js/release/promise.js:559:18)
      at Promise._settlePromise0 (node_modules/bluebird/js/release/promise.js:604:10)
      at Promise._settlePromises (node_modules/bluebird/js/release/promise.js:683:18)
      at Promise._fulfill (node_modules/bluebird/js/release/promise.js:628:18)
      at Promise._resolveCallback (node_modules/bluebird/js/release/promise.js:423:57)
      at Promise._settlePromiseFromHandler (node_modules/bluebird/js/release/promise.js:514:17)
      at Promise._settlePromise (node_modules/bluebird/js/release/promise.js:559:18)
      at Promise._settlePromise0 (node_modules/bluebird/js/release/promise.js:604:10)
      at Promise._settlePromises (node_modules/bluebird/js/release/promise.js:683:18)
      at Promise._fulfill (node_modules/bluebird/js/release/promise.js:628:18)
      at Request._callback (node_modules/bluebird/js/release/nodeback.js:45:21)
      at Request.self.callback (node_modules/request/request.js:200:22)
      at Request.<anonymous> (node_modules/request/request.js:1067:10)
      at Gunzip.<anonymous> (node_modules/request/request.js:988:12)
      at endReadableNT (_stream_readable.js:926:12)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickCallback (internal/process/next_tick.js:98:9)

  2) mobile-sections-lead Sections/deep page should have a lead object with expected properties:

      AssertionError: Page should not be protected
      + expected - actual

      -false
      +true

      at Request.<anonymous> (test/features/mobile-sections-lead/pagecontent.js:24:24)
      at Request.tryCatcher (node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (node_modules/bluebird/js/release/promise.js:502:31)
      at Promise._settlePromise (node_modules/bluebird/js/release/promise.js:559:18)
      at Promise._settlePromise0 (node_modules/bluebird/js/release/promise.js:604:10)
      at Promise._settlePromises (node_modules/bluebird/js/release/promise.js:683:18)
      at Promise._fulfill (node_modules/bluebird/js/release/promise.js:628:18)
      at Promise._resolveCallback (node_modules/bluebird/js/release/promise.js:423:57)
      at Promise._settlePromiseFromHandler (node_modules/bluebird/js/release/promise.js:514:17)
      at Promise._settlePromise (node_modules/bluebird/js/release/promise.js:559:18)
      at Promise._settlePromise0 (node_modules/bluebird/js/release/promise.js:604:10)
      at Promise._settlePromises (node_modules/bluebird/js/release/promise.js:683:18)
      at Promise._fulfill (node_modules/bluebird/js/release/promise.js:628:18)
      at Request._callback (node_modules/bluebird/js/release/nodeback.js:45:21)
      at Request.self.callback (node_modules/request/request.js:200:22)
      at Request.<anonymous> (node_modules/request/request.js:1067:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:988:12)
      at endReadableNT (_stream_readable.js:926:12)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickCallback (internal/process/next_tick.js:98:9)



npm ERR! Test failed.  See above for more details.

Event Timeline

Change 289320 had a related patch set uploaded (by Jhernandez):
Fix tests to reflect updated page protection response format

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

Change 289320 merged by Mobrovac:
Fix tests to reflect updated page protection response format

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