Giter Site home page Giter Site logo

do we have any way to combine multiple test runs report into one report (when running test in parallel) about mochawesome-report-generator HOT 20 OPEN

adamgruber avatar adamgruber commented on May 25, 2024
do we have any way to combine multiple test runs report into one report (when running test in parallel)

from mochawesome-report-generator.

Comments (20)

mjhea0 avatar mjhea0 commented on May 25, 2024 7

I have mochawesome working here -> https://github.com/testdrivenio/cypress-mochawesome-s3

Essentially-

  1. cypress runs
  2. each spec generates a new report
  3. a custom script combines each mochawesome json file and calculates the stats
  4. html report is then generated

from mochawesome-report-generator.

fsmaia avatar fsmaia commented on May 25, 2024 2

Just inserting a suggestion here too: we could implement a [file] wildcard in reporterFilename to be replaced with current spec, then we would have predictable filenames at least.

I think the implementation is easy: just insert a regex replace from [file] to current report data filename in .getFilename(). We would need to send reportData parameter from .prepare(), to .getOptions() and then .getFilename().

If someone thinks this can be helpful, I can give it a try and open a PR if it works.

from mochawesome-report-generator.

izydorekjakub avatar izydorekjakub commented on May 25, 2024 2

I have mochawesome working here -> https://github.com/testdrivenio/cypress-mochawesome-s3

Essentially-

  1. cypress runs
  2. each spec generates a new report
  3. a custom script combines each mochawesome json file and calculates the stats
  4. html report is then generated

It solves all my problems @mjhea0

from mochawesome-report-generator.

stephenchan9 avatar stephenchan9 commented on May 25, 2024 1

I have mochawesome working here -> https://github.com/testdrivenio/cypress-mochawesome-s3

Essentially-

  1. cypress runs
  2. each spec generates a new report
  3. a custom script combines each mochawesome json file and calculates the stats
  4. html report is then generated

I am getting this issue when running tests that are in a "pending" state. Any possible fix for this? Great job on the code so far.

Invalid value "pending" supplied to /suites/suites/0/tests/0/state: TestState

from mochawesome-report-generator.

SeriousM avatar SeriousM commented on May 25, 2024

merge reports is the magic word. it's not supported as far as I know

from mochawesome-report-generator.

adamgruber avatar adamgruber commented on May 25, 2024

@SeriousM is correct. This is something that's been on my radar for a while and held up mostly by lack of time to work on it.

from mochawesome-report-generator.

SeriousM avatar SeriousM commented on May 25, 2024

It would be awesome to have it because cypress.io is now generating a single report for every spec (which are a lot) and how I end up with mochawesome_001.html to mochawesome_130.html

This is really bad and cypress.io team is not gonna fix it.
What data in the json file should be joined to generate a single report?

from mochawesome-report-generator.

adamgruber avatar adamgruber commented on May 25, 2024

I'm not really familiar with cypress.io and how it runs the tests. Seems strange that it generates one report for each spec. Is it running each in a separate process? If so I wonder if there's even a way at the reporter level to aggregate everything at the end. You may still need to post-process all the reports through the mochawesome-report-generator CLI.

Each report JSON should have a top level suite. These would need to be combined into one. But the overall stats would be off.

from mochawesome-report-generator.

SeriousM avatar SeriousM commented on May 25, 2024

Each report JSON should have a top level suite. These would need to be combined into one. But the overall stats would be off.

Can I just omit the overall stats then and just do something like this:

{
  "suites": {
    "suites": [
      ...<all tests here>...
    ]
  }
}

from mochawesome-report-generator.

SeriousM avatar SeriousM commented on May 25, 2024

ok, I can combine the json files as described. of course my stats are off (maybe I can calculate them later) but the report is ok.

mochawesome-report.zip

I noticed that missing json properties create validation errors. That's ok, but the latest version of mochawesome creates an incompatible json: Invalid value undefined supplied to /suites/suites/0/tests/0/timedOut: Boolean. Adding it let marge work again.

Btw: is there a documentation what all the json properties mean? "beforeHooks", "afterHooks", "pending", etc... when is what filled with and do I have to care?

from mochawesome-report-generator.

adamgruber avatar adamgruber commented on May 25, 2024

Most of the JSON properties come directly from mocha.

the latest version of mochawesome creates an incompatible json

Is this with cypress.io? Can you provide a repo to reproduce this? I put the validation in place to avoid bad data when generating the report but it has caused some headaches. I may need to revisit how the JSON is validated and consider loosening the requirements.

from mochawesome-report-generator.

SeriousM avatar SeriousM commented on May 25, 2024

from mochawesome-report-generator.

izydorekjakub avatar izydorekjakub commented on May 25, 2024

I noticed that missing json properties create validation errors. That's ok, but the latest version of mochawesome creates an incompatible json: Invalid value undefined supplied to /suites/suites/0/tests/0/timedOut: Boolean. Adding it let marge work again.

@SeriousM
Have you managed to solve this problem?

from mochawesome-report-generator.

izydorekjakub avatar izydorekjakub commented on May 25, 2024

I noticed that missing json properties create validation errors. That's ok, but the latest version of mochawesome creates an incompatible json: Invalid value undefined supplied to /suites/suites/0/tests/0/timedOut: Boolean. Adding it let marge work again.

@SeriousM
Have you managed to solve this problem?

OK i got it. @mjhea0 do the job.

from mochawesome-report-generator.

mjhea0 avatar mjhea0 commented on May 25, 2024

what job? @izydorekjakub

from mochawesome-report-generator.

milankrstin avatar milankrstin commented on May 25, 2024

@SeriousM

I noticed that missing json properties create validation errors. That's ok, but the latest version of mochawesome creates an incompatible json: Invalid value undefined supplied to /suites/suites/0/tests/0/timedOut: Boolean. Adding it let marge work again.

When I fixed this and ran marge command I always got 2 separate files.
For example: I have report1.json and report2.json When I run: marge report1.json report2.json
Result will be: report1.html and report2.html. Merge is not executed.
Did you have the same issue?

from mochawesome-report-generator.

SeriousM avatar SeriousM commented on May 25, 2024

Currently we just generate one report per fixture. Sorry that I can't help you any further but we decided to stop investigate this issue any longer as it costs more than it gives us.

from mochawesome-report-generator.

mjhea0 avatar mjhea0 commented on May 25, 2024

@stephenchan9 - Yes, this has been fixed.

from mochawesome-report-generator.

sandeepbantode avatar sandeepbantode commented on May 25, 2024

@govindn Do you found solution for original issue ? merge reports when run in parallel

from mochawesome-report-generator.

0xc0d3r avatar 0xc0d3r commented on May 25, 2024

@adamgruber Any update on the original issue?

from mochawesome-report-generator.

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.