Skip to content

Add mockgrbl jog completion and limit rejection tests#76

Merged
ianbruene merged 1 commit into
masterfrom
codex/add-jogto-integration-tests-for-mockgrbl
Jul 15, 2026
Merged

Add mockgrbl jog completion and limit rejection tests#76
ianbruene merged 1 commit into
masterfrom
codex/add-jogto-integration-tests-for-mockgrbl

Conversation

@ianbruene

Copy link
Copy Markdown
Owner

Motivation

  • Extend the existing Linux-only mockgrbl_e2e integration suite to cover two high-value jog behaviors: natural JogTo completion at a target and out-of-bounds JogTo rejection without starting motion.
  • Keep changes scoped to the integration test package and small test helpers so tests remain CI-safe, do not require UI or hardware, and avoid timing fragility.

Description

  • Add TestDDGoJogToEndpointCompletesAgainstMock which issues controller.JogTo(ctx, "X", -1.0, 60), waits for the mock to reach Idle with no active move/queue and machine X near -1.0, then verifies the DDGo controller snapshot matches the completed position.
  • Add TestDDGoJogLimitRejectionAgainstMock which issues an out-of-bounds controller.JogTo(ctx, "X", -999.0, 60), asserts the mock remains Idle with no motion and machine X near the baseline, and verifies the mock emitted a jog-limit response like [MSG:jogLIM] / error:15.
  • Introduce small test helpers: typed mockLogEntry, shared tolerance posTol, generic getJSON/fetchJSON helpers, responses/events accessors, richer dumpDiagnostics, and bounded polling helpers waitForMockState and waitForControllerState that avoid fixed long sleeps and provide last-state diagnostics on timeout.
  • Preserve existing constraints: tests remain under the linux && serial && mockgrbl_e2e build tags, use the real serial transport via the harness, and do not modify mockgrbl or production controller behavior.

Testing

  • Ran go test -tags 'serial mockgrbl_e2e' ./internal/integration/mockgrbl and the integration tests passed.
  • Ran go test ./... and the full test suite passed.
  • Ran go test -tags serial ./internal/transport ./internal/ports ./internal/app ./internal/grbl and those package tests passed.

Codex Task

@ianbruene
ianbruene merged commit 41d46bc into master Jul 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant