Explorar o código

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 hai 1 ano
pai
achega
3199143650
Modificáronse 4 ficheiros con 33 adicións e 29 borrados
  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]
 [run]
-branch = True
+# branch = True
+branch = False
 
 
 [report]
 [report]
 skip_empty = True
 skip_empty = True
+skip_covered = True
 include = custom_components/*
 include = custom_components/*

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

@@ -29,4 +29,13 @@ jobs:
           python -m pip install --upgrade pip
           python -m pip install --upgrade pip
           pip install -r requirements-dev.txt
           pip install -r requirements-dev.txt
       - name: Full test with pytest
       - 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
   test-before-configure: done
   unique-config-entry: done
   unique-config-entry: done
   config-flow-test-coverage:
   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:
   runtime-data:
     status: todo
     status: todo
     comment: issue #1884
     comment: issue #1884
@@ -22,36 +22,36 @@ rules:
     comment: issue #1916
     comment: issue #1916
   dependency-transparency: done
   dependency-transparency: done
   action-setup:
   action-setup:
-    status: not applicable
+    status: exempt
     comment: actions not implemented
     comment: actions not implemented
   common-modules:
   common-modules:
-    status: partial
+    status: todo
     comment: entity done, coordinator in connection rewrite
     comment: entity done, coordinator in connection rewrite
   docs-high-level-description:
   docs-high-level-description:
     status: todo
     status: todo
     comment: need link to Tuya
     comment: need link to Tuya
   docs-installation-instructions:
   docs-installation-instructions:
-    status: tbd
+    status: todo
     comment: to review
     comment: to review
   docs-removal-instructions:
   docs-removal-instructions:
     status: todo
     status: todo
     comment: need adding
     comment: need adding
   docs-actions:
   docs-actions:
-    status: not applicable
+    status: exempt
     comment: actions not implemented
     comment: actions not implemented
   brands:
   brands:
-    status: tbd
+    status: todo
     comment: currently using Tuya logo, do we need a unique one?
     comment: currently using Tuya logo, do we need a unique one?
   # Silver
   # Silver
   config-entry-unloading: done
   config-entry-unloading: done
   log-when-unavailable:
   log-when-unavailable:
-    status: partial
+    status: todo
     comment: log when coming back online may be needed
     comment: log when coming back online may be needed
   entity-unavailable:
   entity-unavailable:
-    status: tbd
+    status: todo
     comment: need review to ensure logic is correct
     comment: need review to ensure logic is correct
   action-exceptions:
   action-exceptions:
-    status: not applicable
+    status: exempt
     comment: actions not implemented
     comment: actions not implemented
   reauthentication-flow:
   reauthentication-flow:
     status: todo
     status: todo
@@ -60,18 +60,18 @@ rules:
     status: todo
     status: todo
     comment: especially for hubs
     comment: especially for hubs
   test-coverage:
   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
   integration-owner: done
   docs-installation-parameters:
   docs-installation-parameters:
-    status: tbd
+    status: todo
     comment: needs review
     comment: needs review
   docs-configuration-parameters:
   docs-configuration-parameters:
-    status: tbd
+    status: todo
     comment: needs review
     comment: needs review
   # Gold
   # Gold
   entity-translations:
   entity-translations:
-    status: partial
+    status: todo
     comment: issue #1708
     comment: issue #1708
   entity-device-class: done
   entity-device-class: done
   devices: done
   devices: done
@@ -90,7 +90,7 @@ rules:
     status: todo
     status: todo
     comment: review which exceptions escape through to the user
     comment: review which exceptions escape through to the user
   icon-translations:
   icon-translations:
-    status: partial
+    status: todo
     comment: issue #1708
     comment: issue #1708
   reconfiguration-flow:
   reconfiguration-flow:
     status: todo
     status: todo
@@ -107,16 +107,16 @@ rules:
     comment: due to breadth of support, what can be documented?
     comment: due to breadth of support, what can be documented?
   docs-supported-devices: done
   docs-supported-devices: done
   docs-supported-functions:
   docs-supported-functions:
-    status: tbd
+    status: todo
     comment: needs review
     comment: needs review
   docs-data-update:
   docs-data-update:
-    status: tbd
+    status: todo
     comment: needs review
     comment: needs review
   docs-known-limitations:
   docs-known-limitations:
-    status: tbd
+    status: todo
     comment: needs review
     comment: needs review
   docs-troubleshooting:
   docs-troubleshooting:
-    status: tbd
+    status: todo
     comment: needs review
     comment: needs review
   docs-examples:
   docs-examples:
     status: todo
     status: todo

+ 0 - 7
tests/devices/test_qoto_03_sprinkler.py

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