test(e2e): add end-to-end coverage for kmeshctl log - #1942
shreyaabaranwal wants to merge 2 commits into
Conversation
Signed-off-by: shreyaabaranwal <shreyabaranwal229@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @shreyaabaranwal! It looks like this is your first PR to kmesh-net/kmesh 🎉 |
Codecov Report✅ All modified and coverable lines are covered by tests. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
Update: I wasn't able to complete a live kind-cluster run in my local |
|
Adding label DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What this does
Adds e2e coverage for
kmeshctl log(list loggers, get a logger's level,set a logger's level, and reject an invalid
--setvalue) , currentlythe only test coverage for this command is a narrow unit test for
URL-building in
ctl/log/log_test.go. No production code changes.Context
Follows the same focused, single-command pattern proposed in #1819 for
kmeshctl dump. An earlier broader attempt (#1316) covering multiplekmeshctl subcommands stalled on merge-commit/rebase issues rather than
the code itself; this PR incorporates the review feedback given there by
@YaoZengzeng: gofmt-clean, asserting on actual output content rather
than printing it, polling via
retry.UntilSuccessinstead oftime.Sleep, and a single parameterized helper instead ofper-subcommand duplicates. The "set" subtest restores the logger's
original level via
t.Cleanupso it doesn't leak state into othertests.
Testing
gofmt -lis clean.go build -tags integ ./test/e2e/...andgo vet -tags integ ./test/e2e/...pass.implementation (
ctl/log/log.goandpkg/status/status_server.go)and against the existing
kmeshctl log --setassertions already madeby
test/e2e/run_test.shitself.environment before opening this PR (an environment issue on my end,
unrelated to this code) and will do so before this is merged . I'll
update this PR with confirmation once that run passes, and am happy to
hold off on merge until then.
Special notes for your reviewer
This test was drafted with the assistance of Claude (Anthropic), based
on patterns already present in this repo's e2e suite
(
test/e2e/restart_test.go,test/e2e/main_test.go) and incorporatingthe review feedback previously given on PR #1316. As noted above, I have
not yet completed a live kind-cluster run of this test . I'll confirm
that separately before merge. I'm happy to walk through any part of the
implementation.