Skip to content

[rel/5.x.x] Implement Cobertura coverage format#2572

Merged
nohwnd merged 10 commits into
rel/5.x.xfrom
cobertura-5.7
Nov 17, 2024
Merged

[rel/5.x.x] Implement Cobertura coverage format#2572
nohwnd merged 10 commits into
rel/5.x.xfrom
cobertura-5.7

Conversation

@nohwnd
Copy link
Copy Markdown
Member

@nohwnd nohwnd commented Oct 30, 2024

Backport #2298 to 5.x.x
Backport #2553 as well

* wip: Implement Cobertura coverage format

* fix unit test

* revert editor settings change

* remove ?? operator

* fix attribute ordering

* make coverage report test work on all platforms

* Fix windows paths

* fix unit test for Windows paths

* kick the build

* re-implement Cobertura coverage report generation

* fix compatibility issues

* fix tests

* removing Cobertura from v4 parameter options

* fix compatibility with ReportGenerator

* Update src/functions/Coverage.ps1

Co-authored-by: Frode Flaten <3436158+fflaten@users.noreply.github.com>

* fix whitespace

* fix output

* fix windows paths

* order packages,classes,methods by name

* change Cobertura DTD to loose

* Tune coverage report for performance

* Remove outdated condition

* Add Cobertura DTD file

* Apply suggestions from code review

Co-authored-by: Jakub Jareš <me@jakubjares.com>

* Fix typo and update JaCoCo starttime

* Fix tests

* Use epoch time for Cobertura and JaCoCo

* Update test

---------

Co-authored-by: Frode Flaten <3436158+fflaten@users.noreply.github.com>
Co-authored-by: Jakub Jareš <me@jakubjares.com>
@nohwnd
Copy link
Copy Markdown
Member Author

nohwnd commented Oct 30, 2024

regarding your comments on the source PR @fflaten why do you say this one will need to use a different implementation? the api seems to exist in .NET Framework 462: https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset.tounixtimemilliseconds?view=netframework-4.6.2 which is the oldest one we support.

the comments:
#2298 (comment)
#2298 (comment)

* Ignore calls to base class constructor in code coverage

* Update tests
@nohwnd nohwnd marked this pull request as ready for review October 30, 2024 21:26
@nohwnd
Copy link
Copy Markdown
Member Author

nohwnd commented Oct 30, 2024

Too tired to deal with the build errors right now.

@fflaten
Copy link
Copy Markdown
Collaborator

fflaten commented Oct 30, 2024

regarding your comments on the source PR @fflaten why do you say this one will need to use a different implementation? the api seems to exist in .NET Framework 462

Pester v5 targets .NET 4.5.2.

function MyClass
{
'I am the constructor.'
MyBaseClass # calls the base constructor
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was originally MyBaseClass; "I am the constructor" but that adds one more BP than needed, removed the string so we simulate the call to base constructor like the new class base code does it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

#2577 Forward ported here.

@nohwnd nohwnd merged commit fc69637 into rel/5.x.x Nov 17, 2024
@nohwnd nohwnd deleted the cobertura-5.7 branch November 17, 2024 15:41
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