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

BaseTools: reformat HostBasedUnitTestRunner coverage results by inf #616

Merged
merged 18 commits into from
Nov 14, 2023

Conversation

Javagedes
Copy link
Contributor

@Javagedes Javagedes commented Nov 7, 2023

Description

Coverage results that are generated from HostBasedUnitTestRunner are inconsistent in terms of how the cobertura file is formatted. On Windows, cobertura results are grouped by test executable while on Linux, cobertura results are grouped by INF. This commit reformats coverage results to always be by INF and to additionally be package-path relative.

An additional change this commit makes is to rename the package coverage file to include the package name. This is to make easily identify which coverage results come from which host test DSC and additionally prevent name conflicts when coverage results are uploaded during a PR gate. Overall coverage is still generated and at the root of the output directory (typically $(ws)/Build/)

An additional change is made to how the input_coverage parameter is provided to OpenCppCoverage for msvc builds. input_coverage is now provided via a config file due to the command line argument limit being reached as the number of tests being run increases. The config file is written, the command is run, then the file is deleted.

  • Impacts functionality?
    • Functionality - Does the change ultimately impact how firmware functions?
    • Examples: Add a new library, publish a new PPI, update an algorithm, ...
  • Impacts security?
    • Security - Does the change have a direct security impact on an application,
      flow, or firmware?
    • Examples: Crypto algorithm change, buffer overflow fix, parameter
      validation improvement, ...
  • Breaking change?
    • Breaking change - Will anyone consuming this change experience a break
      in build or boot behavior?
    • Examples: Add a new library class, move a module to a different repo, call
      a function in a new library class in a pre-existing module, ...
  • Includes tests?
    • Tests - Does the change include any explicit test code?
    • Examples: Unit tests, integration tests, robot tests, ...
  • Includes documentation?
    • Documentation - Does the change contain explicit documentation additions
      outside direct code modifications (and comments)?
    • Examples: Update readme file, add feature readme file, link to documentation
      on an a separate Web page, ...

How This Was Tested

N/A

Integration Instructions

Any repository consuming MU_BASECORE for this commit and later must use edk2-pytool-extensions >= 0.26.0.

@github-actions github-actions bot added language:python Pull requests that update Python code impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact labels Nov 7, 2023
Coverage results that are generated from HostBasedUnitTestRunner
are inconsistent in terms of how the cobertura file is fomratted.
On Windows, cobertura results are grouped by test executable
while on Linux, cobertura results are grouped by INF. This commit
reformat reformats coverage results to always be by INF and to
additionally be package-path relative.

An additional change this commit makes is to rename the package
coverage file to include the platform name. This is to make easily
identify which coverage results come from which host test DSC and
additionally prevent name conflicts when coverage results are
uploaded during a PR gate.
@Javagedes Javagedes marked this pull request as draft November 8, 2023 21:24
@Javagedes Javagedes force-pushed the unittestrunner-update branch 5 times, most recently from 714af1e to ce5b9f4 Compare November 8, 2023 21:33
@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (release/202302@a4a9353). Click here to learn what that means.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202302     #616   +/-   ##
=================================================
  Coverage                  ?   24.85%           
=================================================
  Files                     ?      128           
  Lines                     ?    21559           
  Branches                  ?     5756           
=================================================
  Hits                      ?     5359           
  Misses                    ?    16150           
  Partials                  ?       50           
Flag Coverage Δ
CryptoPkg 29.15% <0.00%> (?)
MdeModulePkg 11.71% <0.00%> (?)
MdePkg 39.37% <0.00%> (?)
PolicyServicePkg 65.99% <0.00%> (?)
UefiCpuPkg 87.05% <0.00%> (?)
UnitTestFrameworkPkg ∅ <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Javagedes Javagedes force-pushed the unittestrunner-update branch 10 times, most recently from 505d546 to e2808b0 Compare November 9, 2023 17:20
@Javagedes Javagedes marked this pull request as ready for review November 13, 2023 23:58
@Javagedes Javagedes merged commit 991a64e into microsoft:release/202302 Nov 14, 2023
38 checks passed
ProjectMuBot added a commit to microsoft/mu_tiano_platforms that referenced this pull request Nov 16, 2023
kenlautner pushed a commit that referenced this pull request Dec 14, 2023
…616)

