* [PATCH datacenter-manager v2] add `make coverage` build target
@ 2026-08-25 6:45 Lukas Wagner
0 siblings, 0 replies; only message in thread
From: Lukas Wagner @ 2026-08-25 6:45 UTC (permalink / raw)
To: pdm-devel
This uses the `tarpaulin` tool to generate a test coverage report in the
'./coverage' directory.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
Notes:
`tarpaulin` is not packaged for Debian at the moment, so one has to
install it via `cargo install --locked cargo-tarpaulin`.
We could consider packaging it ourselves, however, last time I checked
some of the (transitive) dependencies were a bit inconvenient, so maybe
we'd have to vendor them, similar to how we do it with `proxmox-biome`.
Changes from v1:
- fix grammar mistake in commit message
- remove trailing space in makefile recipe
.gitignore | 2 ++
Makefile | 6 ++++++
tarpaulin.toml | 22 ++++++++++++++++++++++
3 files changed, 30 insertions(+)
create mode 100644 tarpaulin.toml
diff --git a/.gitignore b/.gitignore
index eb4a27ea..8de2bdad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,3 +20,5 @@
/ui/target
Cargo.lock
proxmox-datacenter-manager-[0-9].*/
+
+/coverage
diff --git a/Makefile b/Makefile
index 537e6faa..48a5d112 100644
--- a/Makefile
+++ b/Makefile
@@ -148,6 +148,7 @@ upload-ui:
distclean: clean
clean: clean-deb
$(CARGO) clean
+ rm -rf ./coverage
$(MAKE) -C docs clean
$(MAKE) -C $(COMPLETION_DIR) clean
$(MAKE) -C $(UI_DIR) clean
@@ -179,3 +180,8 @@ tidy:
$(CARGO) fmt
$(MAKE) -C $(UI_DIR) tidy
+
+.PHONY: coverage
+coverage:
+ $(CARGO) tarpaulin
+ @echo "\nCoverage report in ./coverage/tarpaulin-report.html"
diff --git a/tarpaulin.toml b/tarpaulin.toml
new file mode 100644
index 00000000..01740418
--- /dev/null
+++ b/tarpaulin.toml
@@ -0,0 +1,22 @@
+[test_config]
+
+# Skip the clean step and proceed without cleaning the target directory.
+skip-clean = true
+
+# Count hits for coverage, useful for more detailed reporting.
+count = true
+
+# List of file paths to exclude from testing.
+exclude-files = [
+ "proxmox-datacenter-manager*",
+ "ui/*"
+]
+
+# Specify the engine to use for collecting coverage (default: "trace").
+engine = "Llvm"
+
+[report]
+# Directory to output coverage files and reports.
+output-dir = "./coverage"
+
+out = ["Html"]
--
2.47.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-25 6:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25 6:45 [PATCH datacenter-manager v2] add `make coverage` build target Lukas Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox