Skip to content

test(device): fold EndToEndTests into DaqifiDeviceWithTransportTests - #794

Merged
tylerkron merged 2 commits into
mainfrom
cursor/delete-duplicate-e2e-tests-5d03
Sep 27, 2026
Merged

tylerkron merged 2 commits into
mainfrom
cursor/delete-duplicate-e2e-tests-5d03

Conversation

@tylerkron

@tylerkron tylerkron commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

src/Daqifi.Core.Tests/Integration/EndToEndTests.cs was a stray one-file folder whose four facts overlapped the device transport tests that live next to the production code. Two facts were pure duplicates. The other two pinned behavior nothing else covers, so they move into DaqifiDeviceWithTransportTests instead of being dropped. The file, its private MockMemoryStreamTransport (a copy of MockStreamTransport), and the Integration folder go away. No project, solution, CI or filter plumbing referenced the folder.

Deleted (already covered)

  • EndToEnd_DeviceWithStreamConstructor_ShouldMaintainBackwardCompatibility is identical to DaqifiDeviceWithMessageProducerTests.DaqifiDevice_SendMessage_WhenConnected_ShouldWriteToStream: stream constructor, connect, send SYSTem:SYSInfoPB?, disconnect, assert on the stream.
  • EndToEnd_MessageProducerLifecycle_ShouldHandleStartStopCorrectly connects, sends, disconnects twice onto the same MemoryStream. DaqifiDevice_DisconnectThenConnect_SendsToCurrentTransportStream is stronger. It rotates the transport stream between cycles and requires the post-reconnect send to land on the new one. Connect writes nothing to the stream itself, so its NotEmpty check really is the second send.

Kept, moved next to DaqifiDevice_WithMockTransport_ShouldConnectAndSendMessages

  • EndToEnd_MockTransport_ShouldDeliverSCPICommands → DaqifiDevice_Disconnect_FlushesEveryQueuedCommandInOrder. The twin sends one command. A single write can already be done before Disconnect runs, so it cannot tell a Disconnect that drains the producer queue (StopSafely) from one that clears it (Stop). MessageProducerTests pin multi-message draining at the producer level, not through DaqifiDevice.Disconnect. The moved fact queues four commands through device.Send and then disconnects. It now also asserts they reach the stream in order (it used Contains before). The status-event assertions are dropped because the twin already makes exactly those.
  • EndToEnd_MultipleDevices_ShouldWorkIndependently → DaqifiDevice_TwoDevicesOnSeparateTransports_EachWritesOnlyToItsOwnStream. No other test connects two DaqifiDevice instances at once. If a producer, queue or stream ever got shared between instances, this is the only test that would catch it.

Both use the class's existing MockStreamTransport, which gains a GetWrittenContent() helper.

Out of scope

No production changes. No edits to ConnectionGuard, LiveCsv, Firmware or StreamMessageConsumer tests.

Open in Web Open in Cursor 

🤖 Generated with Claude Code

The four facts and private MockMemoryStreamTransport repeat
DaqifiDeviceWithTransportTests and DaqifiDeviceWithMessageProducerTests.
Command strings stay pinned in ScpiMessageProducerTests.

Co-authored-by: Tyler Kron <tylerkron@gmail.com>
…their twin

Two of the four deleted EndToEndTests facts pinned behavior no other test
covers: that Disconnect drains several queued commands (in order) rather
than dropping the queue, and that two connected devices each write only to
their own stream. Move both into DaqifiDeviceWithTransportTests on its
existing MockStreamTransport; the order check is new.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tylerkron tylerkron changed the title test(device): drop duplicate EndToEndTests coverage test(device): fold EndToEndTests into DaqifiDeviceWithTransportTests Sep 27, 2026
@tylerkron
tylerkron marked this pull request as ready for review September 27, 2026 17:12
@tylerkron
tylerkron requested a review from a team as a code owner September 27, 2026 17:12
@tylerkron

Copy link
Copy Markdown
Contributor Author

/agentic_review

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Consolidate device end-to-end tests with transport tests

🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Move queued-command draining and two-device isolation coverage into the device transport tests.
• Strengthen queued-command coverage by asserting every command reaches the stream in order.
• Remove duplicate end-to-end tests and their redundant mock transport.
Diagram

graph TD
  T["Device transport tests"] --> D1["Device A"] --> P1["Producer A"] --> M1["Mock transport A"]
  T --> D2["Device B"] --> P2["Producer B"] --> M2["Mock transport B"]
Loading
High-Level Assessment

Consolidating the distinct behavioral checks beside existing transport tests preserves coverage while eliminating a duplicate mock and test fixture. Keeping a separate integration suite would add maintenance cost without testing a different boundary.

Files changed (1) +57 / -0

Tests (1) +57 / -0
DaqifiDeviceWithTransportTests.csPreserve command-draining and device-isolation coverage +57/-0

Preserve command-draining and device-isolation coverage

• Adds a helper to read the existing mock transport's captured output. Adds tests that verify disconnect delivers four queued commands in order and that two connected devices write only to their respective transports.

src/Daqifi.Core.Tests/Device/DaqifiDeviceWithTransportTests.cs

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@tylerkron

Copy link
Copy Markdown
Contributor Author

Qodo-clean, CI green — ready for review

@tylerkron
tylerkron added this pull request to the merge queue Sep 27, 2026
Merged via the queue into main with commit 28e6428 Sep 27, 2026
4 checks passed
@tylerkron
tylerkron deleted the cursor/delete-duplicate-e2e-tests-5d03 branch September 27, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants