test(schedule): cover the one domain with no integration test - #591
Merged
Merged
Conversation
schedule had five operations and nothing exercising them end to end, the only domain in that position. Three tests. The list smoke, matching every other domain's. A validation test proving the controller answers a malformed request itself rather than queueing it, which is read-only despite naming create: a request rejected at the API never reaches an agent, and that is the property. And a lifecycle walking one entry through all five operations, which is the only way to see that create's object reference, the name the entry is addressed by afterwards, and delete's idempotency agree. The lifecycle sits behind skipWriteOp like every other write test here, so it does not run in continuous integration. That is the existing convention rather than something this adds, and worth saying plainly: the list and validation tests are what CI gains. Verified on Linux in a container rather than left unexercised, since a test nobody has run is the thing this issue is about. On Darwin the provider reports unsupported, so the lifecycle now skips explicitly after create rather than passing on assertions that could not fail. One wrong turn worth recording. The first Linux run had every schedule job time out at the 30 second deadline while the file endpoints beside them answered, which read exactly like a dispatch bug in the domain that happens to have no integration test. It was the container: no /etc/machine-id, so the agent never started and answered nothing. The agent log said so. Reading it before filing anything is what kept a bug report about my own environment out of the tracker. Closes: #563 Refs: #590 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FuKUsHFG1EqZXamffh9M2c
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #591 +/- ##
=======================================
Coverage 99.95% 99.95%
=======================================
Files 501 501
Lines 24099 24099
=======================================
Hits 24089 24089
Misses 10 10 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #563.
schedulehad five operations and nothing exercising them end to end, the only domain in that position.Three tests
TestScheduleList— the read-only smoke every other domain has. Proves the endpoint is reachable and answers in the collection shape.TestScheduleValidationRejectsBeforeQueueing— a malformed cron expression, neitherschedulenorinterval, and a name the provider would refuse as a file name. The unit suites prove which rule fires; this proves the rejection survives the real CLI, the real client and the real middleware stack, and that the controller answers it rather than turning it into a job. Read-only despite naming create, because a request rejected at the API reaches no agent and changes nothing. That is the property being checked.TestScheduleCreateGetUpdateDelete— one entry through all five operations, including a second delete for the idempotency the provider contract claims. The lifecycle is the only way to see that create's--objectreference, the name the entry is addressed by afterwards, and delete's repeat behaviour agree with each other.What CI actually gains
The lifecycle sits behind
skipWriteOplike every write test intest/integration/, and CI runsjust go-unit-intwith noOSAPI_INTEGRATION_WRITES, so it does not run there. That is the existing convention, not something this PR introduces, but worth saying rather than implying coverage that is not there. The list and validation tests are what CI gains. The lifecycle runs on demand:OSAPI_INTEGRATION_WRITE_SCHEDULE_LIFECYCLE=1 go test -tags integration -run TestScheduleSmokeSuite ./test/integration/I ran it rather than leaving it unexercised
A test nobody has run is the thing this issue is about, so the lifecycle was run on Linux in a container:
On Darwin the provider reports unsupported, which the provider contract makes a real outcome rather than a failure. The lifecycle now reads the first result's status after create and skips explicitly when it is
skipped, instead of passing on assertions that could never have failed.I also checked that
geton a name that does not exist exits 1 with empty stdout, which is what makess.Require().Equal(0, getCode)the real assertion rather than theContainsbeside it.One wrong turn, recorded because it nearly became a bug report
The first Linux run had every schedule job time out at the 30 second deadline, 500s, while the file endpoints beside them answered normally. That reads exactly like a dispatch bug in the one domain with no integration test, which would have been a tidy story.
It was my container. No
/etc/machine-id, so the agent never started and answered nothing:The agent log said so plainly. Registration in
cmd/agent_setup.go:297is correct and the domain works.Side finding, filed not fixed
#590 — every command under
osapi client node schedulestill describes itself as operating on "cron entries" in its help text, left over from #569.osapi client node schedule list --helpsays it lists cron entries. Two of the matches are correct and should stay, since they name the cron expression format rather than the domain.just testpasses, coverage 100%. Integration suite passes on both platforms.🤖 Generated with Claude Code
https://claude.ai/code/session_01FuKUsHFG1EqZXamffh9M2c