Browse Source

Improve test output.

Output summary of coverage.
Surface the test failures in the workflow summary rather than having
to drill down to the logs.

Fix qoto sprinkler tests after removal of valve deprecations.

Update quality scale scoresheet, standardise statuses.
Jason Rumney 1 năm trước cách đây
mục cha
commit
3199143650
4 tập tin đã thay đổi với 33 bổ sung29 xóa
  1. 3 1
      .coveragerc
  2. 10 1
      .github/workflows/tests.yml
  3. 20 20
      quality_scale.yaml
  4. 0 7
      tests/devices/test_qoto_03_sprinkler.py

+ 3 - 1
.coveragerc

@@ -1,6 +1,8 @@
 [run]
-branch = True
+# branch = True
+branch = False
 
 [report]
 skip_empty = True
+skip_covered = True
 include = custom_components/*

+ 10 - 1
.github/workflows/tests.yml

@@ -29,4 +29,13 @@ jobs:
           python -m pip install --upgrade pip
           pip install -r requirements-dev.txt
       - name: Full test with pytest
-        run: pytest --cov=. --cov-config=.coveragerc --cov-report xml:coverage.xml
+        run: pytest --cov=custom_components/tuya_local --cov-report term:skip-covered --junit-xml=test-results.xml
+      - name: Surface results
+        if: always()
+        uses: pmeier/pytest-results-action@main
+        with:
+          path: test-results.xml
+          summary: true
+          display-options: fEX
+          fail-on-empty: true
+          title: Test results

+ 20 - 20
quality_scale.yaml

@@ -4,8 +4,8 @@ rules:
   test-before-configure: done
   unique-config-entry: done
   config-flow-test-coverage:
-    status: tbd
-    comment: Not measured since SonarCloud github integration broke
+    status: todo
+    comment: line-rate="0.5019" branch-rate="0.2872", target 100%
   runtime-data:
     status: todo
     comment: issue #1884
@@ -22,36 +22,36 @@ rules:
     comment: issue #1916
   dependency-transparency: done
   action-setup:
-    status: not applicable
+    status: exempt
     comment: actions not implemented
   common-modules:
-    status: partial
+    status: todo
     comment: entity done, coordinator in connection rewrite
   docs-high-level-description:
     status: todo
     comment: need link to Tuya
   docs-installation-instructions:
-    status: tbd
+    status: todo
     comment: to review
   docs-removal-instructions:
     status: todo
     comment: need adding
   docs-actions:
-    status: not applicable
+    status: exempt
     comment: actions not implemented
   brands:
-    status: tbd
+    status: todo
     comment: currently using Tuya logo, do we need a unique one?
   # Silver
   config-entry-unloading: done
   log-when-unavailable:
-    status: partial
+    status: todo
     comment: log when coming back online may be needed
   entity-unavailable:
-    status: tbd
+    status: todo
     comment: need review to ensure logic is correct
   action-exceptions:
-    status: not applicable
+    status: exempt
     comment: actions not implemented
   reauthentication-flow:
     status: todo
@@ -60,18 +60,18 @@ rules:
     status: todo
     comment: especially for hubs
   test-coverage:
-    status: tbd
-    comment: unmeasured since SonarCloud github connection stopped working
+    status: todo
+    comment: line-rate="0.7859" branch-rate="0.6018", target 95%
   integration-owner: done
   docs-installation-parameters:
-    status: tbd
+    status: todo
     comment: needs review
   docs-configuration-parameters:
-    status: tbd
+    status: todo
     comment: needs review
   # Gold
   entity-translations:
-    status: partial
+    status: todo
     comment: issue #1708
   entity-device-class: done
   devices: done
@@ -90,7 +90,7 @@ rules:
     status: todo
     comment: review which exceptions escape through to the user
   icon-translations:
-    status: partial
+    status: todo
     comment: issue #1708
   reconfiguration-flow:
     status: todo
@@ -107,16 +107,16 @@ rules:
     comment: due to breadth of support, what can be documented?
   docs-supported-devices: done
   docs-supported-functions:
-    status: tbd
+    status: todo
     comment: needs review
   docs-data-update:
-    status: tbd
+    status: todo
     comment: needs review
   docs-known-limitations:
-    status: tbd
+    status: todo
     comment: needs review
   docs-troubleshooting:
-    status: tbd
+    status: todo
     comment: needs review
   docs-examples:
     status: todo

+ 0 - 7
tests/devices/test_qoto_03_sprinkler.py

@@ -38,13 +38,6 @@ class TestQotoSprinkler(
         )
         self.setUpMultiNumber(
             [
-                {
-                    "name": "number",
-                    "dps": TARGET_DPS,
-                    "max": 100,
-                    "step": 5,
-                    "unit": PERCENTAGE,
-                },
                 {
                     "name": "number_timer",
                     "dps": TIMER_DPS,