Skip to content

client: add seamed unit tests for onboarding loop#5958

Open
eriknordmark wants to merge 1 commit into
lf-edge:masterfrom
eriknordmark:client-phase2-tests
Open

client: add seamed unit tests for onboarding loop#5958
eriknordmark wants to merge 1 commit into
lf-edge:masterfrom
eriknordmark:client-phase2-tests

Conversation

@eriknordmark

@eriknordmark eriknordmark commented May 13, 2026

Copy link
Copy Markdown
Contributor

Description

Cover the network-facing and side-effect-bearing parts of the
onboarding loop using the seams introduced earlier: HTTP request
classification and LED transitions, the register/UUID-fetch outcomes,
controller-cert prefetch with checkpoint comparison, the post-loop
hostname/UUID/hardwaremodel publishing, and the DNS-status handler's
state-transition + proxy-cert propagation paths.

Package statement coverage rises from 0 % to 53.66 % (242/451)
across the Phase-1 (#5957) and Phase-2 sets combined. Each function the
new tests target reaches 80-100%; the remaining dark code is the
top-level event loop and adapter wiring, reached by Eden e2e tests in
lf-edge/eden#1178.

With the Eden e2e suite included, pkg/pillar/cmd/client combined
block coverage reaches 85.59 % (386/451, dedup'd across unit and
e2e profiles).

Depends on #5957.

How to test and validate this PR

go test -count=1 -cover ./pkg/pillar/cmd/client/... from the pillar module.

Changelog notes

No user-facing changes.

PR Backports

  • 16.0-stable: No.
  • 14.5-stable: No.
  • 13.4-stable: No.

Checklist

  • I've provided a proper description
  • I've written the test verification instructions

@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.33%. Comparing base (115009c) to head (34155cf).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5958      +/-   ##
==========================================
+ Coverage   22.69%   23.33%   +0.63%     
==========================================
  Files         507      517      +10     
  Lines       93195    94911    +1716     
==========================================
+ Hits        21151    22147     +996     
- Misses      70317    70842     +525     
- Partials     1727     1922     +195     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

Comment thread pkg/pillar/cmd/client/mypost_test.go Outdated
wantLed: []types.LedBlinkCount{types.LedBlinkOnboarded},
},
{
name: "200 unparseable content-type",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@eriknordmark , pls, fix the typo below

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 169d88c91unparseableunparsable.

@eriknordmark
eriknordmark force-pushed the client-phase2-tests branch 3 times, most recently from 7e8cdfb to 866dee0 Compare July 16, 2026 13:29
@eriknordmark
eriknordmark requested a review from rene July 20, 2026 20:27
@eriknordmark
eriknordmark force-pushed the client-phase2-tests branch 2 times, most recently from 2deedfa to 5518c42 Compare July 20, 2026 22:07
@eriknordmark eriknordmark added the testing New test or test framework changes label Jul 20, 2026
Cover the network-facing and side-effect-bearing parts of the
onboarding loop using the seams introduced earlier: HTTP request
classification and LED transitions, the register/UUID-fetch outcomes,
controller-cert prefetch with checkpoint comparison, the post-loop
hostname/UUID/hardwaremodel publishing, and the DNS-status handler's
state-transition + proxy-cert propagation paths.

Package statement coverage rises from ~10% to ~54%. Each function the
new tests target reaches 80-100%; the remaining dark code is the
top-level event loop and adapter wiring, reached by Eden e2e tests in
a follow-up.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@eriknordmark
eriknordmark force-pushed the client-phase2-tests branch from 5518c42 to 34155cf Compare July 21, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing New test or test framework changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants