-
-
Notifications
You must be signed in to change notification settings - Fork 322
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
Upgrade tarpaulin for new features #1144
Comments
Hi! I'm currently giving this a stab and here's some of the things that I've found so far. 🐱 It looks like
Do you recall which parts were not included? Edit: After looking through the tarpaulin's code some more, it looks like the |
Hey thanks! Quick check now with new tarpaulin and i am getting data that excludes the test data, and as a result our coverage drops: Locally with
compared to live
scanned like 3-4 files and all were due to the live count including the tests and local does not. |
Ah, have found a way to make it work locally in an acceptable way by moving the ignore-tests flag from the config to the cli: diff --git a/justfile b/justfile
index eba15879..a73aa98e 100644
--- a/justfile
+++ b/justfile
@@ -46,7 +46,7 @@ test-integration:
cargo run -p kube-examples --example crd_api
coverage:
- cargo tarpaulin --out=Html --output-dir=.
+ cargo tarpaulin --out=Html --output-dir=. --include-tests
{{open}} tarpaulin-report.html
readme:
diff --git a/tarpaulin.toml b/tarpaulin.toml
index 30bf94c4..638c9385 100644
--- a/tarpaulin.toml
+++ b/tarpaulin.toml
@@ -7,16 +7,15 @@
[one_pass_coverage]
workspace = true
-features = "kube/derive kube/runtime kube/ws"
+features = "kube/derive kube/runtime kube/ws kube/jsonpatch kube/admission kube/gzip"
color = "Always"
ignored = true
timeout = "600s"
exclude = ["e2e"]
# NB: proc macro code is not picked up by tarpaulin - so could maybe skip kube-derive completely
-excluded_files = ["kube-derive/tests"]
+exclude-files = ["kube-derive/tests"]
# NB: skipping Doctests because they are slow to build and generally marked no_run
run-types = ["Tests"]
-ignore_tests = true
# We could potentially pass in examples here
# but: they don't help in covering kube-derive, and they force a full recompile (also added some features to test in this run, but all-features also seems to work fine - but perhaps it's too slow to compile for the extra percent coverage it gives as it's already the slowest job) and we get this coverage:
so maybe that makes it easier. i otherwise like your new workflow setup with taiki-e/install-action! so thanks for looking into this. is it slower / faster? EDIT: using the cli arg is not necessary! -excluded_files = ["kube-derive/tests"]
+exclude-files = ["kube-derive/tests"]
+include-tests = true
# NB: skipping Doctests because they are slow to build and generally marked no_run
run-types = ["Tests"]
-ignore_tests = true also works without cli flags! |
took some of your changes for a quick test to see what we get and the results are a bit strange (via #1460) ..maybe it's just the consequence of going onto all-features 🤔 |
Originally, I was only using GHA's host runners to run the tests since I was encountering some issues setting up the k3d cluster locally. 😅 But I was able to get that resolved (I needed to add I looked through upstream and #1460 codecovs, and it looks like upstream covers I made a comment about what we're encountering here. I suppose we'll have to wait until the tarpaulin author sees it, but another option is ignoring all tests in the coverage completely (although this would make coverage look a bit 🫠 even though nothings changed internally in the tests). For now, I'll try and play around with macro expansion. |
Upgraded tarpaulin to new the new maintainer, added coverage for derive macro, and added an example. Fixes: kube-rs#1144
Upgraded tarpaulin to new the new maintainer, added coverage for derive macro, and added an example. Fixes: kube-rs#1144 Signed-off-by: tyrone-wu <[email protected]>
Upgraded tarpaulin to new the new maintainer, added coverage for derive macro, and added an example. Fixes: kube-rs#1144 Signed-off-by: tyrone-wu <[email protected]> revert to v3
Upgraded tarpaulin to new the new maintainer, added coverage for derive macro, and added an example. Fixes: kube-rs#1144 Signed-off-by: tyrone-wu <[email protected]>
Want to use a less ancient version of tarpaulin and get new features.
kube-derive
(currently it looks bad but it is tested)all-features
build in coverage (to ensure numbers are the most accurate and the most tests run)A lot of this can be attempted locally by simply running
cargo install cargo-tarpaulin
then runningjust coverage
inside the root of this repo (with a localk3d
/ non-important kubernetes cluster at your context).Some of this has been attempted before. #1143 most recently. But it's annoying because: a) changes have surprising results, b) iteration cycles are slow, and c) we never got around many of the problems.
Problems encountered
13%
code coverage because it fails to include everything and it seems to fail to exclude tests (ignore_tests = true
). This needs to be fixed / worked around.It is possible that there is a lot more work to be done upstream before we need to really do anything here - in particular, see the master issue about Misses in coverage. So in the interest of having a place to resume from down the line, I am stashing knowledge here for a potentially ambitious future me, or anyone who wants to play with this.
It's a minor nice-to-have CI issue (tarpaulin and the actions are already great helpers!) and it's not really costing us anything real by lagging behind for another year or three. At least as long as the nodejs 12 deprecation issue on CI from the action becomes breaking.
The text was updated successfully, but these errors were encountered: