Skip to content

Commit d871c97

Browse files
committed
tools/ci.sh: Run natmod tests as part of CI for Unix/RV64.
This commit updates the test procedure for the Unix port targeting the RV64 platform to also run the battery of native modules test that is part of the QEMU port. Unfortunately this required a few changes to the CI setup since the Unix port was still using an older version of Ubuntu LTS than the RISC-V natmods build infrastructure expects. Updating the OS version just for the RV64 Unix target brought a couple of issues when building the code (an extra package is now needed to let FFI build) and running tests (QEMU binfmt support requires a new setup). Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
1 parent d44685e commit d871c97

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

.github/workflows/ports_unix.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ jobs:
277277
run: tests/run-tests.py --print-failures
278278

279279
qemu_riscv64:
280-
# ubuntu-22.04 is needed for older libffi.
281-
runs-on: ubuntu-22.04
280+
runs-on: ubuntu-latest
282281
steps:
283282
- uses: actions/checkout@v6
284283
- name: Install packages

tools/ci.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -946,26 +946,34 @@ function ci_unix_qemu_arm_run_tests {
946946
}
947947

948948
function ci_unix_qemu_riscv64_setup {
949+
ci_gcc_riscv_setup
949950
sudo apt-get update
950-
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
951-
sudo apt-get install qemu-user
952-
qemu-riscv64 --version
953-
sudo mkdir /etc/qemu-binfmt
954-
sudo ln -s /usr/riscv64-linux-gnu/ /etc/qemu-binfmt/riscv64
951+
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libltdl-dev
952+
sudo pip3 install pyelftools
953+
sudo pip3 install ar
954+
sudo apt-get install qemu-user-static
955+
qemu-riscv64-static --version
956+
sudo mkdir -p /usr/gnemul
957+
sudo ln -s /usr/riscv64-linux-gnu /usr/gnemul/qemu-riscv64
955958
}
956959

957960
function ci_unix_qemu_riscv64_build {
958961
ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_RISCV64[@]}"
959962
ci_unix_build_ffi_lib_helper riscv64-linux-gnu-gcc
963+
ci_native_mpy_modules_build rv64imc
960964
}
961965

962966
function ci_unix_qemu_riscv64_run_tests {
963967
# Issues with RISCV-64 tests:
964-
# - thread/stress_aes.py takes around 140 seconds
968+
# - misc/sys_settrace_features.py doesn't work with CPython 3.12
969+
# - thread/stress_aes.py takes around 180 seconds
965970
# - thread/stress_recurse.py is flaky
966971
# - thread/thread_gc1.py is flaky
967972
file ./ports/unix/build-coverage/micropython
968-
(cd tests && MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython MICROPY_TEST_TIMEOUT=180 ./run-tests.py --exclude 'thread/stress_recurse.py|thread/thread_gc1.py')
973+
pushd tests
974+
MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython MICROPY_TEST_TIMEOUT=200 ./run-tests.py --exclude 'misc/sys_settrace_features.py|thread/stress_recurse.py|thread/thread_gc1.py'
975+
MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-natmodtests.py extmod/btree*.py extmod/deflate*.py extmod/framebuf*.py extmod/heapq*.py extmod/random_basic*.py extmod/re*.py
976+
popd
969977
}
970978

971979
function ci_unix_repr_b_build {

0 commit comments

Comments
 (0)