mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2025-10-10 15:12:41 +02:00
Actions: unit_test and updater timeouts (#2807)
* added some extra timeouts, fixed duration of units run command and minor logging changes. No list_ports yet needed * increased timeouts * make pvs happy --------- Co-authored-by: doomwastaken <k.volkov@flipperdevices.com> Co-authored-by: SG <who.just.the.doctor@gmail.com>
This commit is contained in:
committed by
GitHub
parent
0a5508a8a1
commit
e680cf59b6
5
.github/workflows/unit_tests.yml
vendored
5
.github/workflows/unit_tests.yml
vendored
@@ -29,12 +29,14 @@ jobs:
|
|||||||
- name: 'Flash unit tests firmware'
|
- name: 'Flash unit tests firmware'
|
||||||
id: flashing
|
id: flashing
|
||||||
if: success()
|
if: success()
|
||||||
|
timeout-minutes: 5
|
||||||
run: |
|
run: |
|
||||||
./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
|
./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
|
||||||
|
|
||||||
- name: 'Wait for flipper and format ext'
|
- name: 'Wait for flipper and format ext'
|
||||||
id: format_ext
|
id: format_ext
|
||||||
if: steps.flashing.outcome == 'success'
|
if: steps.flashing.outcome == 'success'
|
||||||
|
timeout-minutes: 5
|
||||||
run: |
|
run: |
|
||||||
source scripts/toolchain/fbtenv.sh
|
source scripts/toolchain/fbtenv.sh
|
||||||
python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
|
python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
|
||||||
@@ -43,6 +45,7 @@ jobs:
|
|||||||
- name: 'Copy assets and unit data, reboot and wait for flipper'
|
- name: 'Copy assets and unit data, reboot and wait for flipper'
|
||||||
id: copy
|
id: copy
|
||||||
if: steps.format_ext.outcome == 'success'
|
if: steps.format_ext.outcome == 'success'
|
||||||
|
timeout-minutes: 3
|
||||||
run: |
|
run: |
|
||||||
source scripts/toolchain/fbtenv.sh
|
source scripts/toolchain/fbtenv.sh
|
||||||
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} -f send assets/resources /ext
|
python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} -f send assets/resources /ext
|
||||||
@@ -53,7 +56,7 @@ jobs:
|
|||||||
- name: 'Run units and validate results'
|
- name: 'Run units and validate results'
|
||||||
id: run_units
|
id: run_units
|
||||||
if: steps.copy.outcome == 'success'
|
if: steps.copy.outcome == 'success'
|
||||||
timeout-minutes: 2.5
|
timeout-minutes: 5
|
||||||
run: |
|
run: |
|
||||||
source scripts/toolchain/fbtenv.sh
|
source scripts/toolchain/fbtenv.sh
|
||||||
python3 scripts/testing/units.py ${{steps.device.outputs.flipper}}
|
python3 scripts/testing/units.py ${{steps.device.outputs.flipper}}
|
||||||
|
2
.github/workflows/updater_test.yml
vendored
2
.github/workflows/updater_test.yml
vendored
@@ -30,6 +30,7 @@ jobs:
|
|||||||
|
|
||||||
- name: 'Flashing target firmware'
|
- name: 'Flashing target firmware'
|
||||||
id: first_full_flash
|
id: first_full_flash
|
||||||
|
timeout-minutes: 5
|
||||||
run: |
|
run: |
|
||||||
source scripts/toolchain/fbtenv.sh
|
source scripts/toolchain/fbtenv.sh
|
||||||
./fbt flash_usb_full PORT=${{steps.device.outputs.flipper}} FORCE=1
|
./fbt flash_usb_full PORT=${{steps.device.outputs.flipper}} FORCE=1
|
||||||
@@ -37,6 +38,7 @@ jobs:
|
|||||||
|
|
||||||
- name: 'Validating updater'
|
- name: 'Validating updater'
|
||||||
id: second_full_flash
|
id: second_full_flash
|
||||||
|
timeout-minutes: 5
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
source scripts/toolchain/fbtenv.sh
|
source scripts/toolchain/fbtenv.sh
|
||||||
|
@@ -35,7 +35,7 @@ TUPLE_DEF2(
|
|||||||
M_DEFAULT_OPLIST)
|
M_DEFAULT_OPLIST)
|
||||||
|
|
||||||
/* Define the array, register the oplist and define further algorithms on it */
|
/* Define the array, register the oplist and define further algorithms on it */
|
||||||
ARRAY_DEF(SubGhzFrequencyAnalyzerLogItemArray, SubGhzFrequencyAnalyzerLogItem_t)
|
ARRAY_DEF(SubGhzFrequencyAnalyzerLogItemArray, SubGhzFrequencyAnalyzerLogItem_t) //-V779
|
||||||
#define M_OPL_SubGhzFrequencyAnalyzerLogItemArray_t() \
|
#define M_OPL_SubGhzFrequencyAnalyzerLogItemArray_t() \
|
||||||
ARRAY_OPLIST(SubGhzFrequencyAnalyzerLogItemArray, M_OPL_SubGhzFrequencyAnalyzerLogItem_t())
|
ARRAY_OPLIST(SubGhzFrequencyAnalyzerLogItemArray, M_OPL_SubGhzFrequencyAnalyzerLogItem_t())
|
||||||
ALGO_DEF(SubGhzFrequencyAnalyzerLogItemArray, SubGhzFrequencyAnalyzerLogItemArray_t)
|
ALGO_DEF(SubGhzFrequencyAnalyzerLogItemArray, SubGhzFrequencyAnalyzerLogItemArray_t)
|
||||||
|
@@ -8,6 +8,7 @@ import time
|
|||||||
def flp_serial_by_name(flp_name):
|
def flp_serial_by_name(flp_name):
|
||||||
if sys.platform == "darwin": # MacOS
|
if sys.platform == "darwin": # MacOS
|
||||||
flp_serial = "/dev/cu.usbmodemflip_" + flp_name + "1"
|
flp_serial = "/dev/cu.usbmodemflip_" + flp_name + "1"
|
||||||
|
logging.info(f"Darwin, looking for {flp_serial}")
|
||||||
elif sys.platform == "linux": # Linux
|
elif sys.platform == "linux": # Linux
|
||||||
flp_serial = (
|
flp_serial = (
|
||||||
"/dev/serial/by-id/usb-Flipper_Devices_Inc._Flipper_"
|
"/dev/serial/by-id/usb-Flipper_Devices_Inc._Flipper_"
|
||||||
@@ -16,10 +17,12 @@ def flp_serial_by_name(flp_name):
|
|||||||
+ flp_name
|
+ flp_name
|
||||||
+ "-if00"
|
+ "-if00"
|
||||||
)
|
)
|
||||||
|
logging.info(f"linux, looking for {flp_serial}")
|
||||||
|
|
||||||
if os.path.exists(flp_serial):
|
if os.path.exists(flp_serial):
|
||||||
return flp_serial
|
return flp_serial
|
||||||
else:
|
else:
|
||||||
|
logging.info(f"Couldn't find {logging.info} on this attempt.")
|
||||||
if os.path.exists(flp_name):
|
if os.path.exists(flp_name):
|
||||||
return flp_name
|
return flp_name
|
||||||
else:
|
else:
|
||||||
@@ -38,7 +41,7 @@ def main():
|
|||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
datefmt="%Y-%m-%d %H:%M:%S",
|
datefmt="%Y-%m-%d %H:%M:%S",
|
||||||
)
|
)
|
||||||
logging.info("Waiting for Flipper to be ready...")
|
logging.info(f"Waiting for Flipper {flipper_name} to be ready...")
|
||||||
|
|
||||||
while flipper == "" and elapsed < UPDATE_TIMEOUT:
|
while flipper == "" and elapsed < UPDATE_TIMEOUT:
|
||||||
elapsed += 1
|
elapsed += 1
|
||||||
|
@@ -20,13 +20,13 @@ def main():
|
|||||||
logging.error("Flipper not found!")
|
logging.error("Flipper not found!")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
with serial.Serial(flp_serial, timeout=1) as flipper:
|
with serial.Serial(flp_serial, timeout=10) as flipper:
|
||||||
logging.info(f"Found Flipper at {flp_serial}")
|
logging.info(f"Found Flipper at {flp_serial}")
|
||||||
flipper.baudrate = 230400
|
flipper.baudrate = 230400
|
||||||
flipper.flushOutput()
|
flipper.flushOutput()
|
||||||
flipper.flushInput()
|
flipper.flushInput()
|
||||||
|
|
||||||
flipper.timeout = 180
|
flipper.timeout = 300
|
||||||
|
|
||||||
flipper.read_until(b">: ").decode("utf-8")
|
flipper.read_until(b">: ").decode("utf-8")
|
||||||
flipper.write(b"unit_tests\r")
|
flipper.write(b"unit_tests\r")
|
||||||
|
Reference in New Issue
Block a user