Test the Git excludes step (task 4) #73

Merged
Tirsvad merged 1 commits from mil-009-tests into main 2026-10-08 08:30:53 +02:00
Owner

Task 4 of MIL-009 (Accepted on main): tests for the "Git excludes" step that #71 added to create-project.sh. Tests only; no code under src/ changes. The commit carries Task: MIL-009#4.

New tests in tests/test-local.sh:

  • Full run: .claude, .agents and AGENTS.md (and a skill file under each folder) are ignored and absent from git status; framework, .gitmodules and docs/artifact-registry.md stay visible; no .gitignore is written and nothing is committed; the project .env keeps its own entry, once, with its comment unchanged; the summary line is checked.
  • Second run: each entry and the comment are written once, and an existing build/ line in a file without a final newline stays on its own line.
  • Already ignored through a .gitignore: nothing is written and the step says reused.
  • Tracked paths: a committed AGENTS.md and .agents/keep stay tracked and unchanged, the step names them, and .claude is still ignored.
  • Extended existing tests: without SSH the step is skipped and writes nothing; the dry-run plan lists the step; the no-SSH plan does not.
  • tests/test-credentials.sh: the existing .env exclusion test also checks its comment line.

These cover Go/No-Go criteria 1 to 8 of MIL-009. Criterion 9 (documents agree), 10 (US-001.03) and 11 (the version) are not covered by this PR; the version bump is #69.

Checks run: shellcheck and shfmt are clean, and every new test passes when run by name. To show they can fail, I broke the implementation in two ways (dropping /AGENTS.md from the entries, and ignoring the skipped-framework case): the new tests failed each time, and the source was restored. The full suite had not finished when this was written.

No issue closed: #68 stays open until the full test suite has passed.

Refs #68

Task 4 of MIL-009 (`Accepted` on `main`): tests for the "Git excludes" step that #71 added to `create-project.sh`. Tests only; no code under `src/` changes. The commit carries `Task: MIL-009#4`. New tests in `tests/test-local.sh`: - **Full run**: `.claude`, `.agents` and `AGENTS.md` (and a skill file under each folder) are ignored and absent from `git status`; `framework`, `.gitmodules` and `docs/artifact-registry.md` stay visible; no `.gitignore` is written and nothing is committed; the project `.env` keeps its own entry, once, with its comment unchanged; the summary line is checked. - **Second run**: each entry and the comment are written once, and an existing `build/` line in a file without a final newline stays on its own line. - **Already ignored** through a `.gitignore`: nothing is written and the step says `reused`. - **Tracked paths**: a committed `AGENTS.md` and `.agents/keep` stay tracked and unchanged, the step names them, and `.claude` is still ignored. - **Extended existing tests**: without SSH the step is `skipped` and writes nothing; the dry-run plan lists the step; the no-SSH plan does not. - `tests/test-credentials.sh`: the existing `.env` exclusion test also checks its comment line. These cover Go/No-Go criteria 1 to 8 of MIL-009. Criterion 9 (documents agree), 10 (US-001.03) and 11 (the version) are not covered by this PR; the version bump is #69. Checks run: shellcheck and shfmt are clean, and every new test passes when run by name. To show they can fail, I broke the implementation in two ways (dropping `/AGENTS.md` from the entries, and ignoring the skipped-framework case): the new tests failed each time, and the source was restored. The full suite had not finished when this was written. No issue closed: #68 stays open until the full test suite has passed. Refs #68
Tirsvad added 1 commit 2026-10-08 08:30:06 +02:00
Add tests for the step that excludes .claude, .agents and AGENTS.md from git
in the new project: the three paths are ignored and absent from git status
after a run, while framework, .gitmodules and docs/artifact-registry.md stay
visible; no .gitignore is written and nothing is committed; a second run
writes each entry and the comment once and keeps the existing lines, also
when the file has no final newline; nothing is written for a path git
already ignores; a tracked path stays tracked and is named; the step is
skipped without the framework; the dry-run plan lists it.

The existing .env exclusion test also checks its comment line.

Refs #68
Task: MIL-009#4
Tirsvad merged commit 642ea775d1 into main 2026-10-08 08:30:53 +02:00
Sign in to join this conversation.