-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.pytool/Plugin: Better Rust Support (#580)
## Description Updates the RustHostUnitTestPlugin to allow the developer to enable or disable the code coverage portion of the plugin. Additionally fixes a bug in which doctests marked as ignored were still causing the CI plugin to fail. Additionally turns off code coverage if it detects its running on a Windows ARM device as tarpaulin does not support that type of device. - [ ] 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 CI ## Integration Instructions CI
- Loading branch information
1 parent
074ae3b
commit 8e6340a
Showing
3 changed files
with
39 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
# Rust Host Unit Test Plugin | ||
|
||
This CI plugin runs all unit tests with coverage enabled, calculating coverage results on a per package basis. It filters results to only calculate coverage on files within the package. | ||
|
||
This CI plugin will also calculate coverage for the entire workspace. | ||
This CI plugin runs all unit tests and requires that they pass. If code coverage is turned on with | ||
`"CalculateCoverage": true`, then coverage percentages will be calculated on a per rust crate basis. | ||
|
||
## Plugin Customizations | ||
|
||
As a default, this plugin requires 75% coverage, though this can be configured within a packages ci.yaml file by adding the entry `RustCoverageCheck`. The required coverage percent can also be customized on a per (rust) package bases. | ||
- `CalculateCoverage`: true / false - Whether or not to calculate coverage results | ||
- `Coverage`: int (0, 1) - The percentage of coverage required to pass the CI check, if `CalculateCoverage` is enabled | ||
- `CoverageOverrides` int (0, 1) - Crate specific override of percentage needed to pass | ||
|
||
As a default, Calculating Coverage is enabled and at least 75% (.75) code coverage is required to pass. | ||
|
||
### Example ci settings | ||
|
||
``` yaml | ||
"RustHostUnitTestPlugin": { | ||
"CalculateCoverage": true, | ||
"Coverage": 1, | ||
"CoverageOverrides": { | ||
"DxeRust": 0.0, | ||
"UefiEventLib": 0.0, | ||
"DxeRust": 0.4, | ||
"UefiEventLib": 0.67, | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters