diff --git a/.github/workflows/container-build.yaml b/.github/workflows/container-build.yml similarity index 100% rename from .github/workflows/container-build.yaml rename to .github/workflows/container-build.yml diff --git a/.github/workflows/docker/ut.dockerfile b/.github/workflows/docker/ut.dockerfile index 800e4786b..328984ff5 100644 --- a/.github/workflows/docker/ut.dockerfile +++ b/.github/workflows/docker/ut.dockerfile @@ -19,6 +19,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ wget RUN ln -sf $(which python3) /usr/bin/python -RUN python -m pip install --no-cache-dir pytest +RUN python -m pip install --no-cache-dir pytest pytest-cov WORKDIR / diff --git a/.github/workflows/megaservice-test.yaml b/.github/workflows/megaservice-test.yml similarity index 100% rename from .github/workflows/megaservice-test.yaml rename to .github/workflows/megaservice-test.yml diff --git a/.github/workflows/scripts/test_ut.sh b/.github/workflows/scripts/test_ut.sh index 3394e774f..887e996cd 100644 --- a/.github/workflows/scripts/test_ut.sh +++ b/.github/workflows/scripts/test_ut.sh @@ -13,7 +13,8 @@ if [ $test_name = 'mega' ]; then echo "run mega test" cd cores find . -name "*.yaml" -exec sh -c 'x="{}"; cp $x ./' \; - find . -name "test*.py" | sed 's,\.\/,python -m pytest -vs --disable-warnings ,g' > run.sh + comps_path=$(python -c 'import comps; print(comps.__path__[0])') + find . -name "test*.py" | sed "s,\.\/,python -m pytest --cov=\"${comps_path}\" --cov-append -vs --disable-warnings ,g" > run.sh bash run.sh 2>&1 | tee ${ut_log_name} else echo "run other test"