GithubHelp home page GithubHelp logo

Aggregated Log Output about karma-parallel HOT 10 OPEN

joeljeske avatar joeljeske commented on April 24, 2024 1
Aggregated Log Output

from karma-parallel.

Comments (10)

joeljeske avatar joeljeske commented on April 24, 2024

You are setting the option incorrectly. It should be a function or regex. Try this

aggregatedReporterTest: /coverage|brief|istanbul|junit/i

from karma-parallel.

eloisetaylor5693 avatar eloisetaylor5693 commented on April 24, 2024

That doesn't work either. I get this error:

  NaN pending  10 05 2019 14:13:31.289:ERROR [karma-server]: TypeError: Cannot read property 'toString' of undefined
    at padNumber (C:\git\angularWebApp\node_modules\karma-brief-reporter\lib\util\printers.js:7:21)
    at printStats (C:\git\angularWebApp\node_modules\karma-brief-reporter\lib\util\printers.js:13:19)
    at Object.exports.printProgress (C:\git\angularWebApp\node_modules\karma-brief-reporter\lib\util\printers.js:28:3)
    at Brief.onSpecComplete (C:\git\angularWebApp\node_modules\karma-brief-reporter\lib\brief.js:45:16)
    at reporters.forEach (C:\git\angularWebApp\node_modules\karma-parallel\lib\reporter.js:61:26)
    at Array.forEach (<anonymous>)
    at AggregatedCoverageReporter._.rest (C:\git\angularWebApp\node_modules\karma-parallel\lib\reporter.js:58:15)
    at apply (C:\git\angularWebApp\node_modules\lodash\lodash.js:475:27)
    at C:\git\angularWebApp\node_modules\lodash\lodash.js:6569:16
    at AggregatedCoverageReporter.onSpecComplete (C:\git\angularWebApp\node_modules\karma-parallel\lib\reporter.js:121:7)
    at Server.<anonymous> (C:\git\angularWebApp\node_modules\karma\lib\events.js:40:26)
    at Server.emit (events.js:194:15)
    at Browser.onResult (C:\git\angularWebApp\node_modules\karma\lib\browser.js:164:20)
    at Socket.socket.on (C:\git\angularWebApp\node_modules\karma\lib\browser.js:214:42)
    at Socket.emit (events.js:189:13)
    at C:\git\angularWebApp\node_modules\socket.io\lib\socket.js:528:12
Cannot read property 'success' of undefined
TypeError: Cannot read property 'success' of undefined
    at TestCommand.runSingleTarget (C:\git\angularWebApp\node_modules\@angular\cli\models\packages\angular\cli\models\architect-command.ts:242:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test-fast: `ng test --sourceMap=false --karmaConfig=src/karma.conf.fast.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test-fast script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

from karma-parallel.

eloisetaylor5693 avatar eloisetaylor5693 commented on April 24, 2024

Any other suggestions on how to resolve?

from karma-parallel.

bhativikas avatar bhativikas commented on April 24, 2024

Hi Joel,
I am also looking for help to get the code coverage (aggregated one) using karma-parallel. Kindly share sample karma.conf.js. Thanks in advance!!

from karma-parallel.

jo-soft avatar jo-soft commented on April 24, 2024

We had similar issues using istanbul reporter. I got it working by adjusting lib/reporter.js:

--- a/lib/reporter.js
+++ b/lib/reporter.js
@@ -106,11 +106,8 @@ const AggregatedCoverageReporter = function(injector, logger, config, baseReport
 
     delete aggregate.alias.lastResult._realLastResults[browser.id];
     aggregate.real[browser.id] = UNSTARTED;
-
-    // Call through on the very first browser start
-    if (getStartedBrowserCount(aggregate) === 1) {
-      callThrough('onBrowserStart', aggregate.alias);
-    }
+     
+    callThrough('onBrowserStart', aggregate.alias);
   };
    this.onSpecComplete = function (browser, result) {

would be nice if anybody could explain me the reason for the if-condition.

from karma-parallel.

MikeDabrowski avatar MikeDabrowski commented on April 24, 2024

I ended up adding this getters to the AggegatedBrowserLastResult. No need to comment out the if below. I wonder how best to proceed with the changes.

  get success() {
    return _.sum(
      _.map(this._realLastResults, 'success')
    )
  }
  get skipped() {
    return _.sum(
      _.map(this._realLastResults, 'skipped')
    )
  }

@jo-soft How did you override the lib inside of your project ?

from karma-parallel.

jo-soft avatar jo-soft commented on April 24, 2024

@MikeDabrowski basically creating a local fork and adjusting it (after testing it by adjusting local node_modules). but it look like you figured out something

from karma-parallel.

MikeDabrowski avatar MikeDabrowski commented on April 24, 2024

from karma-parallel.

jo-soft avatar jo-soft commented on April 24, 2024

it's easy to avoid lodash:

get success() {
    return _.sum(
      _realLastResults.map( result => result.success )
    )
  }
  get skipped() {
    return _.sum(
      _realLastResults.map( result => result.skipped )
    )
  }

from karma-parallel.

MikeDabrowski avatar MikeDabrowski commented on April 24, 2024

it's easy to avoid lodash

in some places, yes.

get total() {
  return R.sum(Object.values(this._realLastResults).map(R.prop('total')));
}
get failed() {
  return R.sum(Object.values(this._realLastResults).map(R.prop('failed')));
}
get success() {
  return R.sum(Object.values(this._realLastResults).map(R.prop('success')));
}
get skipped() {
  return R.sum(Object.values(this._realLastResults).map(R.prop('skipped')));
}
get netTime() {
  return R.apply(
    Math.max,
    Object.values(this._realLastResults).map(R.prop('netTime')),
  );
}

But there is this piece for example:

const callThrough = _.rest((fnName, args) => {
  reporters.forEach(({name, reporter}) => {
    if (_.isFunction(reporter[fnName])) {
      log.debug(`relaying ${fnName}() on reporter:${name}`);
      reporter[fnName].apply(reporter, args);
    }
  });
});

I am sure it is possible to use ramda / native-js for this but I just did not want to invest more time in it.

Lodash's functions that are still used: rest, chain, size, extendWith, isFunction, map

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.