Skip to content

Commit c41f7f3

Browse files
committed
Added support for coverage report generation
1 parent d7e0fc6 commit c41f7f3

File tree

6 files changed

+66
-35
lines changed

6 files changed

+66
-35
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
run: |
3131
name=$(uv run tomlq -r '.project.name' pyproject.toml)
3232
version=$(uv run tomlq -r '.project.version' pyproject.toml)
33+
echo "Name: $name"
34+
echo "Version: $version"
3335
if [ -d oracle/*_mcp_server ]; then
3436
init_py_file=oracle/*_mcp_server/__init__.py
3537
echo "\"\"\"\nCopyright (c) 2025, Oracle and/or its affiliates.\nLicensed under the Universal Permissive License v1.0 as shown at\nhttps://oss.oracle.com/licenses/upl.\n\"\"\"\n" > $$init_py_file; \
@@ -41,17 +43,22 @@ jobs:
4143
working-directory: src/${{ matrix.directory }}
4244
run: uv sync --locked --all-extras --dev
4345

44-
- name: Test
45-
working-directory: src/${{ matrix.directory }}
46-
run: uv run pytest
47-
4846
- name: Build
4947
working-directory: src/${{ matrix.directory }}
5048
run: uv build
5149

5250
- name: Test install
5351
working-directory: src/${{ matrix.directory }}
54-
run: uv pip install .
52+
run: |
53+
uv pip install .
54+
uv pip list
55+
56+
- name: Test Coverage
57+
working-directory: src/${{ matrix.directory }}
58+
run: |
59+
uv pip list
60+
uv run coverage run -m pytest
61+
uv run coverage html
5562
5663
get-directories:
5764
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ env.bak/
1010
venv.bak/
1111

1212
# Python uv
13-
uv.lock
1413
.python-version
1514

1615
# VScode
@@ -21,3 +20,4 @@ uv.lock
2120

2221
# test environments
2322
.env
23+
.coverage

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test:
4949
@for dir in $(SUBDIRS); do \
5050
if [ -f $$dir/pyproject.toml ]; then \
5151
echo "Testing $$dir"; \
52-
cd $$dir && uv sync && uv run pytest && cd ../..; \
52+
cd $$dir && uv sync && uv run coverage run -m pytest && uv run coverage html && cd ../..; \
5353
fi \
5454
done
5555

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pytest-asyncio
44
tox
55
tomlq
66
uv
7+
coverage

src/oci-api-mcp-server/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)