Skip to content

Fix all 36 skipped tests and clean up dead code (Phases 4 & 5)#29

Merged
papawattu merged 2 commits intomainfrom
phase4/fix-skipped-tests
Mar 16, 2026
Merged

Fix all 36 skipped tests and clean up dead code (Phases 4 & 5)#29
papawattu merged 2 commits intomainfrom
phase4/fix-skipped-tests

Conversation

@papawattu
Copy link
Copy Markdown
Collaborator

Summary

  • Phase 4: Fix all 36 SKIPped tests across test_phev_core (16), test_phev_pipe (10), and test_phev_service (10). All 219 tests now pass with 0 skips.
  • Phase 5: Remove 5 dead transport backend files, clean up CMakeLists.txt, delete stale branches, update docs.

Phase 4 — Source fixes

phev_core.c:

  • phev_core_getType(): XOR-decode the type byte before classifying
  • phev_core_encodeMessage(): apply XOR encoding to serialized bytes
  • phev_core_XOROutboundMessage() / xorDataOutbound(): use message->length instead of data[1]+2 so concatenated messages (e.g. start message) are fully encoded

phev_pipe.c:

  • outputChainInputTransformer: use decoded phevMessage->XOR (not message->ctx) to detect and propagate XOR; return decoded message when XOR is present
  • commandResponder: inherit XOR from transformer-set message->ctx when internal decode finds XOR=0

phev_service.c:

  • jsonInputTransformer: guard against NULL ctx->pipe
  • validateCommand(): add missing "update" operation validation

Phase 5 — Cleanup

  • Delete unused files: msg_gcp_mqtt.c/h, msg_mqtt_paho.c/h, config.h
  • Remove BUILD_TRANSPORT_BACKENDS CMake option and conditional blocks
  • Delete stale remote/local branches
  • Update AGENTS.md and TODO.md

Test results

7/7 Test suites: 219 tests, 219 pass, 0 fail, 0 skip

…e (Phase 4)

Source fixes:
- phev_core: XOR-decode type byte in getType(), apply XOR in encodeMessage(),
  use message->length in XOROutboundMessage() for concatenated messages
- phev_pipe: outputChainInputTransformer uses decoded phevMessage->XOR
  instead of message->ctx to detect and propagate XOR; returns decoded
  message when XOR is present. commandResponder inherits XOR from
  transformer-set message->ctx when decode finds XOR=0.
- phev_service: guard against NULL ctx->pipe in jsonInputTransformer;
  add 'update' operation validation in validateCommand()

Test fixes:
- test_phev_core: remove 16 SKIPs, fix expected values for XOR-aware
  encoding/decoding
- test_phev_pipe: remove 10 SKIPs, add connect-fail stub for
  waitForConnection timeout test
- test_phev_service: remove 10 SKIPs, fix expected JSON output formats

All 219 tests pass with 0 skips.
- Delete unused sources: msg_gcp_mqtt.c/h, msg_mqtt_paho.c/h, config.h
- Remove BUILD_TRANSPORT_BACKENDS option and conditional blocks from CMakeLists.txt
- Delete stale remote branches (phase2/test-migration, add-license-1,
  register_fix, robustxor) and local branches (phase1-3)
- Update AGENTS.md: remove transport backend references, reflect 219/219
  test count with 0 skips
- Update TODO.md: mark Phases 4 and 5 complete
@papawattu papawattu force-pushed the phase4/fix-skipped-tests branch from 8322c1e to 51a0c01 Compare March 16, 2026 21:08
@papawattu papawattu requested a review from Copilot March 16, 2026 21:09
@papawattu papawattu merged commit 4f4dfee into main Mar 16, 2026
4 checks passed
@papawattu papawattu deleted the phase4/fix-skipped-tests branch March 16, 2026 21:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes Phases 4 & 5 of the restructure work by eliminating all previously skipped phev test cases (now 219/219 passing) via XOR/pipe/service fixes, and then removing dead transport backend code and related build/install options.

Changes:

  • Fix XOR handling across core encode/decode and pipe transformer/responder paths so encrypted messages are classified/encoded/propagated correctly.
  • Unskip and correct expected bytes in test_phev_core, test_phev_pipe, and test_phev_service to validate the repaired behavior.
  • Remove unused MQTT/GCP transport backend sources/headers and simplify CMake + docs + ignore patterns.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/test_phev_service.c Unskips service tests; adds NULL-ctx guard coverage; updates expected XORed bytes.
test/test_phev_pipe.c Unskips pipe tests; adds failing connect stub to exercise timeout logic.
test/test_phev_core.c Unskips core tests; updates expected commands/XOR/checksum behaviors.
src/phev/phev_service.c Adds operation.update validation and guards jsonInputTransformer against NULL pipe ctx.
src/phev/phev_pipe.c Adjusts XOR detection/propagation; attempts to return decoded messages for XOR inputs.
src/phev/phev_core.c Fixes XOR-aware type decoding, outbound encoding XOR application, and outbound XOR length handling.
CMakeLists.txt Removes BUILD_TRANSPORT_BACKENDS option and related sources/install blocks.
TODO.md Marks phases complete and documents the fixes applied.
AGENTS.md Updates test status and removes references to the deleted transport backends option.
.gitignore Ignores build variants, tool state, and core dumps.
src/msg/msg_mqtt_paho.c Deleted dead transport backend implementation.
src/msg/msg_gcp_mqtt.c Deleted dead transport backend implementation.
include/msg/msg_mqtt_paho.h Deleted dead transport backend header.
include/msg/msg_gcp_mqtt.h Deleted dead transport backend header.
include/msg/config.h Deleted stale/unused config header.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +284 to +285
LOG_V(APP_TAG, "END - outputChainInputTransformer (decoded)");
return decoded;
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