Skip to content

test: add interop tests for --iconv with non-ASCII filter rules (#3490) - #5396

Merged
oferchen merged 4 commits into
masterfrom
test/iconv-filter-rules-interop
Jun 3, 2026
Merged

oferchen merged 4 commits into
masterfrom
test/iconv-filter-rules-interop

Conversation

@oferchen

@oferchen oferchen commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add integration tests verifying that --iconv filename transcoding interacts correctly with filter rules containing non-ASCII patterns (ICV-5 docs: comment cleanup in logging and logging-sink crates #3490)
  • Tests confirm filter evaluation operates on source-side (pre-iconv) filenames, matching upstream rsync's check_filter() -> send_file_name() ordering in exclude.c / flist.c
  • All tests gated on cfg(all(target_os = "linux", feature = "iconv")) since macOS/Windows filesystems reject raw non-UTF-8 byte sequences

Test plan

  • CI nextest passes on Linux with iconv feature enabled
  • Tests cover 8 scenarios: exclude, include, reverse direction, filter+transcode independence, no-iconv control, nested dirs, encoding mismatch edge case, mixed multi-rule chains

Verify that filter rules containing non-ASCII patterns interact
correctly with --iconv filename transcoding. Tests cover:

- Exclude patterns with non-ASCII chars preventing iconv-transcoded copy
- Include patterns with non-ASCII chars allowing files under iconv
- Filter evaluation in reverse iconv direction (Latin-1 to UTF-8)
- Surviving files correctly transcoded when filter is active
- Encoding mismatch edge case (UTF-8 pattern vs Latin-1 source names)
- Mixed include/exclude chains with multiple non-ASCII patterns
- Nested directory filtering under iconv

All tests are gated on cfg(all(target_os = "linux", feature = "iconv"))
because macOS/Windows filesystems reject raw non-UTF-8 byte sequences.
@github-actions github-actions Bot added the test label Jun 3, 2026
oferchen added 3 commits June 3, 2026 17:57
The include_non_ascii_pattern_allows_file_under_iconv test used
--include='résumé*' --exclude='*' without a directory traversal
rule. The --exclude='*' matched the source directory itself,
preventing any files from being copied. Add --include='*/' to
permit directory traversal, matching the standard upstream rsync
idiom for include+exclude-all filter chains.
On macOS, /var is a symlink to /private/var. TempDir creates paths
under /var/folders/... but emit_implied_parents uses symlink_metadata
which returns false for is_dir() on symlink components. This caused the
ancestor assertion to fail looking for a bare "var" directory entry.

Canonicalizing the tempdir path resolves the symlink before building
the test source path, ensuring all ancestor components are real
directories.
@oferchen
oferchen merged commit 70881b0 into master Jun 3, 2026
68 checks passed
@oferchen
oferchen deleted the test/iconv-filter-rules-interop branch June 4, 2026 07:13
oferchen added a commit that referenced this pull request Aug 24, 2026
… (#5396)

* test: add interop tests for --iconv with non-ASCII filter rules (#3490)

Verify that filter rules containing non-ASCII patterns interact
correctly with --iconv filename transcoding. Tests cover:

- Exclude patterns with non-ASCII chars preventing iconv-transcoded copy
- Include patterns with non-ASCII chars allowing files under iconv
- Filter evaluation in reverse iconv direction (Latin-1 to UTF-8)
- Surviving files correctly transcoded when filter is active
- Encoding mismatch edge case (UTF-8 pattern vs Latin-1 source names)
- Mixed include/exclude chains with multiple non-ASCII patterns
- Nested directory filtering under iconv

All tests are gated on cfg(all(target_os = "linux", feature = "iconv"))
because macOS/Windows filesystems reject raw non-UTF-8 byte sequences.

* style: apply cargo fmt formatting

* fix: add directory include rule to iconv filter test

The include_non_ascii_pattern_allows_file_under_iconv test used
--include='résumé*' --exclude='*' without a directory traversal
rule. The --exclude='*' matched the source directory itself,
preventing any files from being copied. Add --include='*/' to
permit directory traversal, matching the standard upstream rsync
idiom for include+exclude-all filter chains.

* fix: canonicalize tempdir path in relative-source test for macOS

On macOS, /var is a symlink to /private/var. TempDir creates paths
under /var/folders/... but emit_implied_parents uses symlink_metadata
which returns false for is_dir() on symlink components. This caused the
ancestor assertion to fail looking for a bare "var" directory entry.

Canonicalizing the tempdir path resolves the symlink before building
the test source path, ensuring all ancestor components are real
directories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant