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

feat(reporting): Make links clickable in terminals that support Ansi magic #1936

Merged
merged 8 commits into from
Mar 5, 2022

Conversation

eNeRGy164
Copy link
Contributor

After discussion in #1394

  • Replaced Crayon with Spectre.Console
  • Made links clickable in the terminal
  • Added a smiley, as requested by the Info Support open source council ;)

I think Spectre.Console removes a lot of clutter when generating the table/tree output.
Allows for more fancy stuff in the future, and is well maintained.

I didn't replace the progress bar implementation at this moment in time.

Output using the changed code:
spectre table

spectre tree

spectre dot

spectre html

spectre json

spectre pb

@eNeRGy164
Copy link
Contributor Author

Hmm, the failing test is flaky.. it succeeds when it's run individual, but fails when running all tests together...

@richardwerkman
Copy link
Member

@eNeRGy164 are you looking into the flaky test? I'd very much like to merge this 🙌

@eNeRGy164
Copy link
Contributor Author

Yes, already did have a quick look, but did not find a solution yet

@eNeRGy164
Copy link
Contributor Author

eNeRGy164 commented Mar 4, 2022

@richardwerkman Go ahead :)

@eNeRGy164
Copy link
Contributor Author

@rouke-broersma now you introduced conflicts again |:( :)

@rouke-broersma
Copy link
Member

@rouke-broersma now you introduced conflicts again |:( :)

😅😅

@richardwerkman
Copy link
Member

You can rebuild the packages.lock files by building the project with the latests changes included 👍

@rouke-broersma rouke-broersma self-requested a review March 5, 2022 18:34
@rouke-broersma rouke-broersma self-assigned this Mar 5, 2022
Copy link
Member

@rouke-broersma rouke-broersma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason the report path is printed over two distinct lines, does spectre.console enforce some kinda line length?

https://dev.azure.com/stryker-mutator/Stryker/_build/results?buildId=9425&view=logs&j=99031f74-bf3d-58da-997c-4e095f08dc64&t=4fae8bbe-7dd3-5ecd-793d-f1d2f82f0225&l=3834

Your json report has been generated at:
D:\a\1\s\integrationtest\TargetProjects\NetCoreTestProject.XUnit\StrykerOutput\2
022-03-04.22-22-53\reports\mutation-report.json
Hint: by passing "--open-report or -o" the report will open automatically once 
Stryker is done.

Your html report has been generated at:
D:\a\1\s\integrationtest\TargetProjects\NetCoreTestProject.XUnit\StrykerOutput\2
022-03-04.22-22-53\reports\mutation-report.html
You can open it in your browser of choice.

From a quick search it seems like Spectre.Console out-detects max console width, that makes me think if it cannot be auto detected a max-width of 80 is chosen (legacy terminal character limit). On the one hand this seems fine, on the other hand in a CI pipeline it's not really necessary to cut off a filepath.

It seems to also affect the table and file tree reports in azure devops output making them less usefull because the content is simply cut off in some cases or placed on new lines in others.

All mutants have been tested, and your mutation score has been calculated
╭────────────────────────────┬───────┬───────┬────────┬─────────┬───────┬──────╮
│ File                       │    %  │    #  │     #  │      #  │ # no  │   #  │
│                            │ score │ kill… │ timeo… │ surviv… │   cov │ err… │
├────────────────────────────┼───────┼───────┼────────┼─────────┼───────┼──────┤
│ All files                  │ 16.92 │     9 │      2 │      92 │    50 │    2 │
│ Csharp7.cs                 │  0.00 │     0 │      0 │       1 │     1 │    0 │
│ Csharp8.cs                 │  0.00 │     0 │      0 │      14 │     6 │    0 │
│ Endlessloop.cs             │ 40.00 │     0 │      2 │       3 │     1 │    0 │
│ LinqMagic.cs               │  0.00 │     0 │      0 │      17 │    15 │    0 │
│ Math\Calc\DummyCalc.cs     │  0.00 │     0 │      0 │      13 │    13 │    0 │
│ Math\DummyMath.cs          │ 66.67 │     2 │      0 │       1 │     0 │    0 │
│ Person.cs                  │   N/A │     0 │      0 │       9 │     0 │    0 │
│ String\StringMagic.cs      │  0.00 │     0 │      0 │      17 │    13 │    2 │
│ String\StringReplaceChain. │  0.00 │     0 │      0 │       8 │     1 │    0 │
│ cs                         │       │       │        │         │       │      │
│ Student.cs                 │ 75.00 │     3 │      0 │       9 │     0 │    0 │
│ UnsafeCode.cs              │ 100.0 │     4 │      0 │       0 │     0 │    0 │
│                            │     0 │       │        │         │       │      │
╰────────────────────────────┴───────┴───────┴────────┴─────────┴───────┴──────╯

I think we can accept fixing this in a new issue though it only affects CI runs and is probably what you want in a non-CI scenario.

@rouke-broersma
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rouke-broersma rouke-broersma changed the title Make links clickable in terminal feat(reporting): Make links clickable in terminals that support Ansi magic Mar 5, 2022
@rouke-broersma rouke-broersma merged commit 54b9872 into stryker-mutator:master Mar 5, 2022
@eNeRGy164 eNeRGy164 deleted the coolsole branch March 6, 2022 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants