diff --git a/.github/workflows/agent-ci.yaml b/.github/workflows/agent-ci.yaml index 8b7458c0..f9ad6dba 100644 --- a/.github/workflows/agent-ci.yaml +++ b/.github/workflows/agent-ci.yaml @@ -1,23 +1,30 @@ name: Agent Unittest on: - pull_request: {} - push: - tags: [ "v/*" ] + pull_request: + paths: + - agent/** jobs: test: - name: Run tests & display coverage + name: Skyhook Agent Unit Tests runs-on: ubuntu-latest permissions: - # Gives the action the necessary permissions for publishing new - # comments in pull requests. + contents: read + issues: read + checks: write pull-requests: write - # Gives the action the necessary permissions for pushing data to the - # python-coverage-comment-action branch, and for editing existing - # comments (to avoid publishing multiple comments in the same PR) - contents: write steps: - uses: actions/checkout@v4 - - name: Install everything, run the tests, produce the .coverage file and coverage.xml report + - name: Run unittests run: | cd agent - make test \ No newline at end of file + make test + - name: Generate Summary + uses: test-summary/action@v2 + if: always() + with: + paths: "agent/skyhook-agent/test-results.xml" + output: test-summary.md + - name: Display Summary + if: always() + run: | + cat test-summary.md >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/agent/.gitignore b/agent/.gitignore index 6c3c2943..e77d9a4c 100644 --- a/agent/.gitignore +++ b/agent/.gitignore @@ -8,5 +8,6 @@ dist .coverage .coverage.* coverage.xml +test-results.xml vendor/lock_file.bak \ No newline at end of file diff --git a/agent/Makefile b/agent/Makefile index 310e88b9..5a5cf348 100644 --- a/agent/Makefile +++ b/agent/Makefile @@ -32,9 +32,9 @@ venv: ## Sets up a python venv at `./venv` ##@ Test .PHONY: test test: venv ## Test using hatch, prints coverage and outputs a report to coverage.xml - $(VENV)hatch -p skyhook-agent test --cover-quiet + $(VENV)hatch -p skyhook-agent test --cover-quiet --junit-xml=test-results.xml $(VENV)coverage report --show-missing --data-file=skyhook-agent/.coverage -## $(VENV)coverage xml --data-file=skyhook-agent/.coverage + $(VENV)coverage xml --data-file=skyhook-agent/.coverage .PHONY: format format: