Skip to content

Commit 3386e12

Browse files
committed
feat added test_cov
1 parent ea5a0e4 commit 3386e12

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

.github/workflows/run_tests.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run Project Tests # The name displayed on GitHub Actions tab
1+
name: Run Project Tests & Coverage # Updated name
22

33
# When should this workflow run?
44
on:
@@ -17,7 +17,7 @@ jobs: # Define one or more jobs to run
1717
# matrix:
1818
# python-version: ['3.10', '3.11'] # Test against supported Python versions
1919

20-
name: Run Pytest # Display name for this specific job run
20+
name: Run Pytest with Coverage # Updated display name
2121
steps: # Sequence of tasks to execute
2222
# Step 1: Get the code from the repository
2323
- name: Checkout repository
@@ -55,21 +55,42 @@ jobs: # Define one or more jobs to run
5555
poetry-cache-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-
5656
5757
# Step 6: Install dependencies using Poetry
58-
- name: Install dependencies
58+
# --- MODIFIED: Add pytest-cov ---
59+
- name: Install dependencies including pytest-cov
5960
run: poetry install --no-interaction --no-root --with dev
6061
# --no-interaction: Don't ask questions
6162
# --no-root: Don't install the root monorepo package itself (it's not a package)
62-
# --with dev: Install development dependencies (like pytest)
63+
# --with dev: Install development dependencies (like pytest, pytest-cov)
64+
# --- END MODIFIED ---
6365

64-
# --- MODIFIED: Added --import-mode=importlib ---
65-
# Step 7: Run Pytest
66-
- name: Run tests with pytest
66+
# --- MODIFIED: Run Pytest with Coverage ---
67+
# Step 7: Run Pytest with Coverage
68+
- name: Run tests with pytest and generate coverage report
6769
run: |
68-
poetry run pytest -v --import-mode=importlib \
70+
# Run pytest with coverage for all relevant source directories
71+
# Generate terminal report and XML report
72+
poetry run pytest \
73+
--cov=agentvault_cli/src \
74+
--cov=agentvault_library/src \
75+
--cov=agentvault_registry/src \
76+
--cov=agentvault_server_sdk/src \
77+
--cov=agentvault_testing_utils/src \
78+
--cov-report=term-missing \
79+
--cov-report=xml:coverage.xml \
80+
-v --import-mode=importlib \
6981
agentvault_cli/tests \
7082
agentvault_library/tests \
7183
agentvault_registry/tests \
7284
agentvault_server_sdk/tests \
7385
agentvault_testing_utils/tests
74-
# Optional: Add coverage later: poetry run pytest --cov=. --cov-report=xml
7586
# --- END MODIFIED ---
87+
88+
# --- ADDED: Upload Coverage Report ---
89+
# Step 8: Upload coverage report artifact
90+
- name: Upload coverage report
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: coverage-report-${{ matrix.python-version || '3.11' }}
94+
path: coverage.xml
95+
if-no-files-found: error # Error if coverage.xml wasn't generated
96+
# --- END ADDED ---

0 commit comments

Comments
 (0)