Skip to content

type-c-service/tests: Convert std/ucsi example into integration test#886

Open
RobertZ2011 wants to merge 4 commits into
OpenDevicePartnership:stable-v0.1.yfrom
RobertZ2011:type-c-back-port-ucsi
Open

type-c-service/tests: Convert std/ucsi example into integration test#886
RobertZ2011 wants to merge 4 commits into
OpenDevicePartnership:stable-v0.1.yfrom
RobertZ2011:type-c-back-port-ucsi

Conversation

@RobertZ2011

Copy link
Copy Markdown
Contributor

No description provided.

@RobertZ2011 RobertZ2011 self-assigned this Jun 10, 2026
@RobertZ2011 RobertZ2011 force-pushed the type-c-back-port-ucsi branch from f690595 to 9dabda1 Compare June 10, 2026 22:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 migrates the previous examples/std UCSI workflow into a type-c-service integration test, so UCSI behavior is exercised under cargo test rather than via a standalone example binary.

Changes:

  • Added a new Tokio-based integration test (type-c-service/tests/ucsi.rs) that drives PPM/LPM commands and validates emitted UCSI CCI events.
  • Removed the old std example binary (examples/std/src/bin/type_c/ucsi.rs) and its [[bin]] entry.
  • Enabled PartialEq/Eq on UCSI-related response/message types to support equality assertions in tests, and adjusted the crate’s log feature wiring.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
type-c-service/tests/ucsi.rs New UCSI integration test covering PPM reset/notification enable and per-port connect/status/ack flows.
type-c-service/tests/common/mod.rs Increased the shared integration-test timeout constant.
type-c-service/Cargo.toml log feature now also enables power-policy-service/log (used by the integration test harness).
examples/std/src/bin/type_c/ucsi.rs Removed the std UCSI example implementation (superseded by the integration test).
examples/std/Cargo.toml Removed the type-c-ucsi bin target entry.
embedded-service/src/type_c/external.rs Added PartialEq/Eq to UcsiResponse for test assertions.
embedded-service/src/type_c/comms.rs Added PartialEq/Eq to Type-C comms message types for test assertions.

Comment thread embedded-service/src/type_c/comms.rs Outdated
Comment thread type-c-service/tests/common/mod.rs
Comment thread type-c-service/tests/ucsi.rs Outdated
Comment thread type-c-service/tests/ucsi.rs Outdated
@RobertZ2011 RobertZ2011 force-pushed the type-c-back-port-ucsi branch from 135a1ce to 489fb9d Compare June 11, 2026 17:12
@RobertZ2011 RobertZ2011 marked this pull request as ready for review June 11, 2026 17:22
@RobertZ2011 RobertZ2011 requested review from a team as code owners June 11, 2026 17:22
kurtjd
kurtjd previously approved these changes Jun 11, 2026
jerrysxie
jerrysxie previously approved these changes Jun 11, 2026

@jerrysxie jerrysxie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@RobertZ2011 Are we planning to forward port some of these tests into main at some point?

Comment thread type-c-service/tests/ucsi.rs Outdated
@RobertZ2011 RobertZ2011 dismissed stale reviews from jerrysxie and kurtjd via 8190c28 June 11, 2026 18:47
@RobertZ2011

Copy link
Copy Markdown
Contributor Author

Are we planning to forward port some of these tests into main at some point?

Yeah, I currently have #826, #827, and #825 to cover this. Once the v1 PRs land, those will likely end up on @tullom to port them to main.

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.

4 participants