Skip to content

Commit cd91cfc

Browse files
authored
enable python coverage (#149)
Signed-off-by: Sun, Xuehao <[email protected]> Signed-off-by: chensuyue <[email protected]>
1 parent e850339 commit cd91cfc

File tree

4 files changed

+3
-2
lines changed

4 files changed

+3
-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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ 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=$(python -c 'import comps; print(comps.__path__[0])')
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}
1819
else
1920
echo "run other test"

0 commit comments

Comments
 (0)