Skip to content

refactor(contest): extract run_container_with_console helper into test_utils - #3693

Open
aniketch07 wants to merge 1 commit into
youki-dev:mainfrom
aniketch07:issues/3529
Open

refactor(contest): extract run_container_with_console helper into test_utils#3693
aniketch07 wants to merge 1 commit into
youki-dev:mainfrom
aniketch07:issues/3529

Conversation

@aniketch07

Copy link
Copy Markdown

Closes #3529

Extracts the detached-run + console-socket handling (run -d --console-socket) out of CrTestContext::start into a reusable global helper run_container_with_console in tests/contest/contest/src/utils/test_utils.rs, as agreed in the review of #3493.

  • New pub fn run_container_with_console(runtime_path, bundle_path, container_id) in utils/test_utils.rs
  • CrTestContext::start now delegates to it (removes the TODO referencing [Refactor]: Extract Checkpoint/Restore terminal spawn logic into test_utils.rs #3529)
  • Re-exported via utils/mod.rs; handle_console_socket re-export dropped (fn stays pub in test_utils)
  • Also removes a stale console.sock before binding, mirroring the restore path

Validation:

  • cargo check -p contest --all-targets
  • cargo clippy -p contest --all-targets --all-features -- -D warnings
  • cargo fmt -p contest -- --check

Note: local cargo test --no-run link needs libseccomp (missing in this WSL env); code compiles clean and CI runners have it.

cc maintainers — no rush.

@saku3 saku3 added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 17, 2026
…t_utils

Signed-off-by: aniketch07 <caniket1307@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor]: Extract Checkpoint/Restore terminal spawn logic into test_utils.rs

2 participants