retention korjaus testien avulla
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 1m10s
CI Feature / Bats tests (push) Failing after 2m8s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m57s
CI Feature / Report Summary (push) Successful in 7s

This commit is contained in:
moilanik
2026-06-26 05:31:25 +03:00
parent 1978a995a8
commit e75b425294
5 changed files with 441 additions and 54 deletions
+22
View File
@@ -149,3 +149,25 @@ curl -X PATCH https://ci-reports.helm-dev.keskikuja.site/owner/repo/commit/sha8/
- `git-pages-publish-token` = plaintext (luetaan Giteaan viedessä)
Tarkemmat secret-ohjeet: [docs/secrets.md](docs/secrets.md).
---
## Testaus
Retention-logiikalle on unit-testit, jotka testaa funktiot ja Phase 3 -säännöt
erikseen ilman ulkoisia riippuvuuksia.
```bash
cd git-pages
bats tests/retention.bats
```
Testit käyttävät `<root>/files/retention-lib.sh` -jaettua kirjastoa, jota myös
`retention-cleanup.sh` sourceaa. Uutta testiä kirjoittaessa:
1. Luo config `write_config`-helperilla
2. Täytä `KEEP`-array testidatalla (muoto: `dir|owner|repo|branch|days`)
3. Kutsu `apply_retention "$CONFIG"`
4. Tarkista `TO_DELETE`-array ja `$output`
**Vaatimukset:** `bats`, `jq`, `date` (GNU date tai BSD date ISO 8601 -tuella).