GithubHelp home page GithubHelp logo

Comments (8)

ben8p avatar ben8p commented on April 25, 2024

same here...

from karma-parallel.

ben8p avatar ben8p commented on April 25, 2024

After adding some debug info, I see the following flow:

onRunStart
onBrowserStart
onBrowserStart
onBrowserStart
onBrowserStart
onBrowserStart
onBrowserStart
onRunStart
Reporter :  undefined total   undefined passed   undefined failed   undefined skipped
onRunComplete
onBrowserStart
onBrowserStart
onBrowserStart
onBrowserStart
onBrowserStart
onBrowserStart

from karma-parallel.

joeljeske avatar joeljeske commented on April 25, 2024

@ben8p Thanks for the contribution!

I'm trying to understand karma's lifecycle a bit better. Perhaps I am missing something or perhaps karma is a little inconsistent with itself: It appears this is the lifecycle of events for a karma reporter

x = number of browsers
y = number of tests

  1. 1 onRunStart (this is where I initialize that object)
  2. x onBrowserStart
  3. y onSpecComplete
  4. x onBrowserComplete
  5. 1 onRunComplete (this is where I clear that object)

If watching / using TDD, I would expect that if I change a file, I would start over at onRunStart, not starting with onBrowserStart. But if your fix does indeed fix this issue, then perhaps karma is not very consistent by not calling onRunStart for sequential runs.

What do you think?

from karma-parallel.

ben8p avatar ben8p commented on April 25, 2024

Well,
I have the feeling it has to do with a file changed between step 1 and step 2.
When I look at Nyan cat reporter I see it restart multiple times (and all aborted instance are saying "undefined" instead of the number of tests.
There's probably a sort of life cycle optimization built in karma...
As far as I tested the fix has not side effects...

from karma-parallel.

ben8p avatar ben8p commented on April 25, 2024

@joeljeske will you consider merging the PR ? Do you need more inputs ?

from karma-parallel.

abeymg avatar abeymg commented on April 25, 2024

I am running into this issue as well. @joeljeske Can this PR be merged (assuming it fixes the issue) ?

from karma-parallel.

ben8p avatar ben8p commented on April 25, 2024

@abeymg maybe you can try the modified code locally and confirm it also fixes the issue you're having?
It is only one single line to change.

from karma-parallel.

abeymg avatar abeymg commented on April 25, 2024

@joeljeske @ben8p I did that and can confirm that it fixed the issue for me.

from karma-parallel.

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.