Skip to content

test(gh skill install): skip control character filename test on Windows - #15172

Merged
babakks merged 1 commit into
trunkfrom
babakks/fix-skill-install-windows-test
Nov 26, 2026
Merged

babakks merged 1 commit into
trunkfrom
babakks/fix-skill-install-windows-test

Conversation

@babakks

@babakks babakks commented Nov 26, 2026

Copy link
Copy Markdown
Member

Description

TestPrintFileTreeEscapesFileNameControlCharacters fails on the Windows CI runners before it reaches the code under test. The test checks that printFileTree escapes terminal control sequences in file and directory names. To do that, it creates a directory named a\x1b[31mdir and a file named b\x1b[31mfile on disk. Windows does not allow characters with values 1 through 31 in file or directory names (naming conventions). ESC (\x1b, value 27) is one of them, so os.MkdirAll fails during setup:

mkdir ...\poc\adir: The filename, directory name, or volume label syntax is incorrect.

This PR skips the test on Windows and adds a comment explaining why.

How did you test this change?

Not tested on Windows. I cross-compiled the package's tests for Windows to confirm they build, but I did not run them on a Windows machine. On Linux, the test still runs and passes.

Key points

This does not hide a failure. The skip only applies where the test's scenario cannot exist. A Windows filesystem cannot hold a name containing control characters, so printFileTree can never read one there, and the escaping it checks cannot be exercised on Windows. On Linux and macOS, such names are valid and a malicious skill could contain them, so the test still runs there with the same coverage.

Notes for reviewers

The whole change is in pkg/cmd/skills/install/install_test.go. I also searched the other tests for fixtures that create files or directories with control characters in their names and found none. Elsewhere, control characters appear only in file contents, mocked API data, or names that are sanitized before being written.

Authorship and follow-up

Who wrote this:

  • A human wrote it.
  • An agent wrote it under close human direction.
  • An agent wrote it independently, and no human has guided the implementation beyond the initial prompt.

Who answers review comments:

  • @babakks will read and reply directly. Name the account.
  • An agent will draft replies and @babakks will read them before they are posted.
  • Nobody has explicitly committed to replying.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3ef5a317-d6f3-4f5e-a03e-dffef5fdf9bd
@babakks
babakks requested review from a team as code owners November 26, 2026 12:38
@babakks
babakks requested review from niik and a balanced review from Copilot November 26, 2026 12:38
@babakks
babakks enabled auto-merge November 26, 2026 12:39

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.

🟢 Approval recommended

No active review issues were identified with the Windows-only skip for the control-character filename test.

No open issues 🎉

What changed in this PR

This PR prevents a Windows-only setup failure in the skill-install filename-escaping test without changing production behavior.

Changes:

  • Adds a Windows-only skip before creating filenames containing ESC characters.
  • Documents the filesystem restriction while preserving the test on other platforms.
File Description
pkg/​cmd/​skills/​install/​install_test.go Imports runtime and adds a documented Windows skip to the control-character filename test.

Review effort: Balanced

@babakks
babakks merged commit b620bf7 into trunk Nov 26, 2026
19 checks passed
@babakks
babakks deleted the babakks/fix-skill-install-windows-test branch November 26, 2026 12:47
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.

3 participants