airvzxf / airvzxf/ftp-deployment-action

test(integration): no end-to-end scenario covers INPUT_DRY_RUN=true against a real FTP server

Đang mở
#323 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:tests audit pending-design test
Ngôn ngữ chính
Shell
Star
37
Fork
9
Merge trung bình
44 phút
Pull request đã merge (30 ngày)
47

Mô tả

## Problem

There is no integration scenario that drives the action with `INPUT_DRY_RUN=true` against a real FTP server. The smoke tests cover the dry-run path (smoke.sh:447-460 Test 24, plus the resolution of `--dry-run` into MIRROR_COMMAND at smoke.sh:494-501 Test 26), but the smoke harness cannot verify:

1. That lftp 4.9.3's `--dry-run` actually computes the mirror plan without transferring files (smoke only checks the resolved command line).
2. That `--dry-run` + `--delete` reports the deletion list without executing (smoke cannot exercise delete against a real server).
3. That the success banner switches to `FTP DRY RUN COMPLETED` instead of `FTP UPLOADED FINISHED!` (the smoke harness never reaches print_success_banner because lftp always fails on port 1).

## Coverage today

| Path | Smoke (port 1, lftp fails) | Integration |
|---|---|---|
| `INPUT_DRY_RUN=false` (real upload) | partial (asserts MIRROR_COMMAND) | scenario 08, 09, 10, 11, 12 |
| `INPUT_DRY_RUN=true` + dry-run plan | MISSING | MISSING |

The closest existing scenario is scenario 11 (INPUT_EXCLUDE_DELETE end-to-end) which uses `INPUT_DRY_RUN=false`. None of the 11 scenarios pass `INPUT_DRY_RUN=true`.

## Proposed fix

Add a new scenario (e.g. `13-dry-run-with-delete.sh` or `13-dry-run-plan.sh`) that:

1. Boots vsftpd (plain FTP, no SSL) — variant B or variant C is fine.
2. Pre-seeds the FTP user home with one or two files that are NOT in the local fixture (the "would-be-deleted" probe).
3. Runs the action with `INPUT_DELETE=true` + `INPUT_DRY_RUN=true`.
4. Asserts:
- Action exits 0 (dry-run success).
- Captured log contains `FTP DRY RUN COMPLETED` and NOT `FTP UPLOADED FINISHED!`.
- The pre-seeded files are STILL on the server (delete was not executed — only reported).
- The three fixture entries are reported as `would upload` (or similar lftp dry-run output).

Mirrors the smoke test's MIRROR_COMMAND assertion with the lftp side-effect check that only an integration test can provide.

## Severity

LOW — documentation says dry-run is supported; smoke tests the resolved command; missing only the end-to-end "did lftp actually not transfer" assertion. No user data hazard if dry-run silently uploaded.

## Related

- #231 (open): smoke tests do not cover FTPS — same family of integration-coverage gaps
- #230 (open): bats coverage gaps for compute_backoff_seconds and validate_path edge cases
- #167 (open): scenarios 03/04 INPUT_MAX_RETRIES=3 masks TLS flake (orthogonal — but the 03/04 scenario shape is the model to follow for a new scenario)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start with scenario 11 (INPUT_EXCLUDE_DELETE end-to-end), the scenario 03/04 shape, and smoke.sh:447-460 and smoke.sh:494-501. Add a new scenario that boots vsftpd, seeds files absent from the local fixture, and runs INPUT_DELETE=true with INPUT_DRY_RUN=true. Done means the action exits 0, logs FTP DRY RUN COMPLETED but not FTP UPLOADED FINISHED!, reports the fixture entries, and leaves the seeded files on the server.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
github-actions, shell
Lĩnh vực
ci-cd, testing
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
76/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.