103 lines
2.9 KiB
Markdown
103 lines
2.9 KiB
Markdown
# Ticket 0013: Raporttien julkaisu `ci-feature.yml`:ään
|
|
|
|
**Vaihe:** 13 (riippuu 0003 ja 0005)
|
|
**Status:** pending
|
|
**Feature branch:** `feature/0013-ci-feature-report-publish`
|
|
**TDD required:** Yes
|
|
**Feature file required:** Yes
|
|
|
|
**Required context:**
|
|
- `docs/test-plan/tdd-guide.md`
|
|
- `tests/features/0013-ci-feature-report-publish.feature`
|
|
- Skills: `tdd`, `implementation`, `clean-code`
|
|
|
|
**Pre-requisite (estotiketti):**
|
|
- Tiketti 0003 (`push-reports.sh`) — valmis
|
|
- Tiketti 0005 (`report-service/generate-index.sh`) — valmis
|
|
- Tiketti 0006 (`ci-feature.yml`) — valmis (perusstepit ilman raportteja)
|
|
|
|
---
|
|
|
|
## TDD — Red-Green-Refactor
|
|
|
|
### Red
|
|
Ennen muutoksia, kirjoita validointitestit (`tests/workflows.bats`):
|
|
- `publish-html`-job lisätty `ci-feature.yml`:ään
|
|
- `push-reports.sh`-kutsut oikeilla parametreilla
|
|
- `end`-jobin URL-parametri sisältää raportti-URL:n
|
|
|
|
```bash
|
|
bats tests/workflows.bats
|
|
# FAIL: publish-html -steppiä ei ole
|
|
```
|
|
|
|
### Green
|
|
Lisää `publish-html`-job `ci-feature.yml`:ään.
|
|
|
|
```bash
|
|
bats tests/workflows.bats
|
|
# PASS
|
|
```
|
|
|
|
## DoD
|
|
- [ ] Cucumber: `@ticket-0013 and @mock` → kaikki skenaariot GREEN
|
|
- [ ] `tests/workflows.bats` — YAML-validointi läpi
|
|
- [ ] `publish-html`-job puskaa raportit MinIO:hon
|
|
- [ ] `end`-jobin statusviesti sisältää raportti-URL:n
|
|
- [ ] `ci-flow-values.yaml`-skeema tukee raporttityyppejä (`cucumber`, `jacoco`, `site`)
|
|
|
|
---
|
|
|
|
## Toiminto
|
|
|
|
Lisää `ci-feature.yml`:ään `publish-html`-job, joka kutsuu `push-reports.sh`:ta (Ticket 0003) jokaiselle raporttityypille. Raporttityypit konfiguroidaan `ci-flow-values.yaml`:ssa.
|
|
|
|
## Muutokset `ci-feature.yml`:ään
|
|
|
|
Uusi steppijärjestys:
|
|
|
|
```
|
|
start → unit-test → code-coverage → publish-html → end
|
|
```
|
|
|
|
| Job | `context` | Toiminto |
|
|
|-----|-----------|----------|
|
|
| `start` | `ci/start` | `report-status.sh pending` |
|
|
| `unit-test` | `ci/unit-test` | Projektin oma testiajo |
|
|
| `code-coverage` | `ci/code-coverage` | JaCoCo / vastaava |
|
|
| `publish-html` | `ci/publish-html` | `push-reports.sh` jokaiselle raporttityypille |
|
|
| `end` | `ci/end` | `report-status.sh success/failure` + raportti-URL |
|
|
|
|
## `ci-flow-values.yaml`-laajennus
|
|
|
|
```yaml
|
|
build:
|
|
ecosystem: maven
|
|
java-version: "21"
|
|
|
|
test:
|
|
unit: "mvn test"
|
|
coverage: "mvn jacoco:report"
|
|
|
|
reports:
|
|
- type: cucumber
|
|
source: target/cucumber-report
|
|
- type: jacoco
|
|
source: target/site/jacoco
|
|
- type: site
|
|
source: target/site
|
|
```
|
|
|
|
## Verifiointi
|
|
|
|
1. `push-reports.sh cucumber target/cucumber-report` → onnistuu
|
|
2. `push-reports.sh jacoco target/site/jacoco` → onnistuu
|
|
3. `end`-jobin statusviestin URL osoittaa raporttiin
|
|
|
|
## Viitteet
|
|
|
|
- `docs/tickets/0003-push-reports-sh.md` — `push-reports.sh`
|
|
- `docs/tickets/0005-report-service-index-generation.md` — `generate-index.sh`
|
|
- `docs/tickets/0006-pipeline-as-conf.md` — Pipeline as conf (perusstepit)
|
|
- `docs/report-hosting.md` — Raporttien URL-rakenne
|