Skip to content

tests: Read the exfatprogs version from stderr too - #1227

Merged
vojtechtrefny merged 1 commit into
storaged-project:masterfrom
davidvornholt:exfatprogs-version-stderr
Nov 14, 2026
Merged

vojtechtrefny merged 1 commit into
storaged-project:masterfrom
davidvornholt:exfatprogs-version-stderr

Conversation

@davidvornholt

@davidvornholt davidvornholt commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Hi! Since exfatprogs 1.4.4, mkfs.exfat --version prints the exfatprogs version to stderr and only the libblkid version to stdout (exfatprogs commit). _get_exfatprogs_version in exfat_test.py only searched stdout, so all seven exFAT test classes error out in setup. exfatprogs 1.4.4 reached Fedora Rawhide on November 10 and Fedora 45 on November 13, so the libblockdev test jobs on Fedora now fail this way on every pull request, for example on Rawhide in #1224 and on Fedora 45 and Rawhide in #1226. This change searches both outputs.

Fixes #1225

The library itself isn't affected: mkfs.exfat --version exits with 1, and bd_utils_check_util_version then searches both stdout and stderr.

I ran _get_exfatprogs_version with the real run_command against exfatprogs 1.3.2 and 1.4.4. It returns the right version for both, and without the change it raises the error from the issue with 1.4.4. I didn't run the exFAT test classes themselves, because I can't run the suite as root here.

I used Claude Code (Claude Opus 5.5) to investigate, write and test this change and this description, and reviewed both myself.

I reviewed this first in my fork, in davidvornholt#2. The code is unchanged since then.

Summary by CodeRabbit

  • Bug Fixes
    • Improved detection of the exFAT formatting tool’s version when it reports the version on standard error. Missing or unexpected version output now produces a clearer error.

Since exfatprogs 1.4.4, "mkfs.exfat --version" prints the exfatprogs
version to stderr and only the libblkid version to stdout, so the
version check failed and all exFAT test classes errored out in setup.

Fixes: storaged-project#1225

Assisted-by: Claude Code (Claude Opus 5.5)
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The exFAT test helper now searches both standard output and standard error for the mkfs.exfat --version result. If version parsing fails, the error reports the combined output.

Changes: exfatprogs Version Detection

Layer / File(s) Summary
Version output parsing
tests/fs_tests/exfat_test.py
The helper searches standard output and standard error together. If parsing fails, it includes both streams in the error message.

Estimated code review effort: 2 (Simple) | ~5 minutes

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 2094c

This fixes the exFAT test setup failure with exfatprogs 1.4.4, where the version is printed to stderr. It does not affect library behavior, and no merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "tests: Read the exfatprogs version from stderr too" matches the changeset. The change makes _get_exfatprogs_version() in tests/fs_tests/exfat_test.py search both stdout and stderr for the v…
Linked Issues check Passed Directly linked issue #1225 requires the test suite to run with exfatprogs 1.4.4. The failure occurs because _get_exfatprogs_version() in tests/fs_tests/exfat_test.py searches only stdout. With exfa…
Out of Scope Changes check Passed The whole-PR diff against the merge base changes one file, tests/fs_tests/exfat_test.py, and only the _get_exfatprogs_version() helper (+5/-3 lines). Each change serves issue #1225: reading stderr, …
Full details: Title check

Explanation

The title "tests: Read the exfatprogs version from stderr too" matches the changeset. The change makes _get_exfatprogs_version() in tests/fs_tests/exfat_test.py search both stdout and stderr for the version string, which fixes the seven exFAT test classes that error in setup with exfatprogs 1.4.4 (linked issue #1225). The title is short, specific, and states the main change.

Full details: Linked Issues check

Explanation

Directly linked issue #1225 requires the test suite to run with exfatprogs 1.4.4. The failure occurs because _get_exfatprogs_version() in tests/fs_tests/exfat_test.py searches only stdout. With exfatprogs 1.4.4, the version line goes to stderr, so the seven exFAT setUpClass calls raise RuntimeError. The diff now sets output = out + "\n" + err and searches that combined text with the same regex. The version line is found in either stream, so the setup failure from #1225 no longer occurs. The error message also reports the combined output. The PR does not run the exFAT test classes. The helper change and the reported manual check of the helper with exfatprogs 1.3.2 and 1.4.4 support the fix. No other coding requirement appears in the issue.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes one file, tests/fs_tests/exfat_test.py, and only the _get_exfatprogs_version() helper (+5/-3 lines). Each change serves issue #1225: reading stderr, combining both streams, updating the comment, and updating the error text to show the searched output. No unrelated code or other files are touched.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ced1904 and 2094ce6.

Files selected for processing: 1

  • tests/fs_tests/exfat_test.py

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@vojtechtrefny vojtechtrefny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@vojtechtrefny
vojtechtrefny merged commit 6e7d52d into storaged-project:master Nov 14, 2026
41 of 42 checks passed
@davidvornholt
davidvornholt deleted the exfatprogs-version-stderr branch November 16, 2026 12:49
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.

Test suite fails with exfatprogs 1.4.4

2 participants