airvzxf / airvzxf/ftp-deployment-action

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

Abierto
#323 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area:tests audit pending-design test
Lenguaje dominante
Shell
Estrellas
37
Forks
9
Merge medio
44 min
PR fusionados (30 d)
47

Descripción

## 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)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
github-actions, shell
Área
ci-cd, testing
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
76/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.