Coverage results that are generated from HostBasedUnitTestRunner are
inconsistent in terms of how the cobertura file is formatted. On
Windows, cobertura results are grouped by test executable while on
Linux, cobertura results are grouped by INF. This commit reformats
coverage results to always be by INF and to additionally be package-path
relative.

An additional change this commit makes is to rename the package coverage
file to include the package name. This is to make easily identify which
coverage results come from which host test DSC and additionally prevent
name conflicts when coverage results are uploaded during a PR gate.
Overall coverage is still generated and at the root of the output
directory (typically `$(ws)/Build/`)

An additional change is made to how the `input_coverage` parameter is
provided to `OpenCppCoverage` for msvc builds. `input_coverage` is now
provided via a config file due to the command line argument limit being
reached as the number of tests being run increases. The config file is
written, the command is run, then the file is deleted.

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [x] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

N/A

Any repository consuming MU_BASECORE for this commit and later must use
edk2-pytool-extensions >= 0.26.2.
kenlautner pushed a commit that referenced this pull request Dec 14, 2023
…616)

Coverage results that are generated from HostBasedUnitTestRunner are
inconsistent in terms of how the cobertura file is formatted. On
Windows, cobertura results are grouped by test executable while on
Linux, cobertura results are grouped by INF. This commit reformats
coverage results to always be by INF and to additionally be package-path
relative.

An additional change this commit makes is to rename the package coverage
file to include the package name. This is to make easily identify which
coverage results come from which host test DSC and additionally prevent
name conflicts when coverage results are uploaded during a PR gate.
Overall coverage is still generated and at the root of the output
directory (typically `$(ws)/Build/`)

An additional change is made to how the `input_coverage` parameter is
provided to `OpenCppCoverage` for msvc builds. `input_coverage` is now
provided via a config file due to the command line argument limit being
reached as the number of tests being run increases. The config file is
written, the command is run, then the file is deleted.

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [x] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

N/A

Any repository consuming MU_BASECORE for this commit and later must use
edk2-pytool-extensions >= 0.26.2.
kenlautner pushed a commit that referenced this pull request Dec 16, 2023
…616)

Coverage results that are generated from HostBasedUnitTestRunner are
inconsistent in terms of how the cobertura file is formatted. On
Windows, cobertura results are grouped by test executable while on
Linux, cobertura results are grouped by INF. This commit reformats
coverage results to always be by INF and to additionally be package-path
relative.

An additional change this commit makes is to rename the package coverage
file to include the package name. This is to make easily identify which
coverage results come from which host test DSC and additionally prevent
name conflicts when coverage results are uploaded during a PR gate.
Overall coverage is still generated and at the root of the output
directory (typically `$(ws)/Build/`)

An additional change is made to how the `input_coverage` parameter is
provided to `OpenCppCoverage` for msvc builds. `input_coverage` is now
provided via a config file due to the command line argument limit being
reached as the number of tests being run increases. The config file is
written, the command is run, then the file is deleted.

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [x] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

N/A

Any repository consuming MU_BASECORE for this commit and later must use
edk2-pytool-extensions >= 0.26.2.
kenlautner pushed a commit that referenced this pull request Dec 18, 2023
…616)

Coverage results that are generated from HostBasedUnitTestRunner are
inconsistent in terms of how the cobertura file is formatted. On
Windows, cobertura results are grouped by test executable while on
Linux, cobertura results are grouped by INF. This commit reformats
coverage results to always be by INF and to additionally be package-path
relative.

An additional change this commit makes is to rename the package coverage
file to include the package name. This is to make easily identify which
coverage results come from which host test DSC and additionally prevent
name conflicts when coverage results are uploaded during a PR gate.
Overall coverage is still generated and at the root of the output
directory (typically `$(ws)/Build/`)

