• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubernetes-sigs / lws / 35896985935
85%

Build:
DEFAULT BRANCH: main
Ran 23 Sep 2026 05:41PM UTC
Jobs 1
Files 31
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Sep 2026 05:38PM UTC coverage: 85.296% (+16.8%) from 68.495%
35896985935

push

github

web-flow
Improving test coverage across the board  (#1074)

* Improving test coverage across the board and updating the coverage badge to point to the main branch

Signed-off-by: ahg-g <ahg@google.com>

* Fix setConditions silently dropping all conditions after the first change

setConditions accumulated its result with:

    shouldUpdate = shouldUpdate || setCondition(lws, condition)

setCondition mutates the status as a side effect, but Go short-circuits
`||`, so once shouldUpdate became true every remaining condition was never
applied.

Both updateConditions and updateStatusHash request
[UpdateInProgress, Progressing] mid-rollout, so Progressing was dropped and
only surfaced on a later reconcile. Integration tests did not catch this
because they poll conditions with Eventually{}.

Accumulate with an explicit if instead so every requested condition is
applied. Steady state is unchanged (the old code converged one reconcile
later); the fix only makes Progressing appear sooner.

Test expectations updated accordingly:
- TestSetConditionsAppliesOneConditionPerCall, which pinned the buggy
  behaviour, becomes TestSetConditionsAppliesEveryCondition and now asserts
  both conditions land in a single call and a second call is a no-op.
- TestUpdateConditions and TestUpdateStatusHash expect both Progressing and
  UpdateInProgress during a rollout.

* Add unit tests for the workload-scheduling reconcile path

failWorkloadScheduling, updateWorkloadSchedulingCondition and
NewLeaderWorkerSetReconciler had no unit coverage at all, and Reconcile was
only exercised by envtest integration tests, which the Coveralls job does
not run.

Cover the helpers directly and the spec.scheduling branch of Reconcile
end to end through a fake SchedulerProvider, asserting on what is persisted
to the API rather than on the in-memory object:

- the condition is written with the reason, message and observedGeneration
- an unchanged condition short-circuits before issuing a status update
- a fa... (continued)

7 of 8 new or added lines in 1 file covered. (87.5%)

5151 of 6039 relevant lines covered (85.3%)

39.58 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
83.62
50.91% pkg/controllers/leaderworkerset_controller.go
Jobs
ID Job ID Ran Files Coverage
1 35896985935.1 23 Sep 2026 05:41PM UTC 31
85.3
GitHub Action Run
Source Files on build 35896985935
  • Tree
  • List 31
  • Changed 16
  • Source Changed 0
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 735f22a3 on github
  • Prev Build on main (#35882554978)
  • Next Build on main (#35904405016)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc