-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (48 loc) · 1.47 KB
/
Copy path_test.yml
File metadata and controls
56 lines (48 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: test
on:
workflow_call:
permissions:
contents: read
jobs:
unit:
name: "pytest #${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install package with dev extras
run: pip install -e ".[dev]"
- name: Run unit tests with coverage
run: |
pytest tests/unit/ \
--cov=azure.cosmos.agent_memory \
--cov-report=xml \
--cov-report=term-missing \
-v
- name: Upload coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.python-version }}
path: coverage.xml
if-no-files-found: ignore
- name: Ensure tests did not write to the working tree
# Catches tests that accidentally leave files behind (e.g. .cache
# directories, downloaded fixtures, or local Cosmos emulator state).
run: |
set -eu
STATUS="$(git status --porcelain)"
if [ -n "$STATUS" ]; then
echo "::error::Tests modified the working tree:"
echo "$STATUS"
exit 1
fi
echo "✓ Working tree clean"