Skip to content

Commit 298b6c1

Browse files
committed
ODSC-42785. Add coverage report message to PRs
- fixed errors seen in steps output - reduced number of libraries required for tests
1 parent b223db1 commit 298b6c1

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

.github/workflows/run-tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ jobs:
3636
python-version: ["3.8", "3.9", "3.10"]
3737
include:
3838
- python-version: "3.9"
39-
cov-reports: --cov=ads --cov-report=xml --cov-report=html
40-
39+
cov-reports: --cov=oci_mlflow --cov-report=xml --cov-report=html
4140

4241
steps:
4342
- uses: actions/checkout@v3
@@ -61,14 +60,14 @@ jobs:
6160
run: |
6261
set -x # print commands that are executed
6362
mkdir -p "$HOME_RUNNER_DIR"/.oci
64-
openssl genrsa -out $HOME_RUNNER_DIR/.oci/oci_ads_user.pem 2048
63+
openssl genrsa -out $HOME_RUNNER_DIR/.oci/oci_mlflow_user.pem 2048
6564
cat <<EOT >> "$HOME_RUNNER_DIR/.oci/config"
6665
[DEFAULT]
6766
user=ocid1.user.oc1..xxx
6867
fingerprint=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
6968
tenancy=ocid1.tenancy.oc1..xxx
7069
region=test_region
71-
key_file=$HOME_RUNNER_DIR/.oci/oci_ads_user.pem
70+
key_file=$HOME_RUNNER_DIR/.oci/oci_mlflow_user.pem
7271
EOT
7372
ls -lha "$HOME_RUNNER_DIR"/.oci
7473
echo "Test config file:"
@@ -88,7 +87,7 @@ jobs:
8887
uses: actions/upload-artifact@v3
8988
if: ${{ matrix.cov-reports }}
9089
with:
91-
name: cov-reports-${{ matrix.name }}
90+
name: cov-reports
9291
path: |
9392
htmlcov/
9493
.coverage
@@ -105,8 +104,9 @@ jobs:
105104
106105
# Calculate overall coverage and update body message
107106
COV=$(grep -E 'pc_cov' htmlcov/index.html | cut -d'>' -f 2 | cut -d'%' -f 1)
108-
if [[ ! -z $COV ]]; then
109-
if [[ $COV -lt 50 ]]; then COLOR=red; elif [[ $COV -lt 80 ]]; then COLOR=yellow; else COLOR=green; fi
107+
if [[ ! -z $COV ]]; then
108+
ROUNDED_COV=$(echo $COV | cut -d'.' -f 1)
109+
if [[ $ROUNDED_COV -lt 50 ]]; then COLOR=red; elif [[ $ROUNDED_COV -lt 80 ]]; then COLOR=yellow; else COLOR=green; fi
110110
echo COV_BODY="$COV_BODY_INTRO ![Coverage-$COV%](https://img.shields.io/badge/coverage-$COV%25-$COLOR)" >> $GITHUB_ENV
111111
fi
112112

test-requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
-e .
2-
coverage
32
faker
43
mock
54
pip
65
pytest
76
pytest-codecov
8-
pytest-xdist

0 commit comments

Comments
 (0)