Skip to content

Commit 69615b1

Browse files
committed
add python coverage
Signed-off-by: chensuyue <[email protected]>
1 parent 597b3ca commit 69615b1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/docker/ut.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
1919
wget
2020

2121
RUN ln -sf $(which python3) /usr/bin/python
22-
RUN python -m pip install --no-cache-dir pytest
22+
RUN python -m pip install --no-cache-dir pytest pytest-cov
2323

2424
WORKDIR /

.github/workflows/scripts/test_ut.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ if [ $test_name = 'mega' ]; then
1313
echo "run mega test"
1414
cd cores
1515
find . -name "*.yaml" -exec sh -c 'x="{}"; cp $x ./' \;
16-
find . -name "test*.py" | sed 's,\.\/,python -m pytest -vs --disable-warnings ,g' > run.sh
16+
comps_path=/GenAIComps/comps/cores
17+
find . -name "test*.py" | sed 's,\.\/,python -m pytest --cov="${comps_path}" --cov-append -vs --disable-warnings ,g' > run.sh
1718
bash run.sh 2>&1 | tee ${ut_log_name}
19+
1820
else
1921
echo "run other test"
2022
python -m pytest -vs --disable-warnings ./test_${test_name}*.py 2>&1 | tee ${ut_log_name}

0 commit comments

Comments
 (0)