An additional change is made to how the `input_coverage` parameter is
provided to `OpenCppCoverage` for msvc builds. `input_coverage` is now
provided via a config file due to the command line argument limit being
reached as the number of tests being run increases. The config file is
written, the command is run, then the file is deleted.

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [x] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

N/A

Any repository consuming MU_BASECORE for this commit and later must use
edk2-pytool-extensions >= 0.26.2.
cfernald pushed a commit to cfernald/mu_basecore that referenced this pull request Jul 1, 2024
…icrosoft#616)

Coverage results that are generated from HostBasedUnitTestRunner are
inconsistent in terms of how the cobertura file is formatted. On
Windows, cobertura results are grouped by test executable while on
Linux, cobertura results are grouped by INF. This commit reformats
coverage results to always be by INF and to additionally be package-path
relative.

An additional change this commit makes is to rename the package coverage
file to include the package name. This is to make easily identify which
coverage results come from which host test DSC and additionally prevent
name conflicts when coverage results are uploaded during a PR gate.
Overall coverage is still generated and at the root of the output
directory (typically `$(ws)/Build/`)

An additional change is made to how the `input_coverage` parameter is
provided to `OpenCppCoverage` for msvc builds. `input_coverage` is now
provided via a config file due to the command line argument limit being
reached as the number of tests being run increases. The config file is
written, the command is run, then the file is deleted.

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [x] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

N/A

Any repository consuming MU_BASECORE for this commit and later must use
edk2-pytool-extensions >= 0.26.2.
cfernald pushed a commit to cfernald/mu_basecore that referenced this pull request Jul 1, 2024
…icrosoft#616)

Coverage results that are generated from HostBasedUnitTestRunner are
inconsistent in terms of how the cobertura file is formatted. On
Windows, cobertura results are grouped by test executable while on
Linux, cobertura results are grouped by INF. This commit reformats
coverage results to always be by INF and to additionally be package-path
relative.

An additional change this commit makes is to rename the package coverage
file to include the package name. This is to make easily identify which
coverage results come from which host test DSC and additionally prevent
name conflicts when coverage results are uploaded during a PR gate.
Overall coverage is still generated and at the root of the output
directory (typically `$(ws)/Build/`)

An additional change is made to how the `input_coverage` parameter is
provided to `OpenCppCoverage` for msvc builds. `input_coverage` is now
provided via a config file due to the command line argument limit being
reached as the number of tests being run increases. The config file is
written, the command is run, then the file is deleted.

cherry-picked from 991a64e, pulled from 43ae607 in 202311

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [x] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

N/A

Any repository consuming MU_BASECORE for this commit and later must use
edk2-pytool-extensions >= 0.26.2.
cfernald pushed a commit to cfernald/mu_basecore that referenced this pull request Jul 3, 2024
…icrosoft#616) (microsoft#688)

Coverage results that are generated from HostBasedUnitTestRunner are
inconsistent in terms of how the cobertura file is formatted. On
Windows, cobertura results are grouped by test executable while on
Linux, cobertura results are grouped by INF. This commit reformats
coverage results to always be by INF and to additionally be package-path
relative.

An additional change this commit makes is to rename the package coverage
file to include the package name. This is to make easily identify which
coverage results come from which host test DSC and additionally prevent
name conflicts when coverage results are uploaded during a PR gate.
Overall coverage is still generated and at the root of the output
directory (typically `$(ws)/Build/`)

An additional change is made to how the `input_coverage` parameter is
provided to `OpenCppCoverage` for msvc builds. `input_coverage` is now
provided via a config file due to the command line argument limit being
reached as the number of tests being run increases. The config file is
written, the command is run, then the file is deleted.

Integrates edk2-pytool-extensions 0.27.0 and edk2-pytool-library 0.20.0,
which overhauls the database functionality to use an ORM for managing
the database schema and access to the database.

Updates the only plugin in MU_BASECORE that uses the database
functionality, HostBasedUnitTestRunner.

cherry-picked from 991a64e, pulled from 43ae607 in 202311
cherry-picked from 785fe3d

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?.
cfernald pushed a commit to cfernald/mu_basecore that referenced this pull request Jul 5, 2024
…icrosoft#616) (microsoft#688)

