Repository: pollen-robotics/reachy2-sdk (language: python)

Issue:
test coverage not complete
it seems that the test coverage only cover the test code


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index a284d4de..ffc9ec2d 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -10,9 +10,9 @@ jobs:
   check-docstrings:
     runs-on: ubuntu-22.04
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python 3.10
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "3.10"
           cache: 'pip' # caching pip dependencies
@@ -27,10 +27,10 @@ jobs:
     runs-on: ubuntu-22.04
     steps:
     - name: Checkout Repository
-      uses: actions/checkout@v3
+      uses: actions/checkout@v4
 
     - name: Set up Python 3.10
-      uses: actions/setup-python@v4
+      uses: actions/setup-python@v5
       with:
         python-version: '3.10'
 
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 8d3987e6..b2e77c79 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -7,7 +7,7 @@ jobs:
   black:
     runs-on: ubuntu-22.04
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - uses: psf/black@stable
         with:
           options: "--check --verbose"
@@ -16,9 +16,9 @@ jobs:
   isort:
     runs-on: ubuntu-22.04
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python 3.10
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "3.10"
           cache: 'pip' # caching pip dependencies
@@ -32,9 +32,9 @@ jobs:
   flake8:
     runs-on: ubuntu-22.04
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python 3.10
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "3.10"
           cache: 'pip' # caching pip dependencies
@@ -52,9 +52,9 @@ jobs:
   mypy:
     runs-on: ubuntu-22.04
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python 3.10
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "3.10"
           cache: 'pip' # caching pip dependencies
diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml
index b51789ee..05527a89 100644
--- a/.github/workflows/publish_pypi.yml
+++ b/.github/workflows/publish_pypi.yml
@@ -9,7 +9,7 @@ jobs:
     runs-on: ubuntu-22.04
     steps:
     - uses: actions/checkout@v4
-    - uses: actions/setup-python@v4
+    - uses: actions/setup-python@v5
       with:
         python-version: '3.10'
     - name: Install dependencies
diff --git a/setup.cfg b/setup.cfg
index 03bdb3e9..bce4661d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -46,18 +46,24 @@ max-complexity = 10
 [coverage:run]
 branch=True
 omit = 
-    /home/runner/work/reachy2-sdk/reachy2-sdk/config-3.py
-    /home/runner/work/reachy2-sdk/reachy2-sdk/config.py
+    */reachy2-sdk/config.py
+    */reachy2-sdk/config-3.py
+    */reachy2-sdk-api/*
 
 [coverage:report]
 show_missing=True
 exclude_also =
     @pytest.mark.online
+    @pytest.mark.cameras 
     def reachy_sdk_zeroed  
-    def reachy_sdk()
+    #def reachy_sdk()
+    def is_goto_finished
+    class LoopThread
+
 
 [tool:pytest]
-testpaths = tests/units
+testpaths = 
+    tests/units
 markers = 
     online: test connected to simulated robot
     offline: no grpc connection required


Test patch:
diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml
index 49804d74..8dd813cb 100644
--- a/.github/workflows/unit_tests.yml
+++ b/.github/workflows/unit_tests.yml
@@ -1,6 +1,10 @@
 name: Pytest
 
-on: [pull_request]
+on:
+  pull_request:
+  push:
+    branches:
+      - main
 
 jobs:
   tests:
@@ -8,16 +12,16 @@ jobs:
     runs-on: ubuntu-22.04
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Set up Python 3.10
-        uses: actions/setup-python@v4
+        uses: actions/setup-python@v5
         with:
           python-version: "3.10"
           cache: 'pip' # caching pip dependencies
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          pip install .[dev]
+          pip install -e .[dev]
       - name: Unit tests
         # running offline tests only
         run: |        
@@ -31,7 +35,7 @@ jobs:
           name: code-coverage-report
           path: htmlcov
       - name: Get Cover 
-        uses: orgoro/coverage@v3.1
+        uses: orgoro/coverage@v3.2
         with:
           coverageFile: coverage.xml
           token: ${{ secrets.GITHUB_TOKEN }}
@@ -41,6 +45,7 @@ jobs:
           echo "total=$TOTAL" >> $GITHUB_ENV
           echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
       - name: Make badge
+        if: github.ref == 'refs/heads/main'
         uses: schneegans/dynamic-badges-action@v1.7.0
         with:
           # GIST_TOKEN is a GitHub personal access token with scope "gist".