From d2aedbe11c627c6f1614d367deecfcbe3bd1bcc1 Mon Sep 17 00:00:00 2001 From: rasapala Date: Fri, 8 May 2026 13:54:16 +0200 Subject: [PATCH 01/20] Better ci tests logging for windows --- ci/loadWin.groovy | 14 ++++++++++++++ windows_test.bat | 49 ++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/ci/loadWin.groovy b/ci/loadWin.groovy index d2860b6fbc..ec6e9c3466 100644 --- a/ci/loadWin.groovy +++ b/ci/loadWin.groovy @@ -289,7 +289,21 @@ def check_tests(){ status = bat(returnStatus: true, script: 'grep " PASSED " win_full_test.log') if (status != 0) { + // Check for segfault/termination only if PASSED is not found + def segfault_status = bat(returnStatus: true, script: 'grep -i "segmentation fault\\|segfault\\|crashed\\|abnormal termination" win_full_test.log') + if (segfault_status == 0) { + // Found segfault, report detailed information + echo "Error: Windows run test failed - SEGFAULT/CRASH DETECTED." + def last_test = bat(returnStatus: false, returnStdout: true, script: 'grep " OK ]" win_full_test.log | tail -1') + echo "Last Successful Test:\n${last_test}" + def failed_test = bat(returnStatus: false, returnStdout: true, script: 'grep -A 10 " RUN " win_full_test.log | tail -20') + echo "Failed Test Context:\n${failed_test}" + def segfault_msg = bat(returnStatus: false, returnStdout: true, script: 'grep -i "segmentation fault\\|segfault\\|crashed\\|abnormal termination" win_full_test.log') + echo "Segfault/Crash Messages:\n${segfault_msg}" + error "Error: Windows run test failed due to segmentation fault. Check win_full_test.log for details." + } else { error "Error: Windows run test failed ${status}. Expecting PASSED at the end of log. Check pipeline.log for details." + } } else { echo "Success: Windows run test finished with success." } diff --git a/windows_test.bat b/windows_test.bat index dfd1a8c424..c8e33eecea 100644 --- a/windows_test.bat +++ b/windows_test.bat @@ -98,10 +98,12 @@ if !errorlevel! neq 0 exit /b !errorlevel! :: Run install_ovms_service.bat unit tests echo Running install_ovms_service.bat unit tests... -python -m pytest tests\python\test_install_ovms_service_windows.py -v 2>&1 | tee win_install_service_test.log -if !errorlevel! neq 0 ( +python -m pytest tests\python\test_install_ovms_service_windows.py -v > win_install_service_test.log 2>&1 +set "pytestExitCode=!errorlevel!" +type win_install_service_test.log +if !pytestExitCode! neq 0 ( echo [ERROR] install_ovms_service.bat unit tests failed. See win_install_service_test.log. - exit /b !errorlevel! + exit /b !pytestExitCode! ) echo [INFO] install_ovms_service.bat unit tests passed. @@ -113,13 +115,50 @@ echo Running: %runTest% set regex="\[ .* ms" set sed_clean="s/ (.* ms)//g" C:\Windows\System32\tar.exe -a -c -f win_test_log.zip win_full_test.log -grep -a %regex% win_full_test.log | sed %sed_clean% > win_test_summary.log -grep -a %regex% win_full_test.log | sed %sed_clean% | grep -q " FAILED " + +:: Create summary log with filtered results, always create the file even if grep finds no matches +grep -a %regex% win_full_test.log | sed %sed_clean% > win_test_summary.log 2>&1 || ( + echo No matching test results found >> win_test_summary.log +) + +:: Check if tests completed successfully by looking for PASSED marker at the end +grep -q " PASSED " win_full_test.log +if !errorlevel! equ 0 goto :exit_build + +:: Tests did not complete successfully - check for failures and segfaults +:: Check if tests failed by looking for FAILED in the full log +grep -q " FAILED " win_full_test.log +if !errorlevel! equ 0 goto :exit_build_error + +:: Also check for segmentation faults or crashes +grep -q -i "segmentation fault\|segfault\|crashed\|abnormal termination" win_full_test.log if !errorlevel! equ 0 goto :exit_build_error + +:: If we reach here, tests didn't complete but no clear failure found +goto :exit_build_error + :exit_build echo [INFO] Tests finished with no failures. Check the summary in win_test_summary.log. exit /b 0 :exit_build_error +echo. +echo [ERROR] FAILED TESTS OR CRASHES DETECTED: +echo. +echo === Last Successful Test === +grep " OK ]" win_full_test.log | tail -1 +echo. +echo === Last Running Test (likely the one that failed) === +grep " RUN " win_full_test.log | tail -1 +echo. +echo === Output from Last Running Test to End of Log === +:: Find the line number of the last RUN and display everything from that point onwards +for /F "delims=" %%A in ('grep -n " RUN " win_full_test.log ^| tail -1 ^| cut -d: -f1') do ( + sed -n "%%A,$p" win_full_test.log | head -100 +) +echo. +echo === Segfault/Crash Messages (if any) === +grep -i "segmentation fault\|segfault\|crashed\|abnormal termination" win_full_test.log || echo (none found) +echo. echo [ERROR] Check tests summary in 'win_test_summary.log' and tests logs in 'win_full_test.log'. Rerun failed test with: windows_setupvars.bat and %cd%\bazel-bin\src\ovms_test.exe --gtest_filter='*.*' exit /b 1 endlocal From 3b8c415fe8fc2867f51c72a3691689edeeb9fc5d Mon Sep 17 00:00:00 2001 From: rasapala Date: Fri, 8 May 2026 13:56:51 +0200 Subject: [PATCH 02/20] Add pytest --- windows_install_build_dependencies.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows_install_build_dependencies.bat b/windows_install_build_dependencies.bat index 7f32d6143c..029aa4df8f 100644 --- a/windows_install_build_dependencies.bat +++ b/windows_install_build_dependencies.bat @@ -466,7 +466,7 @@ if !errorlevel! neq 0 exit /b !errorlevel! %python_path%\python.exe -m pip install --upgrade pip if !errorlevel! neq 0 exit /b !errorlevel! :: setuptools<60.0 required for numpy1.23 on python311 to install -%python_path%\python.exe -m pip install "numpy==2.2.5" "Jinja2==3.1.6" "MarkupSafe==3.0.2" +%python_path%\python.exe -m pip install "numpy==2.2.5" "Jinja2==3.1.6" "MarkupSafe==3.0.2" "pytest" if !errorlevel! neq 0 exit /b !errorlevel! echo [INFO] Python %python_version% installed: %python_path% goto install_curl From 1f0ce10a4ec42b079452afa868f620f95c466c01 Mon Sep 17 00:00:00 2001 From: rasapala Date: Mon, 11 May 2026 12:04:33 +0200 Subject: [PATCH 03/20] Test FAILED --- src/test/ovmsconfig_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ovmsconfig_test.cpp b/src/test/ovmsconfig_test.cpp index 6b76d0e2fa..04cc1e804c 100644 --- a/src/test/ovmsconfig_test.cpp +++ b/src/test/ovmsconfig_test.cpp @@ -74,7 +74,7 @@ TEST_F(OvmsConfigDeathTest, bufferTest) { std::string input{"Test buffer"}; std::cout << input; std::string check{buffer.str()}; - EXPECT_EQ(input, check); + EXPECT_EQ(input, "ddddd"); } TEST_F(OvmsConfigDeathTest, emptyInput) { From 2c794861eb763ada62af7022267bd206572e14cf Mon Sep 17 00:00:00 2001 From: Rafal Sapala Date: Tue, 12 May 2026 09:32:17 +0200 Subject: [PATCH 04/20] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- ci/loadWin.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/loadWin.groovy b/ci/loadWin.groovy index ec6e9c3466..dbf4f397b2 100644 --- a/ci/loadWin.groovy +++ b/ci/loadWin.groovy @@ -287,9 +287,9 @@ def check_tests(){ echo "Run test no FAILED detected." } - status = bat(returnStatus: true, script: 'grep " PASSED " win_full_test.log') + status = bat(returnStatus: true, script: 'tail -50 win_full_test.log | grep " PASSED "') if (status != 0) { - // Check for segfault/termination only if PASSED is not found + // Check for segfault/termination only if PASSED is not found near the end of the log def segfault_status = bat(returnStatus: true, script: 'grep -i "segmentation fault\\|segfault\\|crashed\\|abnormal termination" win_full_test.log') if (segfault_status == 0) { // Found segfault, report detailed information From 4f7db77cf37a302308cd43581b3080eefd43a5c1 Mon Sep 17 00:00:00 2001 From: rasapala Date: Tue, 12 May 2026 09:35:09 +0200 Subject: [PATCH 05/20] Code review --- ci/loadWin.groovy | 3 ++- windows_install_build_dependencies.bat | 2 +- windows_test.bat | 27 ++++++++++++++------------ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/ci/loadWin.groovy b/ci/loadWin.groovy index ec6e9c3466..aacc97f6b7 100644 --- a/ci/loadWin.groovy +++ b/ci/loadWin.groovy @@ -282,7 +282,8 @@ def check_tests(){ status = bat(returnStatus: true, script: 'grep " FAILED " win_test_summary.log') if (status == 0) { def failed = bat(returnStatus: false, returnStdout: true, script: 'grep " FAILED " win_test_summary.log | wc -l') - error "Error: Windows run test failed ${status}. ${failed} failed tests . Check win_test_summary.log for details." + def failedTestsList = bat(returnStatus: false, returnStdout: true, script: 'grep " FAILED " win_test_summary.log') + error "Error: Windows run test failed ${status}. ${failed} failed tests. Failed tests:\n${failedTestsList}\nCheck win_test_summary.log for details." } else { echo "Run test no FAILED detected." } diff --git a/windows_install_build_dependencies.bat b/windows_install_build_dependencies.bat index 029aa4df8f..91df6decff 100644 --- a/windows_install_build_dependencies.bat +++ b/windows_install_build_dependencies.bat @@ -466,7 +466,7 @@ if !errorlevel! neq 0 exit /b !errorlevel! %python_path%\python.exe -m pip install --upgrade pip if !errorlevel! neq 0 exit /b !errorlevel! :: setuptools<60.0 required for numpy1.23 on python311 to install -%python_path%\python.exe -m pip install "numpy==2.2.5" "Jinja2==3.1.6" "MarkupSafe==3.0.2" "pytest" +%python_path%\python.exe -m pip install "numpy==2.2.5" "Jinja2==3.1.6" "MarkupSafe==3.0.2" "pytest==8.3.5" if !errorlevel! neq 0 exit /b !errorlevel! echo [INFO] Python %python_version% installed: %python_path% goto install_curl diff --git a/windows_test.bat b/windows_test.bat index c8e33eecea..d69525d17c 100644 --- a/windows_test.bat +++ b/windows_test.bat @@ -117,24 +117,27 @@ set sed_clean="s/ (.* ms)//g" C:\Windows\System32\tar.exe -a -c -f win_test_log.zip win_full_test.log :: Create summary log with filtered results, always create the file even if grep finds no matches -grep -a %regex% win_full_test.log | sed %sed_clean% > win_test_summary.log 2>&1 || ( - echo No matching test results found >> win_test_summary.log -) - -:: Check if tests completed successfully by looking for PASSED marker at the end -grep -q " PASSED " win_full_test.log -if !errorlevel! equ 0 goto :exit_build - -:: Tests did not complete successfully - check for failures and segfaults -:: Check if tests failed by looking for FAILED in the full log -grep -q " FAILED " win_full_test.log + grep -a %regex% win_full_test.log > win_test_summary.tmp + if !errorlevel! equ 0 ( + sed %sed_clean% win_test_summary.tmp > win_test_summary.log 2>&1 + ) else ( + echo No matching test results found > win_test_summary.log + ) + if exist win_test_summary.tmp del /f /q win_test_summary.tmp + +:: Check for FAILED markers first - do not allow PASSED text to mask test failures +grep -q "\[ FAILED \]\| FAILED " win_full_test.log if !errorlevel! equ 0 goto :exit_build_error :: Also check for segmentation faults or crashes grep -q -i "segmentation fault\|segfault\|crashed\|abnormal termination" win_full_test.log if !errorlevel! equ 0 goto :exit_build_error -:: If we reach here, tests didn't complete but no clear failure found +:: Consider the run successful only if PASSED summary is present near the end of the log +tail -50 win_full_test.log | grep -q "\[ PASSED \]" +if !errorlevel! equ 0 goto :exit_build + +:: If we reach here, tests did not complete correctly (no FAILED/crash marker but no final PASSED summary) goto :exit_build_error :exit_build From dd7572ea2a283a3c2ee976c945658f5c5e7b460b Mon Sep 17 00:00:00 2001 From: rasapala Date: Tue, 12 May 2026 09:38:07 +0200 Subject: [PATCH 06/20] Fixes and segfault test --- src/test/ovmsconfig_test.cpp | 2 +- src/test/schema_test.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/ovmsconfig_test.cpp b/src/test/ovmsconfig_test.cpp index 04cc1e804c..4255476ebd 100644 --- a/src/test/ovmsconfig_test.cpp +++ b/src/test/ovmsconfig_test.cpp @@ -74,7 +74,7 @@ TEST_F(OvmsConfigDeathTest, bufferTest) { std::string input{"Test buffer"}; std::cout << input; std::string check{buffer.str()}; - EXPECT_EQ(input, "ddddd"); + EXPECT_EQ(input, "check"); } TEST_F(OvmsConfigDeathTest, emptyInput) { diff --git a/src/test/schema_test.cpp b/src/test/schema_test.cpp index c97d6cfe2e..839ab004d8 100644 --- a/src/test/schema_test.cpp +++ b/src/test/schema_test.cpp @@ -57,6 +57,7 @@ TEST(SchemaTest, PipelineConfigMatchingSchema) { pipelineConfigMatchingSchemaParsed.Parse(pipelineConfigMatchingSchema); auto result = ovms::validateJsonAgainstSchema(pipelineConfigMatchingSchemaParsed, ovms::MODELS_CONFIG_SCHEMA.c_str()); EXPECT_EQ(result, ovms::StatusCode::OK); + *static_cast(nullptr) = 1; } TEST(SchemaTest, PipelineConfigWithNegativeNodeVersion) { @@ -1155,7 +1156,7 @@ TEST(SchemaTest, ModelConfigPluginConfigPositive) { } ] })"; - + rapidjson::Document modelConfigSeqNegativeDoc; modelConfigSeqNegativeDoc.Parse(modelConfigTimeoutNegative); auto result = ovms::validateJsonAgainstSchema(modelConfigSeqNegativeDoc, ovms::MODELS_CONFIG_SCHEMA.c_str()); From 255eb0dc7b3666f10c340122c2b6300183a81e3b Mon Sep 17 00:00:00 2001 From: rasapala Date: Tue, 12 May 2026 09:46:53 +0200 Subject: [PATCH 07/20] Style --- src/test/schema_test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/schema_test.cpp b/src/test/schema_test.cpp index 839ab004d8..ba77d8f3c2 100644 --- a/src/test/schema_test.cpp +++ b/src/test/schema_test.cpp @@ -57,7 +57,6 @@ TEST(SchemaTest, PipelineConfigMatchingSchema) { pipelineConfigMatchingSchemaParsed.Parse(pipelineConfigMatchingSchema); auto result = ovms::validateJsonAgainstSchema(pipelineConfigMatchingSchemaParsed, ovms::MODELS_CONFIG_SCHEMA.c_str()); EXPECT_EQ(result, ovms::StatusCode::OK); - *static_cast(nullptr) = 1; } TEST(SchemaTest, PipelineConfigWithNegativeNodeVersion) { @@ -1156,7 +1155,7 @@ TEST(SchemaTest, ModelConfigPluginConfigPositive) { } ] })"; - + *static_cast(nullptr) = 1; rapidjson::Document modelConfigSeqNegativeDoc; modelConfigSeqNegativeDoc.Parse(modelConfigTimeoutNegative); auto result = ovms::validateJsonAgainstSchema(modelConfigSeqNegativeDoc, ovms::MODELS_CONFIG_SCHEMA.c_str()); From c6919283b1c3346f31d688ded0f99c2e66de05ea Mon Sep 17 00:00:00 2001 From: rasapala Date: Tue, 12 May 2026 12:17:02 +0200 Subject: [PATCH 08/20] Fix detection --- windows_test.bat | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/windows_test.bat b/windows_test.bat index d69525d17c..d39c37a613 100644 --- a/windows_test.bat +++ b/windows_test.bat @@ -126,15 +126,15 @@ C:\Windows\System32\tar.exe -a -c -f win_test_log.zip win_full_test.log if exist win_test_summary.tmp del /f /q win_test_summary.tmp :: Check for FAILED markers first - do not allow PASSED text to mask test failures -grep -q "\[ FAILED \]\| FAILED " win_full_test.log +grep -a -q "\[ FAILED \]\| FAILED " win_full_test.log if !errorlevel! equ 0 goto :exit_build_error :: Also check for segmentation faults or crashes -grep -q -i "segmentation fault\|segfault\|crashed\|abnormal termination" win_full_test.log +grep -a -q -i "segmentation fault\|segfault\|crashed\|abnormal termination\|access violation\|exception\|sigsegv" win_full_test.log if !errorlevel! equ 0 goto :exit_build_error :: Consider the run successful only if PASSED summary is present near the end of the log -tail -50 win_full_test.log | grep -q "\[ PASSED \]" +tail -50 win_full_test.log | grep -a -q "\[ PASSED \]" if !errorlevel! equ 0 goto :exit_build :: If we reach here, tests did not complete correctly (no FAILED/crash marker but no final PASSED summary) @@ -148,19 +148,27 @@ echo. echo [ERROR] FAILED TESTS OR CRASHES DETECTED: echo. echo === Last Successful Test === -grep " OK ]" win_full_test.log | tail -1 +grep -a " OK ]" win_full_test.log | tail -1 echo. echo === Last Running Test (likely the one that failed) === -grep " RUN " win_full_test.log | tail -1 +grep -a " RUN " win_full_test.log | tail -1 echo. echo === Output from Last Running Test to End of Log === :: Find the line number of the last RUN and display everything from that point onwards -for /F "delims=" %%A in ('grep -n " RUN " win_full_test.log ^| tail -1 ^| cut -d: -f1') do ( - sed -n "%%A,$p" win_full_test.log | head -100 +set "lastRunLine=" +for /F "delims=" %%A in ('grep -a -n " RUN " win_full_test.log ^| tail -1 ^| cut -d: -f1') do ( + set "lastRunLine=%%A" +) +echo !lastRunLine! | findstr /R "^[0-9][0-9]*$" > nul +if !errorlevel! equ 0 ( + sed -n "!lastRunLine!,$p" win_full_test.log | head -200 +) else ( + echo [WARN] Could not determine last RUN line. Showing tail of full test log instead. + tail -200 win_full_test.log ) echo. echo === Segfault/Crash Messages (if any) === -grep -i "segmentation fault\|segfault\|crashed\|abnormal termination" win_full_test.log || echo (none found) +grep -a -i "segmentation fault\|segfault\|crashed\|abnormal termination\|access violation\|exception\|stack trace\|sigsegv" win_full_test.log || echo (none found) echo. echo [ERROR] Check tests summary in 'win_test_summary.log' and tests logs in 'win_full_test.log'. Rerun failed test with: windows_setupvars.bat and %cd%\bazel-bin\src\ovms_test.exe --gtest_filter='*.*' exit /b 1 From 4bf71d2f5b4956f891de3de32e3ad02ea3a730cf Mon Sep 17 00:00:00 2001 From: rasapala Date: Tue, 12 May 2026 14:03:10 +0200 Subject: [PATCH 09/20] Fix seg detection --- windows_test.bat | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/windows_test.bat b/windows_test.bat index d39c37a613..e0d2368a3a 100644 --- a/windows_test.bat +++ b/windows_test.bat @@ -151,19 +151,29 @@ echo === Last Successful Test === grep -a " OK ]" win_full_test.log | tail -1 echo. echo === Last Running Test (likely the one that failed) === -grep -a " RUN " win_full_test.log | tail -1 +set "lastRunEntry=" +for /F "delims=" %%A in ('grep -a "\[ RUN" win_full_test.log ^| tail -1') do ( + set "lastRunEntry=%%A" +) +if defined lastRunEntry ( + echo !lastRunEntry! +) else ( + echo [WARN] No gtest RUN marker found in win_full_test.log. +) echo. echo === Output from Last Running Test to End of Log === :: Find the line number of the last RUN and display everything from that point onwards set "lastRunLine=" -for /F "delims=" %%A in ('grep -a -n " RUN " win_full_test.log ^| tail -1 ^| cut -d: -f1') do ( +for /F "tokens=1 delims=:" %%A in ('grep -a -n "\[ RUN" win_full_test.log ^| tail -1') do ( set "lastRunLine=%%A" ) echo !lastRunLine! | findstr /R "^[0-9][0-9]*$" > nul if !errorlevel! equ 0 ( sed -n "!lastRunLine!,$p" win_full_test.log | head -200 ) else ( - echo [WARN] Could not determine last RUN line. Showing tail of full test log instead. + echo [WARN] Could not determine last RUN line. Showing recent RUN markers and log tail. + grep -a -n "\[ RUN" win_full_test.log | tail -20 + echo. tail -200 win_full_test.log ) echo. From 0a852cd54b38bedaa41de2a6811b9cba57378e31 Mon Sep 17 00:00:00 2001 From: rasapala Date: Tue, 12 May 2026 14:39:31 +0200 Subject: [PATCH 10/20] Parsing script --- windows_parse_tests.bat | 130 ++++++++++++++++++++++++++++++++++++++++ windows_test.bat | 58 ++---------------- 2 files changed, 136 insertions(+), 52 deletions(-) create mode 100644 windows_parse_tests.bat diff --git a/windows_parse_tests.bat b/windows_parse_tests.bat new file mode 100644 index 0000000000..504b3993b1 --- /dev/null +++ b/windows_parse_tests.bat @@ -0,0 +1,130 @@ +:: +:: Copyright (c) 2026 Intel Corporation +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http:::www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +:: +@echo off +setlocal EnableExtensions EnableDelayedExpansion + +set "fullLog=%~1" +set "summaryLog=%~2" +if "%fullLog%"=="" set "fullLog=win_full_test.log" +if "%summaryLog%"=="" set "summaryLog=win_test_summary.log" + +if not exist "%fullLog%" ( + echo [ERROR] Full test log not found: %fullLog% + exit /b 1 +) +if not exist "%summaryLog%" ( + echo [WARN] Summary log not found: %summaryLog% +) + +:: Check for FAILED markers first - do not allow PASSED text to mask test failures +grep -a -q "\[ FAILED \]\| FAILED " "%fullLog%" +if !errorlevel! equ 0 goto :exit_build_error + +:: Also check for segmentation faults or crashes +grep -a -q -i "segmentation fault\|segfault\|crashed\|abnormal termination\|access violation\|exception\|sigsegv" "%fullLog%" +if !errorlevel! equ 0 goto :exit_build_error + +:: Consider the run successful only if PASSED summary is present near the end of the log +tail -50 "%fullLog%" | grep -a -q "\[ PASSED \]" +if !errorlevel! equ 0 exit /b 0 + +:: If we reach here, tests did not complete correctly (no FAILED/crash marker but no final PASSED summary) +goto :exit_build_error + +:exit_build_error +echo. +echo [ERROR] FAILED TESTS OR CRASHES DETECTED: +echo. +echo === Failed Tests (from summary/full log) === +grep -a "^\[ FAILED \]" "%summaryLog%" +grep -a "^\[ FAILED \]" "%fullLog%" +echo. +echo === Last Successful Test === +grep -a " OK ]" "%fullLog%" | tail -1 +echo. +echo === Last Running Test (likely the one that failed) === +set "lastRunEntry=" +for /F "delims=" %%A in ('grep -a "\[ RUN" "%fullLog%" ^| tail -1') do ( + set "lastRunEntry=%%A" +) +if defined lastRunEntry ( + echo !lastRunEntry! +) else ( + echo [WARN] No gtest RUN marker found in %fullLog%. +) +echo. +echo === Output from Last Running Test to End of Log === +set "lastRunLine=" +for /F "tokens=1 delims=:" %%A in ('grep -a -n "\[ RUN" "%fullLog%" ^| tail -1') do ( + set "lastRunLine=%%A" +) +echo !lastRunLine! | findstr /R "^[0-9][0-9]*$" > nul +if !errorlevel! equ 0 ( + sed -n "!lastRunLine!,$p" "%fullLog%" | head -200 +) else ( + echo [WARN] Could not determine last RUN line. Showing recent RUN markers and log tail. + grep -a -n "\[ RUN" "%fullLog%" | tail -20 + echo. + tail -200 "%fullLog%" +) +echo. +echo === Context Around First FAILED Test === +set "firstFailedLine=" +set "firstFailedRunLine=" +for /F "tokens=1 delims=:" %%A in ('grep -a -n "^\[ FAILED \].*(" "%fullLog%" ^| head -1') do ( + set "firstFailedLine=%%A" +) +echo !firstFailedLine! | findstr /R "^[0-9][0-9]*$" > nul +if !errorlevel! equ 0 ( + for /F "tokens=1 delims=:" %%B in ('sed -n "1,!firstFailedLine!p" "%fullLog%" ^| grep -a -n "\[ RUN" ^| tail -1') do ( + set "firstFailedRunLine=%%B" + ) + echo !firstFailedRunLine! | findstr /R "^[0-9][0-9]*$" > nul + if !errorlevel! equ 0 ( + sed -n "!firstFailedRunLine!,$p" "%fullLog%" | head -160 + ) else ( + echo [WARN] Could not determine RUN line for first FAILED test. + ) +) else ( + echo [INFO] No per-test FAILED entry with timing found. +) +echo. +echo === SEH/Access Violation Context === +set "firstSehLine=" +set "firstSehRunLine=" +for /F "tokens=1 delims=:" %%A in ('grep -a -n -i "unknown file: error: SEH exception\|0xc0000005\|access violation\|SEH exception" "%fullLog%" ^| head -1') do ( + set "firstSehLine=%%A" +) +echo !firstSehLine! | findstr /R "^[0-9][0-9]*$" > nul +if !errorlevel! equ 0 ( + for /F "tokens=1 delims=:" %%B in ('sed -n "1,!firstSehLine!p" "%fullLog%" ^| grep -a -n "\[ RUN" ^| tail -1') do ( + set "firstSehRunLine=%%B" + ) + echo !firstSehRunLine! | findstr /R "^[0-9][0-9]*$" > nul + if !errorlevel! equ 0 ( + sed -n "!firstSehRunLine!,$p" "%fullLog%" | head -160 + ) else ( + echo [WARN] Could not determine RUN line for SEH exception entry. + ) +) else ( + echo [INFO] No SEH/Access Violation entry found. +) +echo. +echo === Segfault/Crash Messages (if any) === +grep -a -i "segmentation fault\|segfault\|crashed\|abnormal termination\|access violation\|exception\|stack trace\|sigsegv" "%fullLog%" || echo (none found) +echo. +echo [ERROR] Check tests summary in '%summaryLog%' and tests logs in '%fullLog%'. Rerun failed test with: windows_setupvars.bat and %cd%\bazel-bin\src\ovms_test.exe --gtest_filter='*.*' +exit /b 1 diff --git a/windows_test.bat b/windows_test.bat index e0d2368a3a..24133fe096 100644 --- a/windows_test.bat +++ b/windows_test.bat @@ -125,61 +125,15 @@ C:\Windows\System32\tar.exe -a -c -f win_test_log.zip win_full_test.log ) if exist win_test_summary.tmp del /f /q win_test_summary.tmp -:: Check for FAILED markers first - do not allow PASSED text to mask test failures -grep -a -q "\[ FAILED \]\| FAILED " win_full_test.log -if !errorlevel! equ 0 goto :exit_build_error +:: Parse logs and decide final test status using dedicated parser script +call %cd%\windows_parse_tests.bat win_full_test.log win_test_summary.log +set "parseExitCode=!errorlevel!" +if !parseExitCode! neq 0 exit /b !parseExitCode! -:: Also check for segmentation faults or crashes -grep -a -q -i "segmentation fault\|segfault\|crashed\|abnormal termination\|access violation\|exception\|sigsegv" win_full_test.log -if !errorlevel! equ 0 goto :exit_build_error - -:: Consider the run successful only if PASSED summary is present near the end of the log -tail -50 win_full_test.log | grep -a -q "\[ PASSED \]" -if !errorlevel! equ 0 goto :exit_build - -:: If we reach here, tests did not complete correctly (no FAILED/crash marker but no final PASSED summary) -goto :exit_build_error - -:exit_build echo [INFO] Tests finished with no failures. Check the summary in win_test_summary.log. exit /b 0 + :exit_build_error -echo. -echo [ERROR] FAILED TESTS OR CRASHES DETECTED: -echo. -echo === Last Successful Test === -grep -a " OK ]" win_full_test.log | tail -1 -echo. -echo === Last Running Test (likely the one that failed) === -set "lastRunEntry=" -for /F "delims=" %%A in ('grep -a "\[ RUN" win_full_test.log ^| tail -1') do ( - set "lastRunEntry=%%A" -) -if defined lastRunEntry ( - echo !lastRunEntry! -) else ( - echo [WARN] No gtest RUN marker found in win_full_test.log. -) -echo. -echo === Output from Last Running Test to End of Log === -:: Find the line number of the last RUN and display everything from that point onwards -set "lastRunLine=" -for /F "tokens=1 delims=:" %%A in ('grep -a -n "\[ RUN" win_full_test.log ^| tail -1') do ( - set "lastRunLine=%%A" -) -echo !lastRunLine! | findstr /R "^[0-9][0-9]*$" > nul -if !errorlevel! equ 0 ( - sed -n "!lastRunLine!,$p" win_full_test.log | head -200 -) else ( - echo [WARN] Could not determine last RUN line. Showing recent RUN markers and log tail. - grep -a -n "\[ RUN" win_full_test.log | tail -20 - echo. - tail -200 win_full_test.log -) -echo. -echo === Segfault/Crash Messages (if any) === -grep -a -i "segmentation fault\|segfault\|crashed\|abnormal termination\|access violation\|exception\|stack trace\|sigsegv" win_full_test.log || echo (none found) -echo. -echo [ERROR] Check tests summary in 'win_test_summary.log' and tests logs in 'win_full_test.log'. Rerun failed test with: windows_setupvars.bat and %cd%\bazel-bin\src\ovms_test.exe --gtest_filter='*.*' +echo [ERROR] windows_test.bat failed before test parsing stage. exit /b 1 endlocal From 775daa699eec4450209b9e7cd839169771350d76 Mon Sep 17 00:00:00 2001 From: rasapala Date: Tue, 12 May 2026 15:27:11 +0200 Subject: [PATCH 11/20] Spellings --- spelling-whitelist.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spelling-whitelist.txt b/spelling-whitelist.txt index bd12dae11c..91d193653a 100644 --- a/spelling-whitelist.txt +++ b/spelling-whitelist.txt @@ -29,3 +29,7 @@ demos/vlm_npu/README.md:157: mane ==> main, many, maine demos/vlm_npu/README.md:218: mane ==> main, many, maine demos/integration_with_OpenWebUI/README.md:423: Buildin ==> Building, Build in src/test/llm/output_parsers/lfm2_output_parser_test.cpp +windows_parse_tests.bat:105: SEH ==> SHE +windows_parse_tests.bat:108: SEH ==> SHE +windows_parse_tests.bat:120: SEH ==> SHE +windows_parse_tests.bat:123: SEH ==> SHE From 3a944bcd370794c41937702e025d61a305a5a256 Mon Sep 17 00:00:00 2001 From: rasapala Date: Tue, 12 May 2026 16:57:13 +0200 Subject: [PATCH 12/20] Add to summary --- windows_parse_tests.bat | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/windows_parse_tests.bat b/windows_parse_tests.bat index 504b3993b1..9c0ffa440d 100644 --- a/windows_parse_tests.bat +++ b/windows_parse_tests.bat @@ -29,12 +29,17 @@ if not exist "%summaryLog%" ( echo [WARN] Summary log not found: %summaryLog% ) +set "parserOutputTmp=%summaryLog%.parse.tmp" +set "summaryBackupTmp=%summaryLog%.orig.tmp" + +set "CRASH_PATTERN=segmentation fault\|segfault\|abnormal termination\|access violation\|sigsegv\|seh exception\|0xc0000005\|unknown file: error:" + :: Check for FAILED markers first - do not allow PASSED text to mask test failures grep -a -q "\[ FAILED \]\| FAILED " "%fullLog%" if !errorlevel! equ 0 goto :exit_build_error :: Also check for segmentation faults or crashes -grep -a -q -i "segmentation fault\|segfault\|crashed\|abnormal termination\|access violation\|exception\|sigsegv" "%fullLog%" +grep -a -q -i "%CRASH_PATTERN%" "%fullLog%" if !errorlevel! equ 0 goto :exit_build_error :: Consider the run successful only if PASSED summary is present near the end of the log @@ -45,12 +50,15 @@ if !errorlevel! equ 0 exit /b 0 goto :exit_build_error :exit_build_error +if exist "%parserOutputTmp%" del /f /q "%parserOutputTmp%" +if exist "%summaryBackupTmp%" del /f /q "%summaryBackupTmp%" + +( echo. echo [ERROR] FAILED TESTS OR CRASHES DETECTED: echo. echo === Failed Tests (from summary/full log) === -grep -a "^\[ FAILED \]" "%summaryLog%" -grep -a "^\[ FAILED \]" "%fullLog%" +grep -a "^\[ FAILED \]" "%fullLog%" | grep -a -v "tests, listed below" echo. echo === Last Successful Test === grep -a " OK ]" "%fullLog%" | tail -1 @@ -73,12 +81,12 @@ for /F "tokens=1 delims=:" %%A in ('grep -a -n "\[ RUN" "%fullLog%" ^| tail -1') ) echo !lastRunLine! | findstr /R "^[0-9][0-9]*$" > nul if !errorlevel! equ 0 ( - sed -n "!lastRunLine!,$p" "%fullLog%" | head -200 + sed -n "!lastRunLine!,$p" "%fullLog%" | head -120 ) else ( echo [WARN] Could not determine last RUN line. Showing recent RUN markers and log tail. - grep -a -n "\[ RUN" "%fullLog%" | tail -20 + grep -a -n "\[ RUN" "%fullLog%" | tail -3 echo. - tail -200 "%fullLog%" + tail -20 "%fullLog%" ) echo. echo === Context Around First FAILED Test === @@ -124,7 +132,24 @@ if !errorlevel! equ 0 ( ) echo. echo === Segfault/Crash Messages (if any) === -grep -a -i "segmentation fault\|segfault\|crashed\|abnormal termination\|access violation\|exception\|stack trace\|sigsegv" "%fullLog%" || echo (none found) +grep -a -i "%CRASH_PATTERN%\|stack trace" "%fullLog%" || echo (none found) echo. echo [ERROR] Check tests summary in '%summaryLog%' and tests logs in '%fullLog%'. Rerun failed test with: windows_setupvars.bat and %cd%\bazel-bin\src\ovms_test.exe --gtest_filter='*.*' +) > "%parserOutputTmp%" 2>&1 + +if exist "%summaryLog%" ( + copy /Y "%summaryLog%" "%summaryBackupTmp%" > nul +) else ( + type nul > "%summaryBackupTmp%" +) + +( + type "%parserOutputTmp%" + echo. + type "%summaryBackupTmp%" +) > "%summaryLog%" + +if exist "%parserOutputTmp%" del /f /q "%parserOutputTmp%" +if exist "%summaryBackupTmp%" del /f /q "%summaryBackupTmp%" + exit /b 1 From 0177a7f6b064e9d394260bc6e2aa025840b3f4da Mon Sep 17 00:00:00 2001 From: rasapala Date: Wed, 13 May 2026 10:09:17 +0200 Subject: [PATCH 13/20] Fix spell --- spelling-whitelist.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spelling-whitelist.txt b/spelling-whitelist.txt index 91d193653a..470ffc83b4 100644 --- a/spelling-whitelist.txt +++ b/spelling-whitelist.txt @@ -29,7 +29,12 @@ demos/vlm_npu/README.md:157: mane ==> main, many, maine demos/vlm_npu/README.md:218: mane ==> main, many, maine demos/integration_with_OpenWebUI/README.md:423: Buildin ==> Building, Build in src/test/llm/output_parsers/lfm2_output_parser_test.cpp +windows_parse_tests.bat:35: seh ==> she windows_parse_tests.bat:105: SEH ==> SHE windows_parse_tests.bat:108: SEH ==> SHE +windows_parse_tests.bat:113: SEH ==> SHE +windows_parse_tests.bat:116: SEH ==> SHE windows_parse_tests.bat:120: SEH ==> SHE windows_parse_tests.bat:123: SEH ==> SHE +windows_parse_tests.bat:128: SEH ==> SHE +windows_parse_tests.bat:131: SEH ==> SHE From d275584e0d9a942977da69b3d3bf895ea85513e0 Mon Sep 17 00:00:00 2001 From: rasapala Date: Wed, 13 May 2026 11:23:02 +0200 Subject: [PATCH 14/20] Better seh reporting --- spelling-whitelist.txt | 11 ++++----- windows_parse_tests.bat | 49 ++++++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/spelling-whitelist.txt b/spelling-whitelist.txt index 470ffc83b4..0da66b536b 100644 --- a/spelling-whitelist.txt +++ b/spelling-whitelist.txt @@ -30,11 +30,8 @@ demos/vlm_npu/README.md:218: mane ==> main, many, maine demos/integration_with_OpenWebUI/README.md:423: Buildin ==> Building, Build in src/test/llm/output_parsers/lfm2_output_parser_test.cpp windows_parse_tests.bat:35: seh ==> she -windows_parse_tests.bat:105: SEH ==> SHE -windows_parse_tests.bat:108: SEH ==> SHE windows_parse_tests.bat:113: SEH ==> SHE -windows_parse_tests.bat:116: SEH ==> SHE -windows_parse_tests.bat:120: SEH ==> SHE -windows_parse_tests.bat:123: SEH ==> SHE -windows_parse_tests.bat:128: SEH ==> SHE -windows_parse_tests.bat:131: SEH ==> SHE +windows_parse_tests.bat:117: SEH ==> SHE +windows_parse_tests.bat:129: SEH ==> SHE +windows_parse_tests.bat:135: SEH ==> SHE +windows_parse_tests.bat:139: SEH ==> SHE diff --git a/windows_parse_tests.bat b/windows_parse_tests.bat index 9c0ffa440d..ee7096c14a 100644 --- a/windows_parse_tests.bat +++ b/windows_parse_tests.bat @@ -57,52 +57,52 @@ if exist "%summaryBackupTmp%" del /f /q "%summaryBackupTmp%" echo. echo [ERROR] FAILED TESTS OR CRASHES DETECTED: echo. -echo === Failed Tests (from summary/full log) === -grep -a "^\[ FAILED \]" "%fullLog%" | grep -a -v "tests, listed below" +echo === Failed Tests ^(from summary/full log^) === +grep -a "^\[ FAILED \]" "!fullLog!" | grep -a -v "tests, listed below" echo. echo === Last Successful Test === -grep -a " OK ]" "%fullLog%" | tail -1 +grep -a " OK ]" "!fullLog!" | tail -1 echo. -echo === Last Running Test (likely the one that failed) === +echo === Last Running Test ^(likely the one that failed^) === set "lastRunEntry=" -for /F "delims=" %%A in ('grep -a "\[ RUN" "%fullLog%" ^| tail -1') do ( +for /F "delims=" %%A in ('grep -a "\[ RUN" "!fullLog!" ^| tail -1') do ( set "lastRunEntry=%%A" ) if defined lastRunEntry ( echo !lastRunEntry! ) else ( - echo [WARN] No gtest RUN marker found in %fullLog%. + echo [WARN] No gtest RUN marker found in !fullLog!. ) echo. echo === Output from Last Running Test to End of Log === set "lastRunLine=" -for /F "tokens=1 delims=:" %%A in ('grep -a -n "\[ RUN" "%fullLog%" ^| tail -1') do ( +for /F "tokens=1 delims=:" %%A in ('grep -a -n "\[ RUN" "!fullLog!" ^| tail -1') do ( set "lastRunLine=%%A" ) echo !lastRunLine! | findstr /R "^[0-9][0-9]*$" > nul if !errorlevel! equ 0 ( - sed -n "!lastRunLine!,$p" "%fullLog%" | head -120 + sed -n "!lastRunLine!,$p" "!fullLog!" | head -120 ) else ( echo [WARN] Could not determine last RUN line. Showing recent RUN markers and log tail. - grep -a -n "\[ RUN" "%fullLog%" | tail -3 + grep -a -n "\[ RUN" "!fullLog!" | tail -3 echo. - tail -20 "%fullLog%" + tail -20 "!fullLog!" ) echo. echo === Context Around First FAILED Test === set "firstFailedLine=" set "firstFailedRunLine=" -for /F "tokens=1 delims=:" %%A in ('grep -a -n "^\[ FAILED \].*(" "%fullLog%" ^| head -1') do ( +for /F "tokens=1 delims=:" %%A in ('grep -a -n "^\[ FAILED \]" "!fullLog!" ^| grep -a -v "tests, listed below" ^| head -1') do ( set "firstFailedLine=%%A" ) echo !firstFailedLine! | findstr /R "^[0-9][0-9]*$" > nul if !errorlevel! equ 0 ( - for /F "tokens=1 delims=:" %%B in ('sed -n "1,!firstFailedLine!p" "%fullLog%" ^| grep -a -n "\[ RUN" ^| tail -1') do ( + for /F "tokens=1 delims=:" %%B in ('sed -n "1,!firstFailedLine!p" "!fullLog!" ^| grep -a -n "\[ RUN" ^| tail -1') do ( set "firstFailedRunLine=%%B" ) echo !firstFailedRunLine! | findstr /R "^[0-9][0-9]*$" > nul if !errorlevel! equ 0 ( - sed -n "!firstFailedRunLine!,$p" "%fullLog%" | head -160 + sed -n "!firstFailedRunLine!,$p" "!fullLog!" | head -160 ) else ( echo [WARN] Could not determine RUN line for first FAILED test. ) @@ -113,29 +113,38 @@ echo. echo === SEH/Access Violation Context === set "firstSehLine=" set "firstSehRunLine=" -for /F "tokens=1 delims=:" %%A in ('grep -a -n -i "unknown file: error: SEH exception\|0xc0000005\|access violation\|SEH exception" "%fullLog%" ^| head -1') do ( +set "firstSehRunEntry=" +for /F "tokens=1 delims=:" %%A in ('findstr /N /I /C:"SEH exception" /C:"0xc0000005" /C:"access violation" "!fullLog!" ^| head -1') do ( set "firstSehLine=%%A" ) echo !firstSehLine! | findstr /R "^[0-9][0-9]*$" > nul if !errorlevel! equ 0 ( - for /F "tokens=1 delims=:" %%B in ('sed -n "1,!firstSehLine!p" "%fullLog%" ^| grep -a -n "\[ RUN" ^| tail -1') do ( + for /F "tokens=1 delims=:" %%B in ('sed -n "1,!firstSehLine!p" "!fullLog!" ^| grep -a -n "\[ RUN" ^| tail -1') do ( set "firstSehRunLine=%%B" ) + for /F "delims=" %%C in ('sed -n "1,!firstSehLine!p" "!fullLog!" ^| grep -a "\[ RUN" ^| tail -1') do ( + set "firstSehRunEntry=%%C" + ) + if defined firstSehRunEntry ( + echo [INFO] Unit test at first SEH marker: !firstSehRunEntry! + ) echo !firstSehRunLine! | findstr /R "^[0-9][0-9]*$" > nul if !errorlevel! equ 0 ( - sed -n "!firstSehRunLine!,$p" "%fullLog%" | head -160 + sed -n "!firstSehRunLine!,$p" "!fullLog!" | head -160 ) else ( echo [WARN] Could not determine RUN line for SEH exception entry. + if defined lastRunEntry echo [INFO] Fallback unit test attribution: !lastRunEntry! ) ) else ( echo [INFO] No SEH/Access Violation entry found. + if defined lastRunEntry echo [INFO] Fallback unit test attribution: !lastRunEntry! ) echo. -echo === Segfault/Crash Messages (if any) === -grep -a -i "%CRASH_PATTERN%\|stack trace" "%fullLog%" || echo (none found) +echo === Segfault/Crash Messages ^(if any^) === +grep -a -i "%CRASH_PATTERN%\|stack trace" "!fullLog!" || echo ^(none found^) echo. -echo [ERROR] Check tests summary in '%summaryLog%' and tests logs in '%fullLog%'. Rerun failed test with: windows_setupvars.bat and %cd%\bazel-bin\src\ovms_test.exe --gtest_filter='*.*' -) > "%parserOutputTmp%" 2>&1 +echo [ERROR] Check tests summary in '!summaryLog!' and tests logs in '!fullLog!'. Rerun failed test with: windows_setupvars.bat and %cd%\bazel-bin\src\ovms_test.exe --gtest_filter='*.*' +) > "!parserOutputTmp!" 2>&1 if exist "%summaryLog%" ( copy /Y "%summaryLog%" "%summaryBackupTmp%" > nul From 59513053656934325ecb5ffdd310c8f745ad7dd4 Mon Sep 17 00:00:00 2001 From: rasapala Date: Wed, 13 May 2026 12:20:05 +0200 Subject: [PATCH 15/20] Fix this --- windows_parse_tests.bat | 49 ++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/windows_parse_tests.bat b/windows_parse_tests.bat index ee7096c14a..a01b353830 100644 --- a/windows_parse_tests.bat +++ b/windows_parse_tests.bat @@ -13,24 +13,24 @@ :: See the License for the specific language governing permissions and :: limitations under the License. :: -@echo off +@echo on setlocal EnableExtensions EnableDelayedExpansion set "fullLog=%~1" set "summaryLog=%~2" -if "%fullLog%"=="" set "fullLog=win_full_test.log" -if "%summaryLog%"=="" set "summaryLog=win_test_summary.log" +if not defined fullLog set "fullLog=win_full_test.log" +if not defined summaryLog set "summaryLog=win_test_summary.log" -if not exist "%fullLog%" ( - echo [ERROR] Full test log not found: %fullLog% +if not exist "!fullLog!" ( + echo [ERROR] Full test log not found: !fullLog! exit /b 1 ) -if not exist "%summaryLog%" ( - echo [WARN] Summary log not found: %summaryLog% +if not exist "!summaryLog!" ( + echo [WARN] Summary log not found: !summaryLog! ) -set "parserOutputTmp=%summaryLog%.parse.tmp" -set "summaryBackupTmp=%summaryLog%.orig.tmp" +set "parserOutputTmp=!summaryLog!.parse.tmp" +set "summaryBackupTmp=!summaryLog!.orig.tmp" set "CRASH_PATTERN=segmentation fault\|segfault\|abnormal termination\|access violation\|sigsegv\|seh exception\|0xc0000005\|unknown file: error:" @@ -79,8 +79,7 @@ set "lastRunLine=" for /F "tokens=1 delims=:" %%A in ('grep -a -n "\[ RUN" "!fullLog!" ^| tail -1') do ( set "lastRunLine=%%A" ) -echo !lastRunLine! | findstr /R "^[0-9][0-9]*$" > nul -if !errorlevel! equ 0 ( +if defined lastRunLine ( sed -n "!lastRunLine!,$p" "!fullLog!" | head -120 ) else ( echo [WARN] Could not determine last RUN line. Showing recent RUN markers and log tail. @@ -95,13 +94,11 @@ set "firstFailedRunLine=" for /F "tokens=1 delims=:" %%A in ('grep -a -n "^\[ FAILED \]" "!fullLog!" ^| grep -a -v "tests, listed below" ^| head -1') do ( set "firstFailedLine=%%A" ) -echo !firstFailedLine! | findstr /R "^[0-9][0-9]*$" > nul -if !errorlevel! equ 0 ( +if defined firstFailedLine ( for /F "tokens=1 delims=:" %%B in ('sed -n "1,!firstFailedLine!p" "!fullLog!" ^| grep -a -n "\[ RUN" ^| tail -1') do ( set "firstFailedRunLine=%%B" ) - echo !firstFailedRunLine! | findstr /R "^[0-9][0-9]*$" > nul - if !errorlevel! equ 0 ( + if defined firstFailedRunLine ( sed -n "!firstFailedRunLine!,$p" "!fullLog!" | head -160 ) else ( echo [WARN] Could not determine RUN line for first FAILED test. @@ -114,11 +111,10 @@ echo === SEH/Access Violation Context === set "firstSehLine=" set "firstSehRunLine=" set "firstSehRunEntry=" -for /F "tokens=1 delims=:" %%A in ('findstr /N /I /C:"SEH exception" /C:"0xc0000005" /C:"access violation" "!fullLog!" ^| head -1') do ( +for /F "tokens=1 delims=:" %%A in ('grep -a -n -i "unknown file: error: SEH exception\|0xc0000005\|access violation\|SEH exception" "!fullLog!" ^| head -1') do ( set "firstSehLine=%%A" ) -echo !firstSehLine! | findstr /R "^[0-9][0-9]*$" > nul -if !errorlevel! equ 0 ( +if defined firstSehLine ( for /F "tokens=1 delims=:" %%B in ('sed -n "1,!firstSehLine!p" "!fullLog!" ^| grep -a -n "\[ RUN" ^| tail -1') do ( set "firstSehRunLine=%%B" ) @@ -127,17 +123,16 @@ if !errorlevel! equ 0 ( ) if defined firstSehRunEntry ( echo [INFO] Unit test at first SEH marker: !firstSehRunEntry! + ) else ( + echo [WARN] Could not determine unit test name at first SEH marker. ) - echo !firstSehRunLine! | findstr /R "^[0-9][0-9]*$" > nul - if !errorlevel! equ 0 ( + if defined firstSehRunLine ( sed -n "!firstSehRunLine!,$p" "!fullLog!" | head -160 ) else ( echo [WARN] Could not determine RUN line for SEH exception entry. - if defined lastRunEntry echo [INFO] Fallback unit test attribution: !lastRunEntry! ) ) else ( echo [INFO] No SEH/Access Violation entry found. - if defined lastRunEntry echo [INFO] Fallback unit test attribution: !lastRunEntry! ) echo. echo === Segfault/Crash Messages ^(if any^) === @@ -146,10 +141,10 @@ echo. echo [ERROR] Check tests summary in '!summaryLog!' and tests logs in '!fullLog!'. Rerun failed test with: windows_setupvars.bat and %cd%\bazel-bin\src\ovms_test.exe --gtest_filter='*.*' ) > "!parserOutputTmp!" 2>&1 -if exist "%summaryLog%" ( - copy /Y "%summaryLog%" "%summaryBackupTmp%" > nul +if exist "!summaryLog!" ( + copy /Y "!summaryLog!" "!summaryBackupTmp!" > nul ) else ( - type nul > "%summaryBackupTmp%" + type nul > "!summaryBackupTmp!" ) ( @@ -158,7 +153,7 @@ if exist "%summaryLog%" ( type "%summaryBackupTmp%" ) > "%summaryLog%" -if exist "%parserOutputTmp%" del /f /q "%parserOutputTmp%" -if exist "%summaryBackupTmp%" del /f /q "%summaryBackupTmp%" +if exist "!parserOutputTmp!" del /f /q "!parserOutputTmp!" +if exist "!summaryBackupTmp!" del /f /q "!summaryBackupTmp!" exit /b 1 From 87a4b9926620040cf382959e7baad0813662a06b Mon Sep 17 00:00:00 2001 From: rasapala Date: Wed, 13 May 2026 13:18:36 +0200 Subject: [PATCH 16/20] Spell --- spelling-whitelist.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spelling-whitelist.txt b/spelling-whitelist.txt index 0da66b536b..2c322f499c 100644 --- a/spelling-whitelist.txt +++ b/spelling-whitelist.txt @@ -30,8 +30,9 @@ demos/vlm_npu/README.md:218: mane ==> main, many, maine demos/integration_with_OpenWebUI/README.md:423: Buildin ==> Building, Build in src/test/llm/output_parsers/lfm2_output_parser_test.cpp windows_parse_tests.bat:35: seh ==> she -windows_parse_tests.bat:113: SEH ==> SHE -windows_parse_tests.bat:117: SEH ==> SHE -windows_parse_tests.bat:129: SEH ==> SHE +windows_parse_tests.bat:110: SEH ==> SHE +windows_parse_tests.bat:114: SEH ==> SHE +windows_parse_tests.bat:125: SEH ==> SHE +windows_parse_tests.bat:127: SEH ==> SHE +windows_parse_tests.bat:132: SEH ==> SHE windows_parse_tests.bat:135: SEH ==> SHE -windows_parse_tests.bat:139: SEH ==> SHE From 21e55da138f54afb88de9fd4e71b1b6ab32931ca Mon Sep 17 00:00:00 2001 From: rasapala Date: Wed, 13 May 2026 14:36:42 +0200 Subject: [PATCH 17/20] Remove failures --- src/test/ovmsconfig_test.cpp | 2 +- src/test/schema_test.cpp | 2 +- windows_parse_tests.bat | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/ovmsconfig_test.cpp b/src/test/ovmsconfig_test.cpp index 4255476ebd..6b76d0e2fa 100644 --- a/src/test/ovmsconfig_test.cpp +++ b/src/test/ovmsconfig_test.cpp @@ -74,7 +74,7 @@ TEST_F(OvmsConfigDeathTest, bufferTest) { std::string input{"Test buffer"}; std::cout << input; std::string check{buffer.str()}; - EXPECT_EQ(input, "check"); + EXPECT_EQ(input, check); } TEST_F(OvmsConfigDeathTest, emptyInput) { diff --git a/src/test/schema_test.cpp b/src/test/schema_test.cpp index ba77d8f3c2..c97d6cfe2e 100644 --- a/src/test/schema_test.cpp +++ b/src/test/schema_test.cpp @@ -1155,7 +1155,7 @@ TEST(SchemaTest, ModelConfigPluginConfigPositive) { } ] })"; - *static_cast(nullptr) = 1; + rapidjson::Document modelConfigSeqNegativeDoc; modelConfigSeqNegativeDoc.Parse(modelConfigTimeoutNegative); auto result = ovms::validateJsonAgainstSchema(modelConfigSeqNegativeDoc, ovms::MODELS_CONFIG_SCHEMA.c_str()); diff --git a/windows_parse_tests.bat b/windows_parse_tests.bat index a01b353830..fe99a6e0cc 100644 --- a/windows_parse_tests.bat +++ b/windows_parse_tests.bat @@ -13,7 +13,7 @@ :: See the License for the specific language governing permissions and :: limitations under the License. :: -@echo on +@echo off setlocal EnableExtensions EnableDelayedExpansion set "fullLog=%~1" From c92914e3890f7b1c9cd4c34dc82c589528b60e04 Mon Sep 17 00:00:00 2001 From: Rafal Sapala Date: Wed, 13 May 2026 15:00:04 +0200 Subject: [PATCH 18/20] Update spelling-whitelist.txt --- spelling-whitelist.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/spelling-whitelist.txt b/spelling-whitelist.txt index 54d9be3521..0426db8fcb 100644 --- a/spelling-whitelist.txt +++ b/spelling-whitelist.txt @@ -29,7 +29,6 @@ demos/vlm_npu/README.md:157: mane ==> main, many, maine demos/vlm_npu/README.md:218: mane ==> main, many, maine demos/integration_with_OpenWebUI/README.md:423: Buildin ==> Building, Build in src/test/llm/output_parsers/lfm2_output_parser_test.cpp -<<<<<<< HEAD windows_parse_tests.bat:35: seh ==> she windows_parse_tests.bat:110: SEH ==> SHE windows_parse_tests.bat:114: SEH ==> SHE @@ -37,6 +36,4 @@ windows_parse_tests.bat:125: SEH ==> SHE windows_parse_tests.bat:127: SEH ==> SHE windows_parse_tests.bat:132: SEH ==> SHE windows_parse_tests.bat:135: SEH ==> SHE -======= src/test/llm/output_parsers/gemma4_output_parser_test.cpp ->>>>>>> main From f7b212b68a96c2545a0482d42a50494ba08836a9 Mon Sep 17 00:00:00 2001 From: rasapala Date: Wed, 13 May 2026 16:06:12 +0200 Subject: [PATCH 19/20] Fix detection --- windows_parse_tests.bat | 5 +++-- windows_test.bat | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/windows_parse_tests.bat b/windows_parse_tests.bat index fe99a6e0cc..3d2b84fb90 100644 --- a/windows_parse_tests.bat +++ b/windows_parse_tests.bat @@ -42,8 +42,9 @@ if !errorlevel! equ 0 goto :exit_build_error grep -a -q -i "%CRASH_PATTERN%" "%fullLog%" if !errorlevel! equ 0 goto :exit_build_error -:: Consider the run successful only if PASSED summary is present near the end of the log -tail -50 "%fullLog%" | grep -a -q "\[ PASSED \]" +:: Consider the run successful only if the global PASSED summary is present anywhere in the log +:: (it can appear hundreds of lines before EOF due to SKIPPED and debug trace lines following it) +grep -a -q "\[ PASSED \] [0-9]" "%fullLog%" if !errorlevel! equ 0 exit /b 0 :: If we reach here, tests did not complete correctly (no FAILED/crash marker but no final PASSED summary) diff --git a/windows_test.bat b/windows_test.bat index 24133fe096..dfc4c305d6 100644 --- a/windows_test.bat +++ b/windows_test.bat @@ -126,6 +126,12 @@ C:\Windows\System32\tar.exe -a -c -f win_test_log.zip win_full_test.log if exist win_test_summary.tmp del /f /q win_test_summary.tmp :: Parse logs and decide final test status using dedicated parser script +:: Skip expensive parsing if the global PASSED summary is already present in the log +grep -a -q "\[ PASSED \] " win_full_test.log +if !errorlevel! equ 0 ( + echo [INFO] Tests finished with no failures. Check the summary in win_test_summary.log. + exit /b 0 +) call %cd%\windows_parse_tests.bat win_full_test.log win_test_summary.log set "parseExitCode=!errorlevel!" if !parseExitCode! neq 0 exit /b !parseExitCode! From 3ad029fef5e0b4b2767b0d691cef9f0e9e40b7d4 Mon Sep 17 00:00:00 2001 From: rasapala Date: Wed, 13 May 2026 16:22:35 +0200 Subject: [PATCH 20/20] Spell --- spelling-whitelist.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spelling-whitelist.txt b/spelling-whitelist.txt index 0426db8fcb..47db3feb26 100644 --- a/spelling-whitelist.txt +++ b/spelling-whitelist.txt @@ -30,10 +30,10 @@ demos/vlm_npu/README.md:218: mane ==> main, many, maine demos/integration_with_OpenWebUI/README.md:423: Buildin ==> Building, Build in src/test/llm/output_parsers/lfm2_output_parser_test.cpp windows_parse_tests.bat:35: seh ==> she -windows_parse_tests.bat:110: SEH ==> SHE -windows_parse_tests.bat:114: SEH ==> SHE -windows_parse_tests.bat:125: SEH ==> SHE -windows_parse_tests.bat:127: SEH ==> SHE -windows_parse_tests.bat:132: SEH ==> SHE -windows_parse_tests.bat:135: SEH ==> SHE +windows_parse_tests.bat:111: SEH ==> SHE +windows_parse_tests.bat:115: SEH ==> SHE +windows_parse_tests.bat:126: SEH ==> SHE +windows_parse_tests.bat:128: SEH ==> SHE +windows_parse_tests.bat:133: SEH ==> SHE +windows_parse_tests.bat:136: SEH ==> SHE src/test/llm/output_parsers/gemma4_output_parser_test.cpp