Coverage results that are generated from HostBasedUnitTestRunner are
inconsistent in terms of how the cobertura file is formatted. On
Windows, cobertura results are grouped by test executable while on
Linux, cobertura results are grouped by INF. This commit reformats
coverage results to always be by INF and to additionally be package-path
relative.

An additional change this commit makes is to rename the package coverage
file to include the package name. This is to make easily identify which
coverage results come from which host test DSC and additionally prevent
name conflicts when coverage results are uploaded during a PR gate.
Overall coverage is still generated and at the root of the output
directory (typically `$(ws)/Build/`)

An additional change is made to how the `input_coverage` parameter is
provided to `OpenCppCoverage` for msvc builds. `input_coverage` is now
provided via a config file due to the command line argument limit being
reached as the number of tests being run increases. The config file is
written, the command is run, then the file is deleted.

Integrates edk2-pytool-extensions 0.27.0 and edk2-pytool-library 0.20.0,
which overhauls the database functionality to use an ORM for managing
the database schema and access to the database.

Updates the only plugin in MU_BASECORE that uses the database
functionality, HostBasedUnitTestRunner.

cherry-picked from 991a64e, pulled from 43ae607 in 202311
cherry-picked from 785fe3d

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?.
cfernald pushed a commit that referenced this pull request Jul 5, 2024
…616) (#688)

Coverage results that are generated from HostBasedUnitTestRunner are
inconsistent in terms of how the cobertura file is formatted. On
Windows, cobertura results are grouped by test executable while on
Linux, cobertura results are grouped by INF. This commit reformats
coverage results to always be by INF and to additionally be package-path
relative.

An additional change this commit makes is to rename the package coverage
file to include the package name. This is to make easily identify which
coverage results come from which host test DSC and additionally prevent
name conflicts when coverage results are uploaded during a PR gate.
Overall coverage is still generated and at the root of the output
directory (typically `$(ws)/Build/`)

An additional change is made to how the `input_coverage` parameter is
provided to `OpenCppCoverage` for msvc builds. `input_coverage` is now
provided via a config file due to the command line argument limit being
reached as the number of tests being run increases. The config file is
written, the command is run, then the file is deleted.

Integrates edk2-pytool-extensions 0.27.0 and edk2-pytool-library 0.20.0,
which overhauls the database functionality to use an ORM for managing
the database schema and access to the database.

Updates the only plugin in MU_BASECORE that uses the database
functionality, HostBasedUnitTestRunner.

cherry-picked from 991a64e, pulled from 43ae607 in 202311
cherry-picked from 785fe3d

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?.
os-d pushed a commit to os-d/mu_basecore that referenced this pull request Jul 16, 2024
…icrosoft#616) (microsoft#688)

Coverage results that are generated from HostBasedUnitTestRunner are
inconsistent in terms of how the cobertura file is formatted. On
Windows, cobertura results are grouped by test executable while on
Linux, cobertura results are grouped by INF. This commit reformats
coverage results to always be by INF and to additionally be package-path
relative.

An additional change this commit makes is to rename the package coverage
file to include the package name. This is to make easily identify which
coverage results come from which host test DSC and additionally prevent
name conflicts when coverage results are uploaded during a PR gate.
Overall coverage is still generated and at the root of the output
directory (typically `$(ws)/Build/`)

An additional change is made to how the `input_coverage` parameter is
provided to `OpenCppCoverage` for msvc builds. `input_coverage` is now
provided via a config file due to the command line argument limit being
reached as the number of tests being run increases. The config file is
written, the command is run, then the file is deleted.

Integrates edk2-pytool-extensions 0.27.0 and edk2-pytool-library 0.20.0,
which overhauls the database functionality to use an ORM for managing
the database schema and access to the database.

Updates the only plugin in MU_BASECORE that uses the database
functionality, HostBasedUnitTestRunner.

cherry-picked from 991a64e, pulled from 43ae607 in 202311
cherry-picked from 785fe3d

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact language:python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants