Enable WASI tests on Windows CI (#2699)
Most of the WASI filesystem tests require at least creating/deleting a file to test filesystem functionality so some additional filesystem APIs have been implemented on Windows so we can test what has been implemented so far. For those WASI functions which haven't been implemented, we skip the tests. These will be implemented in a future PR after which we can remove the relevant filters. Additionally, in order to run the WASI socket and thread tests, we need to install the wasi-sdk in CI and build the test source code prior to running the tests.
This commit is contained in:
@ -566,7 +566,7 @@ function wasi_certification_test()
|
||||
cd wasi-testsuite
|
||||
git reset --hard ${WASI_TESTSUITE_COMMIT}
|
||||
|
||||
bash ../../wasi-test-script/run_wasi_tests.sh $1 $TARGET \
|
||||
bash ../../wasi-test-script/run_wasi_tests.sh $1 $TARGET $WASI_TEST_FILTER \
|
||||
| tee -a ${REPORT_DIR}/wasi_test_report.txt
|
||||
ret=${PIPESTATUS[0]}
|
||||
|
||||
@ -836,6 +836,17 @@ function trigger()
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_SANITIZER=tsan"
|
||||
fi
|
||||
|
||||
# Make sure we're using the builtin WASI libc implementation
|
||||
# if we're running the wasi certification tests.
|
||||
if [[ $TEST_CASE_ARR ]]; then
|
||||
for test in "${TEST_CASE_ARR[@]}"; do
|
||||
if [[ "$test" == "wasi_certification" ]]; then
|
||||
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
for t in "${TYPE[@]}"; do
|
||||
case $t in
|
||||
"classic-interp")
|
||||
|
||||
@ -9,6 +9,7 @@ THIS_DIR=$(cd $(dirname $0) && pwd -P)
|
||||
|
||||
readonly MODE=$1
|
||||
readonly TARGET=$2
|
||||
readonly TEST_FILTER=$3
|
||||
|
||||
readonly WORK_DIR=$PWD
|
||||
|
||||
@ -41,8 +42,21 @@ readonly THREAD_STRESS_TESTS="${WAMR_DIR}/core/iwasm/libraries/lib-wasi-threads/
|
||||
readonly LIB_SOCKET_TESTS="${WAMR_DIR}/core/iwasm/libraries/lib-socket/test/"
|
||||
|
||||
run_aot_tests () {
|
||||
local tests=("$@")
|
||||
local -n tests=$1
|
||||
local -n excluded_tests=$2
|
||||
|
||||
for test_wasm in ${tests[@]}; do
|
||||
# get the base file name from the filepath
|
||||
local test_name=${test_wasm##*/}
|
||||
test_name=${test_name%.wasm}
|
||||
|
||||
for excluded_test in "${excluded_tests[@]}"; do
|
||||
if [[ $excluded_test == "\"$test_name\"" ]]; then
|
||||
echo "Skipping test $test_name"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
|
||||
local iwasm="${IWASM_CMD}"
|
||||
if [[ $test_wasm =~ "stress" ]]; then
|
||||
iwasm="${IWASM_CMD_STRESS}"
|
||||
@ -80,15 +94,21 @@ if [[ $MODE != "aot" ]];then
|
||||
$PYTHON_EXE -m pip install -r test-runner/requirements.txt
|
||||
|
||||
export TEST_RUNTIME_EXE="${IWASM_CMD}"
|
||||
$PYTHON_EXE ${THIS_DIR}/pipe.py | $PYTHON_EXE test-runner/wasi_test_runner.py \
|
||||
-r adapters/wasm-micro-runtime.py \
|
||||
-t \
|
||||
${C_TESTS} \
|
||||
${RUST_TESTS} \
|
||||
${ASSEMBLYSCRIPT_TESTS} \
|
||||
${THREAD_PROPOSAL_TESTS} \
|
||||
${THREAD_INTERNAL_TESTS} \
|
||||
${LIB_SOCKET_TESTS} \
|
||||
|
||||
TEST_OPTIONS="-r adapters/wasm-micro-runtime.py \
|
||||
-t \
|
||||
${C_TESTS} \
|
||||
${RUST_TESTS} \
|
||||
${ASSEMBLYSCRIPT_TESTS} \
|
||||
${THREAD_PROPOSAL_TESTS} \
|
||||
${THREAD_INTERNAL_TESTS} \
|
||||
${LIB_SOCKET_TESTS}"
|
||||
|
||||
if [ -n "$TEST_FILTER" ]; then
|
||||
TEST_OPTIONS="${TEST_OPTIONS} --exclude-filter ${TEST_FILTER}"
|
||||
fi
|
||||
|
||||
$PYTHON_EXE ${THIS_DIR}/pipe.py | $PYTHON_EXE test-runner/wasi_test_runner.py $TEST_OPTIONS
|
||||
|
||||
ret=${PIPESTATUS[1]}
|
||||
|
||||
@ -114,7 +134,17 @@ else
|
||||
for testsuite in ${THREAD_STRESS_TESTS} ${THREAD_PROPOSAL_TESTS} ${THREAD_INTERNAL_TESTS}; do
|
||||
tests=$(ls ${testsuite}*.wasm)
|
||||
tests_array=($tests)
|
||||
run_aot_tests "${tests_array[@]}"
|
||||
|
||||
if [ -n "$TEST_FILTER" ]; then
|
||||
readarray -t excluded_tests_array < <(jq -c \
|
||||
--slurpfile testsuite_manifest $testsuite/manifest.json \
|
||||
'.[$testsuite_manifest[0].name] // {} | keys[]' \
|
||||
$TEST_FILTER)
|
||||
else
|
||||
excluded_tests_array=()
|
||||
fi
|
||||
|
||||
run_aot_tests tests_array excluded_tests_array
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user