Skip to content

test: validate progress2 output format matches upstream rsync - #5392

Merged
oferchen merged 9 commits into
masterfrom
test/pg2-7-progress2-format-parity
Jun 4, 2026
Merged

oferchen merged 9 commits into
masterfrom
test/pg2-7-progress2-format-parity

Conversation

@oferchen

@oferchen oferchen commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds PG2-7 (docs: v0.6 known limitations and security hardening notes #3475) test suite validating --info=progress2 output format matches upstream rsync's progress.c format string
  • Tests cover field widths (bytes 15-char, percentage 4-char, rate 11-char, time 10-char), separators, rate unit tiers (kB/s, MB/s, GB/s), time format (H:MM:SS, ??:??:??), xfr/to-chk trailer syntax, and in-flight tick format (trailing spaces, no trailer)
  • Exercises both the LiveProgress observer path and the full CLI path via run_with_args

Test plan

  • CI nextest passes on all platforms (Linux, macOS, Windows)
  • New tests validate structural format parity without depending on exact numeric values
  • No new dependencies added (uses string matching instead of regex)

Add comprehensive tests verifying --info=progress2 output structural
parity with upstream rsync's progress.c format. Tests validate both
final tick lines (with xfr/to-chk trailer) and in-flight tick lines
(trailing spaces, no trailer) through end-to-end transfers and direct
formatter function calls.

Coverage includes:
- Field layout: bytes (15-char), percentage (4-char), rate (11-char),
  time (10-char) widths matching upstream format string
- Rate unit tiers: kB/s, MB/s, GB/s with base-1024 boundaries
- Time format: H:MM:SS and ??:??:?? overflow sentinel
- Bytes thousands separator and human-readable mode
- Sequential xfr# indices across multi-file transfers
- CLI path validation through run_with_args
- Composed line field order matching upstream rprint_progress
@github-actions github-actions Bot added the test label Jun 3, 2026
oferchen added 8 commits June 3, 2026 17:49
The connect_to_mock helper passed None for the known_hosts_file,
causing the SSH handler to check the system ~/.ssh/known_hosts.
When a prior test run or CI job left a known_hosts entry for
[127.0.0.1]:<port> with a different key, the connection failed
with HostKeyMismatch before StrictHostKeyChecking::No could
take effect.

Use an isolated temporary known_hosts file so the mock server
tests never conflict with the system known_hosts.
Return the connect result directly instead of binding it to a
local variable. The kh_dir TempDir stays alive through the
connect handshake via normal scope lifetime rules.
Add 23 tests that fail identically on master to the known-failures
list so the upstream testsuite CI check reports XFAIL instead of
FAIL. Grouped by root cause: missing helper binaries (3), protocol
handshake (1), daemon mode (1), backup mode (1), and feature
divergence (17).
Remove the waiver entries from known_failures.conf. The upstream
testsuite failures must be fixed properly, not waivered.
@oferchen
oferchen merged commit 92f72be into master Jun 4, 2026
67 of 68 checks passed
@oferchen
oferchen deleted the test/pg2-7-progress2-format-parity branch June 4, 2026 07:13
oferchen added a commit that referenced this pull request Aug 24, 2026
* test: validate progress2 output format matches upstream rsync (#3475)

Add comprehensive tests verifying --info=progress2 output structural
parity with upstream rsync's progress.c format. Tests validate both
final tick lines (with xfr/to-chk trailer) and in-flight tick lines
(trailing spaces, no trailer) through end-to-end transfers and direct
formatter function calls.

Coverage includes:
- Field layout: bytes (15-char), percentage (4-char), rate (11-char),
  time (10-char) widths matching upstream format string
- Rate unit tiers: kB/s, MB/s, GB/s with base-1024 boundaries
- Time format: H:MM:SS and ??:??:?? overflow sentinel
- Bytes thousands separator and human-readable mode
- Sequential xfr# indices across multi-file transfers
- CLI path validation through run_with_args
- Composed line field order matching upstream rprint_progress

* style: apply cargo fmt formatting

* fix: use next_back instead of last on DoubleEndedIterator

* fix: correct progress2 field-width test to use values within 15-char limit

* fix: correct progress2 composed line test to pass matching bytes for 100%

* fix: prevent SSH host key mismatch in auth tests

The connect_to_mock helper passed None for the known_hosts_file,
causing the SSH handler to check the system ~/.ssh/known_hosts.
When a prior test run or CI job left a known_hosts entry for
[127.0.0.1]:<port> with a different key, the connection failed
with HostKeyMismatch before StrictHostKeyChecking::No could
take effect.

Use an isolated temporary known_hosts file so the mock server
tests never conflict with the system known_hosts.

* fix: resolve clippy let_and_return lint in SSH auth test helper

Return the connect result directly instead of binding it to a
local variable. The kh_dir TempDir stays alive through the
connect handshake via normal scope lifetime rules.

* fix: register pre-existing upstream testsuite failures as known

Add 23 tests that fail identically on master to the known-failures
list so the upstream testsuite CI check reports XFAIL instead of
FAIL. Grouped by root cause: missing helper binaries (3), protocol
handshake (1), daemon mode (1), backup mode (1), and feature
divergence (17).

* fix: revert upstream testsuite known-failures registration

Remove the waiver entries from known_failures.conf. The upstream
testsuite failures must be fixed properly, not waivered.
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