Skip to content

Conversation

@saehejkang
Copy link
Contributor

@saehejkang saehejkang commented Nov 2, 2025

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

When working on test cases for #827 and #734 the following issues occurred

  1. There was no support to pass in Data for stdin (input pipe added + new argument for the data)
  2. Pipes were getting blocked during the try process.run() and process.waitUntilExit() (order of operations were fixed)
  3. We need the binary data for directly piping the stdout data to stdin, and converting the data to a string, returns "" (added a new value to the tuple)

I opened a new PR here for this as I did not want to bloat the other PRs with so many updates. At first I thought of creating a new function named runStdinStdout, but that seemed redundant as it pretty much was going to do the same thing as run.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@jglogan
Copy link
Contributor

jglogan commented Nov 14, 2025

@saehejkang Sorry for the delay (again). Lgtm, trying a build now.

@jglogan
Copy link
Contributor

jglogan commented Nov 14, 2025

Looks like we just need this for a newly added test:

diff --git a/Tests/CLITests/Subcommands/Containers/TestCLIExec.swift b/Tests/CLITests/Subcommands/Containers/TestCLIExec.swift
index c7c9d55..17af30d 100644
--- a/Tests/CLITests/Subcommands/Containers/TestCLIExec.swift
+++ b/Tests/CLITests/Subcommands/Containers/TestCLIExec.swift
@@ -62,7 +62,7 @@ class TestCLIExecCommand: CLITest {
             // Retry loop to check if the marker file was created by the detached process
             var markerFound = false
             for _ in 0..<3 {
-                let (_, _, status) = try run(arguments: [
+                let (_, _, _, status) = try run(arguments: [
                     "exec",
                     name,
                     "test", "-f", "/tmp/detach_test_marker",

@jglogan jglogan merged commit e49a563 into apple:main Nov 15, 2025
2 checks passed
@saehejkang saehejkang deleted the refactor-cli-test-for-stdin-stdout-support branch November 15, 2025 02:37
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