ci: run the end-to-end tests of internal/app on main only (#52)
- commit
- 126ed2b5ad266aee40fc8503b64784c73b0054a5
- author
- brice · · 2026-10-17 22:34 UTC
- committer
- bnema · · 2026-10-17 22:34 UTC
- parent
- 3c3845e
- signature
- SSH Unverified
SHA256:VOCA5lYARHcbKDZ7GhTV45VmcjWnJ6ZQIBazj17LivAThe key is unknown
2 files · +10 -1
M .forgejo/workflows/ci.yml +8 -1
| @@ -64,7 +64,14 @@ jobs: | |||
| 64 | 64 | - name: Generated templ code is up to date | |
| 65 | 65 | run: scripts/templ-drift.sh | |
| 66 | 66 | - run: go vet ./... | |
| 67 | - | - run: go test -race ./... | |
| 67 | + | # The end-to-end tests (internal/app, a real server per test) run before a | |
| 68 | + | # PR is opened (README, Build) and here on main only: they are most of the | |
| 69 | + | # time of a PR run. | |
| 70 | + | - name: Tests | |
| 71 | + | run: go test -race $(go list ./... | grep -vx 'bnema.dev/ermite/internal/app') | |
| 72 | + | - name: End-to-end tests | |
| 73 | + | if: github.event_name == 'push' | |
| 74 | + | run: go test -race ./internal/app/ | |
| 68 | 75 | - name: Architecture | |
| 69 | 76 | run: go tool hexcheck -fail-on warn ./... | |
| 70 | 77 | # The core of the file finder (static/js/files.js) runs in Node. | |
| @@ -64,7 +64,14 @@ jobs: | |||||
| 64 | - name: Generated templ code is up to date | 64 | - name: Generated templ code is up to date | ||
| 65 | run: scripts/templ-drift.sh | 65 | run: scripts/templ-drift.sh | ||
| 66 | - run: go vet ./... | 66 | - run: go vet ./... | ||
| 67 | - | - run: go test -race ./... | 67 | + | # The end-to-end tests (internal/app, a real server per test) run before a |
| 68 | + | # PR is opened (README, Build) and here on main only: they are most of the | |||
| 69 | + | # time of a PR run. | |||
| 70 | + | - name: Tests | |||
| 71 | + | run: go test -race $(go list ./... | grep -vx 'bnema.dev/ermite/internal/app') | |||
| 72 | + | - name: End-to-end tests | |||
| 73 | + | if: github.event_name == 'push' | |||
| 74 | + | run: go test -race ./internal/app/ | |||
| 68 | - name: Architecture | 75 | - name: Architecture | ||
| 69 | run: go tool hexcheck -fail-on warn ./... | 76 | run: go tool hexcheck -fail-on warn ./... | ||
| 70 | # The core of the file finder (static/js/files.js) runs in Node. | 77 | # The core of the file finder (static/js/files.js) runs in Node. | ||
M README.md +2 -0
| @@ -202,6 +202,8 @@ go build ./cmd/ermite | |||
| 202 | 202 | go test ./... | |
| 203 | 203 | ``` | |
| 204 | 204 | ||
| 205 | + | `go test ./...` includes the end-to-end tests of `internal/app`, which start a real server per test. Run them before opening a pull request: CI runs them on `main` only, after the merge. | |
| 206 | + | ||
| 205 | 207 | ## Architecture | |
| 206 | 208 | ||
| 207 | 209 | `cmd/ermite` (entry point, calls `app.Run`) → `internal/app` (CLI and composition root: builds the adapters and wires them to the use cases) → `internal/usecase` (use cases), `internal/ports` (interfaces and parameter types that cross layers), `internal/domain` (pure values and rules) and `internal/adapters` (Git, KV store, HTTP, API, web, client implementations of the ports). | |
| @@ -202,6 +202,8 @@ go build ./cmd/ermite | |||||
| 202 | go test ./... | 202 | go test ./... | ||
| 203 | ``` | 203 | ``` | ||
| 204 | 204 | ||||
| 205 | + | `go test ./...` includes the end-to-end tests of `internal/app`, which start a real server per test. Run them before opening a pull request: CI runs them on `main` only, after the merge. | |||
| 206 | + | ||||
| 205 | ## Architecture | 207 | ## Architecture | ||
| 206 | 208 | ||||
| 207 | `cmd/ermite` (entry point, calls `app.Run`) → `internal/app` (CLI and composition root: builds the adapters and wires them to the use cases) → `internal/usecase` (use cases), `internal/ports` (interfaces and parameter types that cross layers), `internal/domain` (pure values and rules) and `internal/adapters` (Git, KV store, HTTP, API, web, client implementations of the ports). | 209 | `cmd/ermite` (entry point, calls `app.Run`) → `internal/app` (CLI and composition root: builds the adapters and wires them to the use cases) → `internal/usecase` (use cases), `internal/ports` (interfaces and parameter types that cross layers), `internal/domain` (pure values and rules) and `internal/adapters` (Git, KV store, HTTP, API, web, client implementations of the ports). | ||