Skip to content

fix(test): use VFS file redirect for stdin without trailing newline in coreutils diff harness - #2065

Merged
chaliy merged 2 commits into
mainfrom
claude/kind-rubin-x86crv
Jun 15, 2026
Merged

chaliy merged 2 commits into
mainfrom
claude/kind-rubin-x86crv

Conversation

@chaliy

@chaliy chaliy commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Heredoc closes only when delimiter appears alone on a line; stdin without a trailing \n caused the marker to concatenate with the last content byte (e.g. three__BK_DIFF_EOF__), which bash does not recognise as the terminator — corrupting the input to the builtin under test
  • Fix: detect this case in run_bashkit, mount the payload as a VFS file, and use < /path redirect so the exact bytes (including absent trailing newline) are preserved
  • Fixes tac_no_trailing_newline differential test that was introduced in the previous commit and immediately failing in the Coreutils Args Drift CI job

Test plan

  • cargo test -p bashkit --test integration -- coreutils_differential_tests:: — all 21 tests pass locally
  • cargo fmt --check — clean
  • cargo clippy -p bashkit --tests --features http_client,ssh,sqlite -- -D warnings — clean
  • Coreutils Args Drift workflow passes with BASHKIT_RUN_COREUTILS_DIFF=1 set

…n coreutils diff harness

Heredoc requires the delimiter on its own line; when stdin has no trailing
newline the marker concatenates with the last byte (e.g. three__BK_DIFF_EOF__)
which bash does not recognise as the terminator, corrupting the input.
Detect this case, mount the payload as a VFS file, and use < redirect so
the exact bytes are preserved. Fixes tac_no_trailing_newline differential test.
Copilot AI review requested due to automatic review settings June 15, 2026 09:20
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit c4c7c17 Commit Preview URL

Branch Preview URL
Jun 15 2026, 09:29 AM

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes a differential-test harness edge case where stdin payloads without a trailing newline caused the heredoc terminator to be concatenated with the last byte of input, corrupting stdin for the command under test. The harness now uses a VFS-mounted stdin payload file and redirects stdin from that file when needed, preserving exact bytes.

Changes:

  • Add a dedicated VFS path constant for stdin payload redirection.
  • Detect stdin payloads without a trailing newline and mount them as a VFS file.
  • Switch command construction to use either a heredoc (newline-terminated payloads) or < /path redirection (no trailing newline).

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

@chaliy
chaliy merged commit a0e6162 into main Jun 15, 2026
25 checks passed
@chaliy
chaliy deleted the claude/kind-rubin-x86crv branch June 15, 2026 09:38
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