Skip to content

runtime: improvement/test struct for api mode watcher#2022

Open
daemonfire300 wants to merge 9 commits into
kube-rs:mainfrom
daemonfire300:runtime-improvement/test-struct-for-api-mode-watcher
Open

runtime: improvement/test struct for api mode watcher#2022
daemonfire300 wants to merge 9 commits into
kube-rs:mainfrom
daemonfire300:runtime-improvement/test-struct-for-api-mode-watcher

Conversation

@daemonfire300

Copy link
Copy Markdown

Motivation

Motivation is #1528
Instead of reviving the stale PR I attempted a new approach from scratch.

Solution

IMPORTANT NOTE: Contains unrelated files that are currently tracked in git because they have to be otherwise my devShell does not work (flake, nix, direnv). So feel free to ignore the flake.nix+flake.lock, if you want me to and like the nix devShell I can put that on a dedicated second PR. Also added a helper and git hooks for myself to have a Cargo.lock on hand, because I prefer having one when developing within a nix devShell, makes it more reproducible. I.e., I am going to remove those files from the PR later.

It's not much and the change is NOT complete, before continuing I wanted to discuss the "interface" and behaviour of test struct(s). For example does the Duration i.e., ability to sleep/wait between calls to watch make sense, are we missing something to model a certain test. (Also I am not 100% sure whether the location of where I put the tests is the desired location for using that test struct.)

Happy to receive feedback.

@daemonfire300 daemonfire300 force-pushed the runtime-improvement/test-struct-for-api-mode-watcher branch 2 times, most recently from 2c81908 to ea52878 Compare June 26, 2026 17:39
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.72093% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.4%. Comparing base (8e2c23e) to head (b14d9f2).

Files with missing lines Patch % Lines
kube-runtime/src/watcher.rs 83.8% 14 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2022     +/-   ##
=======================================
+ Coverage   77.3%   77.4%   +0.1%     
=======================================
  Files         89      89             
  Lines       9016    9102     +86     
=======================================
+ Hits        6967    7038     +71     
- Misses      2049    2064     +15     
Files with missing lines Coverage Δ
kube-runtime/src/watcher.rs 65.2% <83.8%> (+6.4%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@daemonfire300

Copy link
Copy Markdown
Author

cc @mateiidavid since you have been on the old PR.

@doxxx93 doxxx93 requested a review from mateiidavid June 27, 2026 15:32
@daemonfire300

daemonfire300 commented Jun 27, 2026

Copy link
Copy Markdown
Author

I ll try to do a proper fix of the clippy issues tomorrow. Caught me by surprise because afaik just clippy does not run for --test and I get a bit of unrelated fallout from files I did not touch as well.

@doxxx93 doxxx93 force-pushed the runtime-improvement/test-struct-for-api-mode-watcher branch from e9269b5 to e932559 Compare June 27, 2026 21:55
@doxxx93

doxxx93 commented Jun 27, 2026

Copy link
Copy Markdown
Member

Don't worry about the msrv failure, it's unrelated to your PR. enum-ordinalize 4.4.0 (via educe) just raised its MSRV to 1.89, which breaks our 1.88 check on any lockfile-less resolve.

cc) @clux should we consider CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS ?

Signed-off-by: Julius Foitzik <info@accountr.eu>
Issue: kube-rs#1528

Signed-off-by: Julius Foitzik <info@accountr.eu>
Signed-off-by: Julius Foitzik <info@accountr.eu>
Signed-off-by: Julius Foitzik <info@accountr.eu>
Signed-off-by: Julius Foitzik <info@accountr.eu>
Signed-off-by: Julius Foitzik <info@accountr.eu>
Signed-off-by: Julius Foitzik <info@accountr.eu>
Signed-off-by: Julius Foitzik <info@accountr.eu>
Signed-off-by: Julius Foitzik <info@accountr.eu>
@daemonfire300 daemonfire300 force-pushed the runtime-improvement/test-struct-for-api-mode-watcher branch from e932559 to b14d9f2 Compare July 1, 2026 19:05
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.

2 participants