Closed Bug 1606960 Opened 5 years ago Closed 5 years ago

Use same API in code-coverage testing function as the browser version

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

The shell testing function works without relying on finalizers by manually calling some of the coverage mechanisms. Currently this results in the information being sampled at a different time in shell than in ccov browser tasks.

This bug is about replacing logic of LCovRealm::collectCodeCoverageInfo with a call to CollectScriptCoverage instead. This would rely on the data that was captured in InitScriptCoverage which lets us write shell tests to better model the behaviour we actually care about.

Deprecate collecting coverage info onto LCovRealm without IsLCovEnabled being
set. This patch adds annotations to tests that need it. A subsequent patch
will remove the mode this tests relied on and they will instead test the same
pathways we use for browser ccov tasks.

This changes the implementation of getLCovInfo to use CollectScriptCoverage.
This uses the filename/funname information that was captured when the script
was created. This is what the browser ccov tasks use and this change allows
our tests to better test that mode.

Depends on D58667

I ended up disallowing using getLCovInfo if coverage isn't enable for process and added the --code-coverage attribute to the appropriate jit-tests. Removing this mode simplifies a lot of things and instead runs the tests using the same InitScriptCoverage/CollectScriptCoverage API that ccov browser builds use.

Also remove the test blacklist from jit_test.py and use 'skip-if' directives
in the relevant tests instead.

Attachment #9118618 - Attachment description: Bug 1606960 - Only allow getLCovInfo when LCov is enabled for process. → Bug 1606960 - Only allow getLCovInfo when LCov is enabled for process. r?nbp
Attachment #9118619 - Attachment description: Bug 1606960 - Use CollectScriptCoverage for getLCovInfo. → Bug 1606960 - Use CollectScriptCoverage for getLCovInfo. r?nbp
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/09a694a296b9 Add isLcovEnabled() shell function. r=nbp https://hg.mozilla.org/integration/autoland/rev/ae08965e8ee9 Only allow getLCovInfo when LCov is enabled for process. r=nbp https://hg.mozilla.org/integration/autoland/rev/3184b2da2c3c Use CollectScriptCoverage for getLCovInfo. r=nbp
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: