Skip to content

Commit cd23562

Browse files
committed
test(ci): added test without upload and without testing command
Hopefully issue will be fixed :(
1 parent 8e3287c commit cd23562

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

.github/workflows/tflm_wrapper_integration_test.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,36 @@ jobs:
5353
sudo mv qemu/bin/qemu-system-xtensa /usr/local/bin/
5454
sudo chmod +x /usr/local/bin/qemu-system-xtensa
5555
56+
- name: Build tests
57+
run: |
58+
# First just build the test firmware
59+
platformio test --without-uploading --without-testing -e esp32-s3-devkitc-1-qemu
60+
5661
- name: Run tests with QEMU
5762
run: |
58-
# Create a script to run tests with QEMU
59-
echo '#!/bin/bash
60-
qemu-system-xtensa \
63+
# Create an empty flash file
64+
dd if=/dev/zero of=flash.bin bs=1M count=4
65+
66+
# Run QEMU directly with the test firmware
67+
timeout 300 qemu-system-xtensa \
6168
-machine esp32s3 \
6269
-nographic \
6370
-drive file=flash.bin,if=mtd,format=raw \
6471
-global driver=timer.esp32.timg,property=wdt_disable,value=true \
6572
-kernel .pio/build/esp32-s3-devkitc-1/firmware.elf \
66-
-serial stdio' > run_tests.sh
67-
chmod +x run_tests.sh
68-
69-
# Create an empty flash file
70-
dd if=/dev/zero of=flash.bin bs=1M count=4
73+
-serial file:test_output.log \
74+
2>&1 | tee qemu_output.log &
7175
72-
# Build and run tests
73-
platformio test -e esp32-s3-devkitc-1 2>&1 | tee test_output.log
76+
# Give QEMU some time to run the tests
77+
sleep 30
7478
7579
# Check test results
7680
if grep -q "PASSED" test_output.log; then
7781
echo "Tests passed successfully!"
7882
exit 0
7983
else
80-
echo "Tests failed!"
84+
echo "Tests failed or didn't complete!"
85+
cat test_output.log
8186
exit 1
8287
fi
8388
@@ -88,4 +93,5 @@ jobs:
8893
name: test-results
8994
path: |
9095
test_output.log
91-
.pio/build/esp32-s3-devkitc-1/test_output.txt
96+
qemu_output.log
97+
.pio/build/esp32-s3-devkitc-1/firmware.elf

platformio.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,17 @@ lib_deps =
2222
https://github.com/eloquentarduino/EloquentTinyML.git
2323
https://github.com/arrhythmia-detection/tflm_esp32.git
2424

25+
[env:esp32-s3-devkitc-1-qemu]
26+
platform = espressif32
27+
board = esp32-s3-devkitc-1
28+
framework = arduino
29+
test_framework = unity
30+
test_build_src = yes
31+
monitor_speed = 115200
32+
build_flags =
33+
-DUNITY_INCLUDE_DOUBLE
34+
-DUNITY_DOUBLE_PRECISION=1e-12
35+
-DPIO_UNIT_TESTING=1
36+
upload_protocol = esp-prog
37+
test_speed = 115200
38+
test_port = socket://localhost:5555

0 commit comments

Comments
 (0)