Skip to content

Commit 2dc24fc

Browse files
committed
fix(ci): Record and upload test coverage for watcher
1 parent c52c9dc commit 2dc24fc

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

.github/workflows/watcher.yaml

+17-2
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,20 @@ jobs:
3535
version: v1.60
3636
args: --timeout=5m
3737
working-directory: watcher
38-
- name: Run tests
39-
run: go test -v ./...
38+
- name: Run tests with coverage
39+
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
40+
- name: Upload results to Codecov
41+
uses: codecov/codecov-action@v4
42+
with:
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
files: ./backend/coverage.xml
45+
slug: aai-institute/infrastructure-product
46+
flags: backend
47+
- name: Upload test results to Codecov
48+
if: ${{ !cancelled() }}
49+
uses: codecov/test-results-action@v1
50+
with:
51+
token: ${{ secrets.CODECOV_TOKEN }}
52+
files: ./backend/junit.xml
53+
slug: aai-institute/infrastructure-product
54+
flags: backend

codecov.yml

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ignore:
22
- "test_*.py"
33
- "**/tests/**"
4+
- "*_test.go"
45
coverage:
56
status:
67
project: off
@@ -15,3 +16,7 @@ flag_management:
1516
paths:
1617
- "backend/"
1718
carryforward: true
19+
- name: watcher
20+
paths:
21+
- "watcher/"
22+
carryforward: true

watcher/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ watcher
33

44
# Helm chart directory
55
!deploy/**
6+
7+
# Test coverage
8+
coverage.txt

0 commit comments

Comments
 (0)