airvzxf / airvzxf/ftp-deployment-action

test(integration): no end-to-end scenario covers INPUT_UPLOAD_LOG_ON_FAILURE=true against the broken upload path

Offen
#325 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:tests audit pending-design test
Vorherrschende Sprache
Shell
Sterne
37
Forks
9
Ø Merge
44 Min.
Gemergte PRs (30 T.)
47

Beschreibung

## Problem

There is no integration scenario that exercises `INPUT_UPLOAD_LOG_ON_FAILURE=true` against a real vsftpd failure path, to verify:

1. The captured lftp log is actually written to `/home/lftp/.lftp-logs/run-.log` inside the action container.
2. The follow-up upload attempt (against the broken GitHub REST endpoint) fails gracefully and emits "WARNING: failed to upload log artifact... continuing to the failure banner" without aborting.
3. The action still exits 1 (the upload is fail-soft; the upload failure must not mask the mirror failure).
4. The `log_file` action output is set to the captured path.

The smoke tests cover the GITHUB_TOKEN-missing branch (smoke.sh:663-678 Test 30) but cannot verify the actual upload attempt (it requires a real GITHUB_API_URL reachable from the action container, plus GITHUB_TOKEN env, which the smoke harness does not provide).

## Why this matters

Per the action.yml upload_log_on_failure description ("**BROKEN** (do not rely on)"), the upload path always fails. Issue #290 documented the non-existent endpoint. The README "Workflow artifacts" section also documents this. A regression that "accidentally fixed" the broken path (or — more likely — a regression that caused the upload path to abort the action on failure) would not be caught today.

## Proposed fix

Add a scenario `14-upload-log-on-failure-e2e.sh` that:

1. Boots vsftpd with a credential the action will fail against (e.g., wrong password).
2. Sets `INPUT_UPLOAD_LOG_ON_FAILURE=true` + a fake `GITHUB_API_URL=http://127.0.0.1:1` (unreachable, so curl fails fast) + the rest of the required GITHUB_* env vars (GITHUB_TOKEN, GITHUB_REPOSITORY, GITHUB_RUN_ID, GITHUB_RUN_ATTEMPT).
3. Invokes the action image.
4. Asserts:
- Action exits 1.
- Captured log contains "WARNING: failed to upload log artifact" (the documented broken-path message).
- Captured log contains "Full lftp output: /home/lftp/.lftp-logs/run-*.log" (the log file path is exposed).
- Captured log does NOT contain "uploading log to ..." before the WARNING (would mean a different code path took over).

This is the only path that exercises the curl-based upload logic end-to-end.

## Severity

LOW — smoke tests the skip-paths; missing only the upload-attempt path.

## Related

- #290 (closed): upload_log_artifact uses non-existent endpoint (the reason this feature is broken; the proposed test exercises the documented broken behaviour, not a fix)

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.