summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-05-10 18:55:43 +0700
committerGitHub <[email protected]>2024-05-10 18:55:43 +0700
commit3e2ea7750681b27238043c7158ff5508f01914a3 (patch)
tree11f9198467f561c1ff4cfd3c45e9a7b02cf9f572 /test
parentbf9cf107c638f5f674be716b8ac7cd983aa05804 (diff)
More ci tweak (#2636)
* change concurrency group to ${{ github.workflow }}-${{ github.ref }} * use argparse for build.py hil_test.py, remove the need to install click * move ci win/mac to build_cmake.yml * rename build_family.yml to build_util.yml * build_util.yml support esp32 * integrate build-espressif into build.yml * build.py support make with --board option * add get_deps action * update hil test to reuse action
Diffstat (limited to 'test')
-rw-r--r--test/hil/hil_test.py19
-rw-r--r--test/hil/pi4.json10
-rw-r--r--test/hil/pi4_esp32.json14
3 files changed, 22 insertions, 21 deletions
diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py
index dffb81765..c2699cc6f 100644
--- a/test/hil/hil_test.py
+++ b/test/hil/hil_test.py
@@ -25,10 +25,10 @@
# ACTION=="add", SUBSYSTEM=="tty", SUBSYSTEMS=="usb", MODE="0666", PROGRAM="/bin/sh -c 'echo $$ID_SERIAL_SHORT | rev | cut -c -8 | rev'", SYMLINK+="ttyUSB_%c.%s{bInterfaceNumber}"
# ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="usb", ENV{ID_FS_USAGE}=="filesystem", MODE="0666", PROGRAM="/bin/sh -c 'echo $$ID_SERIAL_SHORT | rev | cut -c -8 | rev'", RUN{program}+="/usr/bin/systemd-mount --no-block --automount=yes --collect $devnode /media/blkUSB_%c.%s{bInterfaceNumber}"
+import argparse
import os
import sys
import time
-import click
import serial
import subprocess
import json
@@ -318,13 +318,18 @@ def test_hid_composite_freertos(id):
# -------------------------------------------------------------
# Main
# -------------------------------------------------------------
[email protected]('config_file')
[email protected]('-b', '--board', multiple=True, default=None, help='Boards to test, all if not specified')
-def main(config_file, board):
+def main():
"""
Hardware test on specified boards
"""
+ parser = argparse.ArgumentParser()
+ parser.add_argument('config_file', help='Configuration JSON file')
+ parser.add_argument('-b', '--board', action='append', default=[], help='Boards to test, all if not specified')
+ args = parser.parse_args()
+
+ config_file = args.config_file
+ boards = args.board
+
config_file = os.path.join(os.path.dirname(__file__), config_file)
with open(config_file) as f:
config = json.load(f)
@@ -334,10 +339,10 @@ def main(config_file, board):
'cdc_dual_ports', 'cdc_msc', 'dfu', 'dfu_runtime', 'hid_boot_interface',
]
- if len(board) == 0:
+ if len(boards) == 0:
config_boards = config['boards']
else:
- config_boards = [e for e in config['boards'] if e['name'] in board]
+ config_boards = [e for e in config['boards'] if e['name'] in boards]
for item in config_boards:
name = item['name']
diff --git a/test/hil/pi4.json b/test/hil/pi4.json
index 04329bb64..bdb8a5fa5 100644
--- a/test/hil/pi4.json
+++ b/test/hil/pi4.json
@@ -22,6 +22,16 @@
"flasher_product": "ItsyBitsy M4 Express",
"flasher_reset_pin": "2",
"flasher_args": "--offset 0x4000"
+ },
+ {
+ "name": "espressif_s3_devkitm",
+ "uid": "84F703C084E4",
+ "tests": [
+ "cdc_msc_freertos", "hid_composite_freertos"
+ ],
+ "flasher": "esptool",
+ "flasher_sn": "3ea619acd1cdeb11a0a0b806e93fd3f1",
+ "flasher_args": "-b 1500000"
}
]
}
diff --git a/test/hil/pi4_esp32.json b/test/hil/pi4_esp32.json
deleted file mode 100644
index c95dd2d4e..000000000
--- a/test/hil/pi4_esp32.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "boards": [
- {
- "name": "espressif_s3_devkitm",
- "uid": "84F703C084E4",
- "tests": [
- "cdc_msc_freertos", "hid_composite_freertos"
- ],
- "flasher": "esptool",
- "flasher_sn": "3ea619acd1cdeb11a0a0b806e93fd3f1",
- "flasher_args": "-b 1500000"
- }
- ]
-}