Skip to content

Commit 5b4ee16

Browse files
authored
Merge pull request #3160 from SmartThingsCommunity/cap-def-download
Cap def download
2 parents 2bd5faa + c9c1a24 commit 5b4ee16

5 files changed

Lines changed: 621 additions & 5 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
types: [opened, synchronize, labeled, unlabeled]
55
paths:
66
- 'drivers/**'
7+
- 'tools/run_driver_tests.py'
8+
- 'tools/run_driver_tests_p.py'
79

810
jobs:
911
# Two separate jobs for finding the right artifact to run tests with
@@ -91,11 +93,33 @@ jobs:
9193
- run: echo ${{ steps.changed-drivers.outputs.all_modified_files }}
9294
- name: Install Python requirements
9395
run: pip install -r tools/requirements.txt
96+
- name: Fetch capability definitions
97+
continue-on-error: true
98+
run: |
99+
python3 tools/fetch_capability_definitions.py \
100+
--drivers-dir ${{ github.workspace }}/drivers \
101+
--output-dir ${{ github.workspace }}/capability_json \
102+
--failed-output-file ${{ github.workspace }}/capability_failures_comment.md
103+
env:
104+
CAPABILITY_PAT: ${{ secrets.CAPABILITY_DEFINITIONS_PAT }}
105+
- name: Report capability download failures
106+
if: hashFiles('capability_failures_comment.md') != '' && always()
107+
uses: marocchino/sticky-pull-request-comment@v2
108+
with:
109+
path: ${{ github.workspace }}/capability_failures_comment.md
110+
header: capability-download-failures
111+
- name: Clear capability download failures comment
112+
if: hashFiles('capability_failures_comment.md') == '' && always()
113+
uses: marocchino/sticky-pull-request-comment@v2
114+
with:
115+
header: capability-download-failures
116+
delete: true
94117
- name: Run the tests
95118
id: run-tests
96119
run: python tools/run_driver_tests_p.py ${{ steps.changed-drivers.outputs.all_modified_files }}
97120
env:
98121
LUA_PATH: ${{ steps.lua_path.outputs.lua_path }}
122+
ST_CAPABILITY_JSON_DIR: ${{ github.workspace }}/capability_json
99123
- name: Upload test artifact
100124
if: always()
101125
uses: actions/upload-artifact@v4

drivers/SmartThings/zigbee-bed/src/test/test_shus_mattress.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ local cluster_base = require "st.zigbee.cluster_base"
77
local data_types = require "st.zigbee.data_types"
88
local t_utils = require "integration_test.utils"
99
local zigbee_test_utils = require "integration_test.zigbee_test_utils"
10-
local custom_capabilities = require "shus-mattress/custom_capabilities"
1110

1211
local shus_mattress_profile_def = t_utils.get_profile_definition("shus-smart-mattress.yml")
1312
test.add_package_capability("aiMode.yaml")
@@ -18,6 +17,8 @@ test.add_package_capability("strongExpMode.yaml")
1817
test.add_package_capability("yoga.yaml")
1918
test.add_package_capability("mattressHardness.yaml")
2019

20+
local custom_capabilities = require "shus-mattress/custom_capabilities"
21+
2122
local PRIVATE_CLUSTER_ID = 0xFCC2
2223
local MFG_CODE = 0x1235
2324

0 commit comments

Comments
 (0)