tests/e2e: brownfield, --fix-failing runs exactly the mapped steps (tests #123)

オープン
#151 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
bash, docker, nginx, shell
領域
security, testing

調査の方向性

Start with tests/e2e/scenarios-brownfield.sh and the setup-brownfield fixture added by #124, then read the CHECK_STEPS mapping and report_steps used by the audit and fix options in #123. Add the fix-failing scenario, deriving the expected steps from the audit TSV and checking the dry-run plan and actual report. It is done when only mapped steps run, the follow-up audit has no FAIL, and the no-FAIL case exits successfully without creating a report.

索引モデルが issue の本文から書いたものです。

説明

area: audit area: ci area: prep claude enhancement priority: medium size: S

Epic #121 · Tests #123 (epic #109) · Milestone Phase 5: Servers already in use · Priority medium · Size S · Depends on #123, #124


Why

#123 adds --from-audit / --fix-failing: fix only what the audit fails. The test checks that the steps run are exactly the mapped ones, not more.

Scenarios go in tests/e2e/scenarios-brownfield.sh (profile added by #124) and reuse its fixture from setup-brownfield: nginx on 80/443 with a token page, a container -p 8080:80, a deploy user with a key, the 50-site.conf drop-in, UFW with its own rules, a custom fail2ban jail, ptrace_scope = 0, and a "panel" root login on 22 before the run. Extra fixture listed below is added by this issue only.

Scenario fix-failing

  • server-audit.sh --tsv audit.tsv on the brownfield server before the run, then --existing --dry-run --from-audit audit.tsv: the plan prints one "FAIL -> " line per FAIL, and the selected steps equal the CHECK_STEPS mapping of those checks (computed by the test from the TSV).
  • --existing --yes --fix-failing: report_steps shows only the mapped steps as run; every other step is absent or SKIPPED.
  • The audit after has 0 FAIL.
  • --fix-warnings adds the steps mapped from WARN checks; --only and --skip still apply on top.
  • An audit file with no FAIL: "nothing to fix", exit 0, no new report in /root/server-prep-reports.
  • Optional: the brownfield run of #124 itself uses --fix-failing once this lands.

Acceptance criteria

  • A step run that is not in the mapping turns the scenario red.
主要言語
Shell
スター
2
フォーク
3
平均マージ
2日 14分
マージ済み PR(30日)
47

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

exceev-consulting/server-prep のほかの issue

exceev-consulting/server-prep の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。