Skip to content

Commit e0b0431

Browse files
authored
Merge pull request #7 from NVIDIA/agent-ci
feat(agent/ci): add agent unittest reporting
2 parents b80d6bd + a41dba5 commit e0b0431

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

.github/workflows/agent-ci.yaml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
name: Agent Unittest
22
on:
3-
pull_request: {}
4-
push:
5-
tags: [ "v/*" ]
3+
pull_request:
4+
paths:
5+
- agent/**
66
jobs:
77
test:
8-
name: Run tests & display coverage
8+
name: Skyhook Agent Unit Tests
99
runs-on: ubuntu-latest
1010
permissions:
11-
# Gives the action the necessary permissions for publishing new
12-
# comments in pull requests.
11+
contents: read
12+
issues: read
13+
checks: write
1314
pull-requests: write
14-
# Gives the action the necessary permissions for pushing data to the
15-
# python-coverage-comment-action branch, and for editing existing
16-
# comments (to avoid publishing multiple comments in the same PR)
17-
contents: write
1815
steps:
1916
- uses: actions/checkout@v4
20-
- name: Install everything, run the tests, produce the .coverage file and coverage.xml report
17+
- name: Run unittests
2118
run: |
2219
cd agent
23-
make test
20+
make test
21+
- name: Generate Summary
22+
uses: test-summary/action@v2
23+
if: always()
24+
with:
25+
paths: "agent/skyhook-agent/test-results.xml"
26+
output: test-summary.md
27+
- name: Display Summary
28+
if: always()
29+
run: |
30+
cat test-summary.md >> $GITHUB_STEP_SUMMARY

agent/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ dist
88
.coverage
99
.coverage.*
1010
coverage.xml
11+
test-results.xml
1112

1213
vendor/lock_file.bak

agent/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ venv: ## Sets up a python venv at `./venv`
3232
##@ Test
3333
.PHONY: test
3434
test: venv ## Test using hatch, prints coverage and outputs a report to coverage.xml
35-
$(VENV)hatch -p skyhook-agent test --cover-quiet
35+
$(VENV)hatch -p skyhook-agent test --cover-quiet --junit-xml=test-results.xml
3636
$(VENV)coverage report --show-missing --data-file=skyhook-agent/.coverage
37-
## $(VENV)coverage xml --data-file=skyhook-agent/.coverage
37+
$(VENV)coverage xml --data-file=skyhook-agent/.coverage
3838

3939
.PHONY: format
4040
format:

0 commit comments

Comments
 (0)