Phase 3 PR 30 — Modbus integration-test project scaffold + DL205 smoke test #29
Reference in New Issue
Block a user
Delete Branch "phase-3-pr30-modbus-integration-scaffold"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scaffolds the integration-test harness
docs/v2/modbus-test-plan.mdcalled for. New project attests/ZB.MOM.WW.OtOpcUa.Driver.Modbus.IntegrationTests/with:ModbusSimulatorFixture— TCP-probesMODBUS_SIM_ENDPOINT(defaultlocalhost:502) once per test session with a 2s timeout. Emits a clearSkipReasonwhen unreachable; a collection fixture so the probe cost is amortized.DL205/DL205Profile.cs— tag-map stub reflecting the first target device (AutomationDirect DL205). Writable holding register at address 100 (avoids the pending register-zero quirk). Probe loop disabled on the driver instance so background polls don't race assertions.DL205/DL205SmokeTests.cs— one happy-path write → read round-trip exercising the realModbusDriver+ realModbusTcpTransport. No quirk-specific assertions yet — those land one-per-PR as the user validates each behavior in ModbusPal.ModbusPal/README.md— dev-loop instructions (install jar, load profile, start simulator,dotnet test) +MODBUS_SIM_ENDPOINToverride doc for pointing at a real PLC on the bench.DL205.xmppprofile file is flagged as a follow-up PR alongside the first confirmed quirk.Conventions honored
Assert.Skip(sim.SkipReason)(not silent return) — reads cleanly in CI logs.DL205_prefix on test names so--filter "DisplayName~DL205"surfaces device-specific failures.Test run
SkipReason surfaces: 'Modbus simulator at localhost:502 did not accept a TCP connection within 2s. Start ModbusPal (or override MODBUS_SIM_ENDPOINT) and re-run.' Build clean — 0 warnings, 0 errors.
Next PRs
docs/v2/modbus-test-plan.mdrenumbered future quirk PRs to start at PR 31+. Each confirmed DL205 quirk gets one named test + any driver-side adjustment needed to pass it. DropDL205.xmppintoModbusPal/alongside the first quirk PR.Registered
ZB.MOM.WW.OtOpcUa.slnxlists the new project undertests/.ModbusSimulatorFixture is a collection fixture so the 2s TCP probe runs once per run, not per test; SkipReason gets a clear operator-facing message ('start ModbusPal or override MODBUS_SIM_ENDPOINT'). Tests call Assert.Skip(sim.SkipReason) rather than silently returning — matches the test-plan convention and reads cleanly in CI logs. DL205Profile.BuildOptions deliberately disables the background probe loop since integration tests drive reads explicitly and the probe would race with assertions. Tag naming uses the DL205_ prefix so filter 'DisplayName~DL205' surfaces device-specific failures at a glance. Project references: xunit.v3 + Shouldly + Microsoft.NET.Test.Sdk + xunit.runner.visualstudio (matches the existing Driver.Modbus.Tests unit project), project ref to src/Driver.Modbus. Registered in ZB.MOM.WW.OtOpcUa.slnx under tests/. ModbusPal/README.md documents the dev loop (install ModbusPal jar, load profile, start simulator, dotnet test), explains MODBUS_SIM_ENDPOINT override for real-PLC benchwork, and flags DL205.xmpp as the first profile to add in a follow-up PR. dotnet test run against the scaffold (no simulator running) skips cleanly: 0 failed, 0 passed, 1 skipped, with the SkipReason surfaced. dotnet build clean (0 warnings, 0 errors). Updated docs/v2/modbus-test-plan.md to mark the scaffold PR done and renumbered future PRs from 'PR 27+' to 'PR 31+' to stay in sync with the actual PR chain. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>