Page MenuHomePhabricator

[Bug] Code coverage doesn't generate a report
Closed, ResolvedPublic

Description

Steps to Reproduce

$ npm run coverage

> @ coverage /home/stephen/Code/wmf/vagrant/mediawiki/extensions/Popups
> istanbul cover node_modules/.bin/mw-node-qunit tests/node-qunit/*.js tests/node-qunit/**/*.js

TAP version 13
ok 1 title#getTitle > it should return the title of a url with a title query param
ok 2 title#getTitle > it should return the title of a pretty url if it conforms wgArticlePath
ok 3 title#getTitle > it should return the title of a pretty url properly decoded
ok 4 title#getTitle > it should skip urls that mw.Uri cannot parse
ok 5 title#getTitle > it should skip urls that are external
ok 6 title#getTitle > it should skip urls not on article path without one title query param
ok 7 title#isValid > it should return null if the title is empty
ok 8 title#isValid > it should return null if the title can't be parsed properly
ok 9 title#isValid > it should return null if the title can't be parsed properly
ok 10 title#isValid > it should return null if the title is not from a content namespace
ok 11 title#isValid > it should return the title object if the title is from a content namespace
ok 12 ext.popups#renderer > createPointerMasks
ok 13 ext.popups#renderer > createPagePreview
ok 14 ext.popups#renderer > createEmptyPreview(model)
ok 15 ext.popups#renderer > createEmptyPreview(null model)
ok 16 ext.popups#renderer > createDisambiguationPreview(model)
ok 17 ext.popups#renderer > bindBehavior - preview dwell
ok 18 ext.popups#renderer > bindBehavior - preview abandon
ok 19 ext.popups#renderer > bindBehavior - preview click
ok 20 ext.popups#renderer > bindBehavior - settings link click
ok 21 ext.popups#renderer > bindBehavior - settings link URL
ok 22 ext.popups#renderer > show
ok 23 ext.popups#renderer > hide - fade out up
ok 24 ext.popups#renderer > hide - fade out down
ok 25 ext.popups#renderer > #createLayout - portrait preview, mouse event, link is on the top left of the page
ok 26 ext.popups#renderer > #createLayout - tall preview, mouse event, link is on the bottom center of the page
ok 27 ext.popups#renderer > #createLayout - empty preview, keyboard event, link is on the center right of the page
ok 28 ext.popups#renderer > #getClasses when no thumbnail is available
ok 29 ext.popups#renderer > #getClasses when a non-tall thumbnail is available
ok 30 ext.popups#renderer > #getClasses when a tall thumbnail is available
ok 31 ext.popups#renderer > #layoutPreview - no thumbnail
ok 32 ext.popups#renderer > #layoutPreview - tall preview, flipped X, has thumbnail
ok 33 ext.popups#renderer > #layoutPreview - portrait preview, flipped X, has thumbnail, small height
ok 34 ext.popups#renderer > #layoutPreview - portrait preview, flipped X, has thumbnail, big height
ok 35 ext.popups#renderer > #layoutPreview - tall preview, has thumbnail, flipped Y
ok 36 ext.popups#renderer > #layoutPreview - tall preview, has thumbnail, flipped X and Y
ok 37 ext.popups#renderer > #layoutPreview - portrait preview, has thumbnail, flipped X and Y
ok 38 ext.popups#renderer > #setThumbnailClipPath
ok 39 ext.popups#renderer > #getThumbnailClipPathID
ok 40 ext.popups#renderer > getClosestYPosition
ok 41 ext.popups/settingsDialogRenderer > #render
ok 42 ext.popups#thumbnail > createThumbnail - tall image
ok 43 ext.popups#thumbnail > createThumbnail - tall image element
ok 44 ext.popups#thumbnail > createThumbnail - landscape image
ok 45 ext.popups#thumbnail > createThumbnail - landscape image element
ok 46 ext.popups#thumbnail > createThumbnail - no raw thumbnail
ok 47 ext.popups#thumbnail > createThumbnail - small wide image
ok 48 ext.popups#thumbnail > createThumbnail - small tall image
ok 49 ext.popups#thumbnail > createThumbnail - insecure URL
ok 50 ext.popups#thumbnail > createThumbnailElement
ok 51 ext.popups/userSettings > #getIsEnabled should return false if Page Previews have been disabled
ok 52 ext.popups/userSettings > #hasIsEnabled
ok 53 ext.popups/userSettings > #getPreviewCount should return the count as a number
ok 54 ext.popups/userSettings > #setPreviewCount should store the count as a string
ok 55 ext.popups/userSettings > #getPreviewCount should override value in storage when is not a number
ok 56 ext.popups/wait > it should resolve after waiting
1..56
# pass 56
# skip 0
# todo 0
# fail 0
No coverage information was collected, exit without writing coverage information

Expected Results

  • A coverage report is generated in coverage/

Actual Results

  • No report is generated

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 1 2018, 6:21 PM

Looking into this, this might be related to es6 imports (https://github.com/gotwarlost/istanbul/issues/262)
Upgrading to the unstable 1.1.0-alpha.1 doesn't help things though.

https://github.com/jmcriffey/babel-istanbul doesn't work either.

I'm not too familiar with Istanbul, so could really do with some help understanding this!

Istanbul has moved to the istanbuljs org and the CLI program is called nyc now: https://github.com/istanbuljs/nyc

Regardless we should probably update and move to the updated tools instead of staying with the old ones.

We also moved to the official qunit package in node, so that may be causing problems. First thing to check would be if istanbul works well with qunit itself. They mention that nyc does work well with qunit (https://github.com/qunitjs/qunit/issues/1131) but maybe the problem would just be fixed by upgrading the versions.

Jdlrobson changed the task status from Open to Stalled.

This needs a spike ^

Change 440904 had a related patch set uploaded (by Niedzielski; owner: Stephen Niedzielski):
[mediawiki/extensions/Popups@master] Fix: code coverage

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

Change 440904 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] Fix: code coverage

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

Jdlrobson changed the task status from Stalled to Open.Jun 19 2018, 11:26 PM
Jdlrobson claimed this task.

To me for sign off.

Just tested the new code coverage tool, and the report works.
Signing off.

Jdrewniak closed this task as Resolved.Jun 26 2018, 7:35 PM
Vvjjkkii renamed this task from [Bug] Code coverage doesn't generate a report to svdaaaaaaa.Jul 1 2018, 1:12 AM
Vvjjkkii removed Jdlrobson as the assignee of this task.
Vvjjkkii reopened this task as Open.
Vvjjkkii raised the priority of this task from Normal to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot lowered the priority of this task from High to Normal.
CommunityTechBot closed this task as Resolved.
CommunityTechBot claimed this task.
CommunityTechBot reassigned this task from CommunityTechBot to Jdlrobson.
CommunityTechBot renamed this task from svdaaaaaaa to [Bug] Code coverage doesn't generate a report.
CommunityTechBot added subscribers: gerritbot, Aklapper.
CommunityTechBot added a subscriber: CommunityTechBot.