Git Product home page Git Product logo

Comments (9)

kategengler avatar kategengler commented on July 23, 2024

From some quick googling it looks like there are some utilities out there for Istanbul, which is the coverage utility that this addon uses.

To get combined coverage, you'll likely have to run an additional command on the results of each partition.

from ember-cli-code-coverage.

rwjblue avatar rwjblue commented on July 23, 2024

ya, that makes sense

We should track down the required commands / tools and figure out how to make them play nicely together. We have a few options there:

  • Make ember-cli-code-coverage detect ember-exam and do the right thing automatically
  • Make ember-exam detect ember-cli-code-coverage and do something...
  • Document in both the ember-exam and ember-cli-code-coverage README's what the solution is

/cc @trentmwillis for his thoughts/opinions

from ember-cli-code-coverage.

trentmwillis avatar trentmwillis commented on July 23, 2024

There is an open issue on ember-exam to explore this as well: ember-cli/ember-exam#18. There's not much there, but a conversation with @stefanpenner about that issue led to this RFC: ember-cli/rfcs#57.

It is definitely possible to coalesce multiple coverage reports together, but we want to make sure we find a good interface to support this across the board (including potential future code coverage solutions). As of right now, I don't have many more thoughts than that.

from ember-cli-code-coverage.

kategengler avatar kategengler commented on July 23, 2024

The trick is that each addon needs knowledge from the other. Ember-exam would need to know that coverage was being run and what to call to combine reports OR this addon would need to know that the test suite had been split and be configured to write coverage to different locations for each run.

An early plan that I think could work:

  • Add a command to ember-cli-code-coverage that combines several coverage reports
  • Document how to configure coverage to write to a different folder for each ember-exam run
  • Add a callback/hook to ember-exam to be able to call a command after the parallel runs with some info about the runs.
  • Document how to call the combine code coverage command from that hook. Bonus: Make a ember-cli-code-coverage-and-exam addon that does this configuration for the user.

from ember-cli-code-coverage.

trentmwillis avatar trentmwillis commented on July 23, 2024

I don't think this addon needs to know about ember-exam at all. Maybe I'm missing part of the picture, but I think it should be sufficient to just do the following:

  1. Expose an option to let ember-cli-code-coverage know there will be more than one coverage report.
  2. When POSTing to /write-coverage, include identifiable information in the payload, such as current test url and maybe browser UA.
  3. Given 1 and 2, have the middleware write each coverage report out to a separate location.
  4. On process exit, merge the multiple reports into a "final" report.

In my opinion, it could be sufficient to have 4 be a separate command that consumers run themselves (since it may be difficult to hook into the process "exit" event).


I also want to note that ember-exam doesn't really do anything special as far as the actual "test process" is concerned; it runs tests in parallel simply by configuring Testem and modifying TestLoader at runtime. This is why I don't think ember-exam should actually have any knowledge of this process, as it is really just sugar on configuration and doesn't do anything with the process output.

from ember-cli-code-coverage.

kategengler avatar kategengler commented on July 23, 2024

I had wild misconceptions about how ember-exam worked; your plan sounds doable.

from ember-cli-code-coverage.

jdenly avatar jdenly commented on July 23, 2024

I've just been working on this as part of trying to speed up our product build time, should have a PR soon for a merge-coverage command that creates a consolidated report - just needs a bit of clean up.

from ember-cli-code-coverage.

jdenly avatar jdenly commented on July 23, 2024

There is a PR available here:

#83

from ember-cli-code-coverage.

kategengler avatar kategengler commented on July 23, 2024

Should be solved by #83

from ember-cli-code-coverage.

Related Issues (20)

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.