sglanzer-deprecated/ember-cli-blanket

Reports stopped working nothing is output running ember test

Closed this issue · 4 comments

My options file is here: https://github.com/pixelhandler/ember-jsonapi-resources/blob/master/tests/blanket-options.js

After I tag each release I run ember test then push the lcov.dat report up to code climate. my project is usually at 90-95% coverage, after I pushed it was at 27%. seems like it never finished writing the report.

So I deleted the lcov.dat file and ran ember test again but no file was written. I change the config from lcov to json but still no output, no coverage.json file written.

Its been working for me using the latest ember-cli 1.13.8 and node v4.0.0 / v0.12.2 ( I use nvm ).

Today the coverage report went missing so I tried switching back and forth between node versions and also ran my nombom to replace all the npm and bower modules. Still nothing.

I did add some tests since the last tag pixelhandler/ember-jsonapi-resources@0.6.3...0.6.4 So I checked out the last tag 0.6.3 and the report is generated. So it seems that something about the new tests may be messing with the report. The main difference in my new test is using sinon mock server in pervious tests I was not using that.

I'm able to recreate this with your repo - will try to dig in to figure out where breakage is (and improve diagnostics) - might be a few days :-(

@pixelhandler If i .skip pixelhandler/ember-jsonapi-resources@0.6.3...0.6.4#diff-e16d0508d82b53099bba5c4e58a82075R11 the lcov.dat is written.

I use sinon in my mocha test projects with no ill effects but haven't used the sandbox stuff.

It's possible that sandbox is mucking with the junit hooks - what I can tell is that when running 0.6.4 as is the POST with the coverage data is never being sent to the coverage middleware.

I think since i added a fake xhr in my test it blocks the request to write the report - so I can only mock specific requests, not all requests (allow /write-blanket-coverage to still work with XHR)

in start.js there is:

function sendCoverage() {
    $.ajax({
        type: 'POST',
        url:'/write-blanket-coverage',
        datatype: 'json',
        contentType:'application/json; charset=utf-8',
        data: JSON.stringify(window._$blanket_coverageData)
      });
}

I used a filter allow the reporting XHR post to work:

  beforeEach() {
    sandbox = window.sinon.sandbox.create();
    this.server = sandbox.useFakeServer();
    this.server.xhr.useFilters = true;
    // Filtered requests will not be faked
    this.server.xhr.addFilter( function( method, url ) {
      return url.match(/\/write-blanket-coverage/);
    });
    this.server.autoRespond = true;
  }

And that resolves my issue.

@jschilli forgot all about this convo. Thanks for helping :)