Skip to content

Commit c807a81

Browse files
committed
feature(ci): add testing and coverage data to gitlab ci artifacts
1 parent b9bbe3f commit c807a81

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.gitlab-ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ lint:
1515
changes:
1616
- keyringctl
1717
- libkeyringctl/*
18-
- test/*
18+
- tests/*
1919
- .gitlab-ci.yml
20+
- Makefile
2021

2122
test:
2223
stage: test
@@ -29,8 +30,14 @@ test:
2930
changes:
3031
- keyringctl
3132
- libkeyringctl/*
32-
- test/*
33+
- tests/*
3334
- .gitlab-ci.yml
35+
- Makefile
36+
artifacts:
37+
when: always
38+
reports:
39+
junit: build/junit-report.xml
40+
cobertura: build/coverage.xml
3441

3542
build_install:
3643
stage: test

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ KEYRING_FILES=$(wildcard build/*.gpg) $(wildcard build/*-revoked) $(wildcard bui
55
all: build
66

77
lint:
8-
black --check --diff keyringctl libkeyringctl
8+
black --check --diff keyringctl libkeyringctl tests
99
isort --diff .
10-
flake8 keyringctl libkeyringctl
11-
mypy --install-types --non-interactive keyringctl libkeyringctl
10+
flake8 keyringctl libkeyringctl tests
11+
mypy --install-types --non-interactive keyringctl libkeyringctl tests
1212

1313
fmt:
1414
black .
@@ -17,6 +17,7 @@ fmt:
1717
test:
1818
coverage run
1919
coverage report
20+
coverage xml -o build/coverage.xml
2021

2122
build:
2223
./keyringctl -v build

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ show_missing = true
2727

2828
[tool.coverage.run]
2929
branch = true
30-
command_line = "-m pytest -vv tests/"
30+
command_line = "-m pytest --junit-xml=build/junit-report.xml -vv tests/"
3131
omit = ["tests/*", ".tox/*"]
3232

3333
[tool.isort]

0 commit comments

Comments
 (0)