Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTML logging option #340

Closed
BackEndTea opened this issue May 6, 2018 · 10 comments
Closed

Add HTML logging option #340

BackEndTea opened this issue May 6, 2018 · 10 comments

Comments

@BackEndTea
Copy link
Member

BackEndTea commented May 6, 2018

Is your feature request related to a problem? Please describe.
One of the things i really like about phpunit is the html coverage log. I can easily see what is covered, and what is not. The current infection log may be somewhat daunting to users who haven't used infection before, or may not even make much sense.

Its also difficult to 'perfect' a certain set of classes that you are working on, since its difficult to filter them out.

Describe the solution you'd like
I would like to see one or more human readable outputs of infection. My favourite would be a html option, but for starters a markdown version could do a lot for us as well.

Edit: a good reference the stryker HTML report

@maks-rafalko
Copy link
Member

We can think about something like Stryker has

probably even reuse their code somehow

@maks-rafalko maks-rafalko changed the title Add a more human readable logging option Add HTML logging option Sep 3, 2018
@Spudley
Copy link

Spudley commented Sep 3, 2018

I would also like to see HTML reporting option. +1.

@cn7r66
Copy link

cn7r66 commented Dec 21, 2018

Hi!

I started writing an HTML logger, It still need some polishing and testing but maybe can be a good starting point.

Here you can see a demo of the report. (I've not implemented the file template with source and diffs yet)

If no one is working on this feature i can invest some more time and finish it.

@maks-rafalko
Copy link
Member

It looks gorgeous!!!

I'm not aware of anyone working on this feature.

@cn7r66
Copy link

cn7r66 commented Dec 22, 2018

Great! If so, i will continue.

Meanwhile i've added all the metrics to the table, added file/directory icon near the name, added the legend and started working on the file template.

I've pushed the current state to my github page. (Same link of the previous message)

@maks-rafalko
Copy link
Member

Do you have any progress @cn7r66? Your examples look fantastic, would be too bad to lose this work.

@nicojs
Copy link

nicojs commented Mar 27, 2019

Dear friends from the awesome infection PHP community.

🤝

We have open sourced our HTML reporter as a custom element (using the web components specifications). That way, creating an html report is as easy as writing your report to a JSON file and create a small template html file. We needed this internally to support both Stryker4s and Stryker.NET, but decided to make it even more generic, so other mutation testing frameworks can benefit as well.

Basically: mutation testing implementers need to do the following:

  1. Generate a json file based on the mutation-testing json schema: https://github.com/stryker-mutator/mutation-testing-elements/blob/master/packages/mutation-testing-report-schema/src/mutation-testing-report-schema.json
  2. Create a simple html file:
    <!DOCTYPE html>
    <head>
       <title>Simple example - Mutation test elements</title>
       <script src="https://www.unpkg.com/mutation-testing-elements@1.0.2/dist/mutation-test-elements.js"></script>
    </head>
    
    <body>
        <mutation-test-report-app title-postfix="InfectionPHP" src="mutation-report.json">
            Your browser does not support custom elements. Please use a modern browser.
        </mutation-test-report-app>
    </body>
    
    </html>
    See mutation-testing-elements readme: https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages/mutation-testing-elements#readme for more information.

@borNfreee The new schema will also be supported by the stryker dashboard in the future. So you will be able to upload it there so that the dashboard can serve the same html file.

If for any reason the mutation-testing-report-schema does not satisfy your needs, or is impossible to provide, please open an issue.

I'll also be writing a blog article on this (probably this weekend).

Hope this helps!

@maks-rafalko
Copy link
Member

Thank you very much, Nico!

I just tried it with the examples from your repository and it works really great.

@maks-rafalko
Copy link
Member

Seems like we can now simply upload a json file with such schema to Stryker Dashboard

See https://github.com/stryker-mutator/stryker-handbook/blob/master/dashboard.md

@maks-rafalko
Copy link
Member

Implemented #1625

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants