Coder Social home page Coder Social logo

codecoverage_presenter's People

Contributors

chinhodado avatar gmierz avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

codecoverage_presenter's Issues

hide or fade out test related files from all queries

in a query we show a nice list of files, but the test related files are not that useful for most people.

We can hide or show at the bottom (or even strikethrough/color) these type of files:
resource://testing-common
chrome://mochikit
chrome://mochitests
chrome://specialpowers

ideally each file that is displayed in the UI as part of a query would have a tag associated with it- all of the above ones should have a 'test file' tag and we can make the UI match what we want.

Use $.ajax ?

ActiveData is agnostic about the client libraries you use. Your code can completely liberate itself from the modevlib library by using $.ajax() (which uses callbacks), like so...

    var search = function(query, callback){
        $.ajax({
            url: "https://activedata.allizom.org/query",
            data: JSON.stringify(query),
            success: callback
        });
    };

figure out why unique source files sometimes is only the test file - ignore those if possible

here is a case where we only seem to have a unique source file of itself:
http://chinhodado.github.io/codecoverage_presenter/?buildRevision=232db2940e992fe4c998dbb0a498703fbf463e0d&query=2&select2=chrome%3A%2F%2Fmochitests%2Fcontent%2Fbrowser%2Faddon-sdk%2Ftest%2Fbrowser_sdk_loader_js_modules.js

in the test selection field if there is only lines covered from the test case itself (or I would argue any test related file), then we shouldn't show it.

The trick here is that we would need to run the query for all test files- this is the case to argue for adding more meta data into active data (post ingestion task)

Simplify function parameters

Changing the function parameter names will simplify the functions using those parameters:

function executeQuery1(param) {
    var test = param.test;
    var buildRevision = param.buildRevision;
    var query = {
        "limit": 10000,
        "where": {
            "eq":{
                "test.url": test,
                "build.revision": buildRevision
            }
        },
        "groupby": ["source.file"],
        "from": "coverage"
    };

can be changed to

function executeQuery1(eqParam) {
    var query = {
        "limit": 10000,
        "where": {
            "eq":eqParam
        },
        "groupby": ["source.file"],
        "from": "coverage"
    };

if your calls parameters are changed

executeQuery1({
    "test.url": test
    "build.revision": buildRevision
})

this allows you to add additional filters with no change to the called code:

executeQuery1({
    "test.url": test
    "build.revision": buildRevision,
    "build.platform": "linux64"
})

You could bring this a step further, and accept a whole where clause ias a parameter:

function executeQuery1(where) {
    var query = {
        "limit": 10000,
        "where": where,
        "groupby": ["source.file"],
        "from": "coverage"
    };

Your call is more complicated,

executeQuery1({"eq": {
    "test.url": test
    "build.revision": buildRevision,
}});

... but you have more sophisticated filtering options:

executeQuery1({"and":[
    {"gt":{"run.timestamp":{"date":"yesterday"}}},
    {"eq": {
        "test.url": test
        "build.revision": buildRevision,
    }}
]})

Add modevlib/threads/thread.js to HTML HEAD

If using thread.js, then it will be simpler to add it as a script to the HEAD of each *.html file:

<script type="application/javascript" src="modevlib/threads/thread.js"></script>

Remove instances of

importScript(['modevlib/main.js'], function () {

The modevlib library is a collection of smaller libraries for building charting dashboards. It copies the import.js[1] and thread.js[2] source code, which have their own documentation.

[1] https://github.com/klahnakoski/jsImport
[2] https://github.com/mozilla/jsThreads

Make test directory, show problem with ccov_api

A test directory, containing HTML pages, that verify features can help with debugging modules. Specifically, I could not find the entry point for ccov_api.js that revealed the problem Greg mentioned.

Please make a page that builds a JsonCcov object and attempts to make the problematic call. I can then debug the problem.

Given all known tests, what's the coverage % of a given file

I believe the canonical code coverage UI is to show the percentage of lines covered by testing. If it can be done for one, then it can be done for all files, all directories.

Let user select a file. Then, show all the code lines of that file, and highlight the lines covered.

test files names should be reduced

for example:
chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/xpinstall/browser_whitelist2.js

should be:
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist2.js

Sort or otherwise qualify results

For instance, if I go to http://chinhodado.github.io/codecoverage_presenter/?buildRevision=232db2940e992fe4c998dbb0a498703fbf463e0d&query=3&select2=resource%3A%2F%2Fgre%2Fmodules%2FUITelemetry.jsm I get a great compact list of tests that touch this file. This is really exciting, because I can figure out those are the tests to go to if I'm changing that file.

For many other queries, the list is far too large, for instance Permalink: http://chinhodado.github.io/codecoverage_presenter/?buildRevision=232db2940e992fe4c998dbb0a498703fbf463e0d&query=3&select2=resource%3A%2F%2Fgre%2Fmodules%2FRemoteAddonsParent.jsm

While all those tests probably touch some part of RemoteAddonsParent.jsm, I wonder whether we could "rate" the tests, by sorting, putting them into buckets, or even providing a column on the right that has the corresponding percentage coverage (i.e., this test covers X% of the file you asked about).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.