Skip to content

[build] add code coverage to provider_integration workflow#352

Draft
zimmy87 wants to merge 17 commits into
mainfrom
user/v-davidz/provider_integration_cov
Draft

[build] add code coverage to provider_integration workflow#352
zimmy87 wants to merge 17 commits into
mainfrom
user/v-davidz/provider_integration_cov

Conversation

@zimmy87
Copy link
Copy Markdown
Contributor

@zimmy87 zimmy87 commented Apr 30, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 30, 2026 01:05
@zimmy87 zimmy87 linked an issue Apr 30, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the repo’s xtask and CI workflow so the provider_integration GitHub Actions job runs integration tests under cargo llvm-cov and emits a coverage summary via xtask precheck --coverage-report.

Changes:

  • Extend xtask coverage to accept nextest-like arguments (features/package/profile/filterset/exclude) and forward them to cargo llvm-cov nextest.
  • Update xtask precheck to pass coverage configuration (and to run multiple coverage invocations in the default “SDK” path).
  • Switch provider_integration workflow steps from --nextest to --coverage, and add a coverage summary step.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
xtask/src/precheck.rs Routes precheck --coverage into parameterized Coverage runs (default SDK + resiliency runs, or user-provided package/features).
xtask/src/coverage.rs Adds CLI flags to Coverage and builds argument lists for cargo llvm-cov nextest.
.github/workflows/rust.yml Runs provider integration test packages with coverage and adds a coverage summary report step.

Comment thread xtask/src/precheck.rs Outdated
Comment thread .github/workflows/rust.yml
Comment thread xtask/src/coverage.rs Outdated
Comment thread xtask/src/precheck.rs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 30, 2026 20:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread xtask/src/precheck.rs Outdated
…h default precheck runs

Agent-Logs-Url: https://github.com/Azure/azihsm-sdk/sessions/c036d7d2-3887-40af-8d85-48d245439a70

Co-authored-by: zimmy87 <5205889+zimmy87@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 1, 2026 18:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings May 1, 2026 19:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread xtask/src/precheck.rs Outdated
Comment thread .github/workflows/rust.yml Outdated
Comment thread xtask/src/coverage.rs Outdated
Comment thread xtask/src/coverage_report.rs
Copilot AI review requested due to automatic review settings May 18, 2026 18:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment thread xtask/src/coverage_report.rs Outdated
Comment thread .github/workflows/rust.yml Outdated
Comment thread .github/workflows/rust.yml
Comment thread xtask/src/coverage.rs
Comment thread xtask/src/coverage.rs Outdated
Comment on lines +189 to +202
// append /target/debug/libazihsm_api_native.so to LLVM_COV_FLAGS
let additional_libs = ["./target/debug/libazihsm_api_native.so"];
for lib in &additional_libs {
if std::path::Path::new(lib).exists() {
let new_flags = match std::env::var("LLVM_COV_FLAGS") {
Ok(existing) if !existing.trim().is_empty() => {
format!("{existing} -object {lib}")
}
_ => format!("-object {lib}"),
};
sh.set_var("LLVM_COV_FLAGS", new_flags);
} else {
log::warn!("Could not find library at expected path: {}. Coverage reports may be incomplete.", lib);
}
Copilot AI review requested due to automatic review settings May 18, 2026 23:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread xtask/src/coverage.rs
Comment on lines +73 to +77
let filterset_val = self.filterset.clone().unwrap_or_default();
if self.filterset.is_some() {
command_args.push("--filterset");
command_args.push(&filterset_val);
}
Comment on lines +96 to +105
// set LLVM_COV_FLAGS to include azihsm_api_native object file in coverage reports
if let Some(native_obj_path) = native_obj_path {
if native_obj_path.is_file() {
let path_str = native_obj_path.to_string_lossy();
let new_flags = match std::env::var("LLVM_COV_FLAGS") {
Ok(existing) if !existing.trim().is_empty() => {
format!("{existing} -object {path_str}")
}
_ => format!("-object {path_str}"),
};
Comment thread xtask/src/coverage_report.rs Outdated
Copilot AI review requested due to automatic review settings May 19, 2026 00:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread xtask/src/precheck.rs
Comment on lines +267 to +276
// Run resiliency fault-injection tests with coverage
Coverage {
features: Some("mock,res-test".to_string()),
package: Some("azihsm_api_tests".to_string()),
no_default_features: false,
filterset: Some("test(resiliency::fault_injection::)".to_string()),
profile: self.profile.clone().or(Some("ci-mock-res".to_string())),
exclude: self.exclude.clone(),
}
.run(ctx.clone())?;
Comment thread xtask/src/coverage.rs
Comment on lines +98 to 107
// Run tests with coverage
log::info!("Building all tests and running them with coverage");
cmd!(
sh,
"cargo llvm-cov report --json --summary-only --output-path ./target/reports/sdk-cov.json --ignore-filename-regex xtask*"
).run()?;

// Generate HTML report
log::info!("Generating HTML report");
cmd!(sh, " cargo llvm-cov report --html --output-dir ./target/reports/sdk-cov/ --ignore-filename-regex xtask*").run()?;
"cargo llvm-cov nextest --no-report --no-fail-fast {command_args...}"
)
.run()?;

log::info!("Code coverage completed successfully");
Ok(())
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.

[task] add code coverage to provider_integration

3 participants