Skip to content

Commit adefb86

Browse files
committed
feat: increase test coverage to 78%
1 parent 76c948b commit adefb86

File tree

11 files changed

+1909
-311
lines changed

11 files changed

+1909
-311
lines changed

.codecov.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: "70...100"
8+
status:
9+
project:
10+
default:
11+
target: 70%
12+
threshold: 0%
13+
patch: yes
14+
changes: yes
15+
16+
ignore:
17+
- "cmd/export_trakt/**/*" # Exclude main package from coverage
18+
19+
parsers:
20+
gcov:
21+
branch_detection:
22+
conditional: yes
23+
loop: yes
24+
method: no
25+
macro: no
26+
27+
comment:
28+
layout: "reach,diff,flags,files,footer"
29+
behavior: default
30+
require_changes: no

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![Docker Image Size](https://img.shields.io/docker/image-size/johandevl/export-trakt-4-letterboxd/latest?logo=docker&label=Image%20Size)](https://hub.docker.com/r/johandevl/export-trakt-4-letterboxd)
1212
[![Docker Pulls](https://img.shields.io/docker/pulls/johandevl/export-trakt-4-letterboxd?logo=docker&label=Pulls)](https://hub.docker.com/r/johandevl/export-trakt-4-letterboxd)
1313
[![Platforms](https://img.shields.io/badge/platforms-amd64%20|%20arm64%20|%20armv7-lightgrey?logo=docker)](https://hub.docker.com/r/johandevl/export-trakt-4-letterboxd/tags)
14-
[![Code Coverage](https://img.shields.io/badge/coverage-84%25-brightgreen)](coverage.html)
14+
[![Code Coverage](https://img.shields.io/badge/coverage-78%25-brightgreen)](coverage.html)
1515
[![Trakt.tv](https://img.shields.io/badge/Trakt.tv-ED1C24?logo=trakt&logoColor=white)](https://trakt.tv)
1616
[![Letterboxd](https://img.shields.io/badge/Letterboxd-00D735?logo=letterboxd&logoColor=white)](https://letterboxd.com)
1717

@@ -145,6 +145,30 @@ go test -coverprofile=coverage.out ./...
145145
go tool cover -html=coverage.out -o coverage.html
146146
```
147147

148+
Run the coverage script (excludes main package):
149+
150+
```bash
151+
./scripts/coverage.sh
152+
```
153+
154+
The project maintains over 78% test coverage across the core packages, which helps ensure reliability and stability. The coverage includes:
155+
156+
- API Client: 73.3% covered
157+
- Config Management: 85.4% covered
158+
- Export Functionality: 78.3% covered
159+
- Internationalization: 81.6% covered
160+
- Logging System: 97.7% covered
161+
162+
### Code Coverage Configuration
163+
164+
The project includes a `.codecov.yml` file that configures code coverage analysis for CI/CD pipelines. This configuration:
165+
166+
- Sets a 70% coverage threshold for the project
167+
- Excludes the `cmd/export_trakt` directory (main package) from coverage calculations
168+
- Provides detailed coverage reports for each pull request
169+
170+
If you're using GitHub Actions or another CI system, this configuration ensures accurate coverage reporting focused on the core packages rather than the main application entry point.
171+
148172
## Documentation
149173

150174
Complete documentation is available in the [project Wiki](https://github.com/JohanDevl/Export_Trakt_4_Letterboxd/wiki).

coverage.out

Lines changed: 390 additions & 132 deletions
Large diffs are not rendered by default.

coverage.txt

Lines changed: 396 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)