From c1bac4ba435ce610eeb2c4232647dc9e013992be Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Wed, 22 Jan 2025 11:50:35 -0700 Subject: [PATCH 1/4] more logging in run tests --- eng/testing/runTests.cmd | 1 + eng/testing/runTests.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/eng/testing/runTests.cmd b/eng/testing/runTests.cmd index 818a6ff6e7..d261f6d28c 100644 --- a/eng/testing/runTests.cmd +++ b/eng/testing/runTests.cmd @@ -20,6 +20,7 @@ if exist testResults.xml ( ) popd echo ----- end %DATE% %TIME% ----- exit code %_exit_code% ---------------------------------------------------------- +echo ----- HAS_TEST_RESULTS %HAS_TEST_RESULTS% HELIX_WORKITEM_PAYLOAD %HELIX_WORKITEM_PAYLOAD% ---------------------------------------------------------- :: ========================= END Test Execution =============================== :: The tests either failed or crashed, copy output files diff --git a/eng/testing/runTests.sh b/eng/testing/runTests.sh index dcf3cdf9a9..07f7195d80 100644 --- a/eng/testing/runTests.sh +++ b/eng/testing/runTests.sh @@ -35,6 +35,7 @@ fi; popd echo ----- end $(date) ----- exit code $test_exitcode ---------------------------------------------------------- +echo ----- HAS_TEST_RESULTS $(has_test_results) HELIX_WORKITEM_PAYLOAD $(HELIX_WORKITEM_PAYLOAD) ---------------------------------------------------------- # ========================= END Test Execution =============================== From 1365acacbf0936bc014036be397ab0aa547755fc Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Tue, 1 Apr 2025 15:55:36 -0600 Subject: [PATCH 2/4] addition logging and forced failed test --- eng/testing/runTests.cmd | 6 ++++-- test/Microsoft.ML.TensorFlow.Tests/TensorflowTests.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/eng/testing/runTests.cmd b/eng/testing/runTests.cmd index d261f6d28c..998f15bd23 100644 --- a/eng/testing/runTests.cmd +++ b/eng/testing/runTests.cmd @@ -14,16 +14,17 @@ pushd %EXECUTION_DIR% @echo on ${runCommand} @set _exit_code=%ERRORLEVEL% -@echo off +@echo on if exist testResults.xml ( set HAS_TEST_RESULTS=1 ) popd echo ----- end %DATE% %TIME% ----- exit code %_exit_code% ---------------------------------------------------------- -echo ----- HAS_TEST_RESULTS %HAS_TEST_RESULTS% HELIX_WORKITEM_PAYLOAD %HELIX_WORKITEM_PAYLOAD% ---------------------------------------------------------- :: ========================= END Test Execution =============================== :: The tests either failed or crashed, copy output files +echo --- HELIX_WORKITEM_UPLOAD_ROOT %HELIX_WORKITEM_UPLOAD_ROOT% --------------------------------- +echo --- EXECUTION_DIR %EXECUTION_DIR% --------------------------------- if not %_exit_code%==0 ( if not "%HELIX_WORKITEM_UPLOAD_ROOT%" == "" ( powershell Compress-Archive %EXECUTION_DIR%\TestOutput %HELIX_WORKITEM_UPLOAD_ROOT%\TestOutput.zip @@ -32,6 +33,7 @@ if not %_exit_code%==0 ( :: The helix work item should not exit with non-zero if tests ran and produced results :: The xunit console runner returns 1 when tests fail +echo --- HAS_TEST_RESULTS %HAS_TEST_RESULTS% ----- HELIX_WORKITEM_PAYLOAD %HELIX_WORKITEM_PAYLOAD% --------------------------------- if %_exit_code%==1 ( if %HAS_TEST_RESULTS%==1 ( if not "%HELIX_WORKITEM_PAYLOAD%"=="" ( diff --git a/test/Microsoft.ML.TensorFlow.Tests/TensorflowTests.cs b/test/Microsoft.ML.TensorFlow.Tests/TensorflowTests.cs index 16bc4a6b74..86cc130c58 100644 --- a/test/Microsoft.ML.TensorFlow.Tests/TensorflowTests.cs +++ b/test/Microsoft.ML.TensorFlow.Tests/TensorflowTests.cs @@ -675,7 +675,7 @@ public void TensorFlowTransformMNISTConvTest() var metrics = _mlContext.MulticlassClassification.Evaluate(predicted); Assert.Equal(0.99, metrics.MicroAccuracy, .01); - Assert.Equal(0.99, metrics.MacroAccuracy, 0.01); + Assert.Equal(0.93, metrics.MacroAccuracy, 0.01); var oneSample = GetOneMNISTExample(); From f2b472afc7a97b66019849dfcf15de07f4427421 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Tue, 1 Apr 2025 16:48:35 -0600 Subject: [PATCH 3/4] updated runTests.cmd --- eng/testing/runTests.cmd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/testing/runTests.cmd b/eng/testing/runTests.cmd index 998f15bd23..85f13a50d6 100644 --- a/eng/testing/runTests.cmd +++ b/eng/testing/runTests.cmd @@ -27,7 +27,11 @@ echo --- HELIX_WORKITEM_UPLOAD_ROOT %HELIX_WORKITEM_UPLOAD_ROOT% --------------- echo --- EXECUTION_DIR %EXECUTION_DIR% --------------------------------- if not %_exit_code%==0 ( if not "%HELIX_WORKITEM_UPLOAD_ROOT%" == "" ( - powershell Compress-Archive %EXECUTION_DIR%\TestOutput %HELIX_WORKITEM_UPLOAD_ROOT%\TestOutput.zip + if exist "%EXECUTION_DIR%TestOutput\NUL" ( + powershell Compress-Archive "%EXECUTION_DIR%TestOutput" "%HELIX_WORKITEM_UPLOAD_ROOT%\TestOutput.zip" + ) else ( + echo No test output directory found to compress. + ) ) ) From 603649695c38b6576db2f5217f3c480fbe6f65a4 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Tue, 1 Apr 2025 16:49:02 -0600 Subject: [PATCH 4/4] updated runTests.cmd --- eng/testing/runTests.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/runTests.cmd b/eng/testing/runTests.cmd index 85f13a50d6..01a5706bbf 100644 --- a/eng/testing/runTests.cmd +++ b/eng/testing/runTests.cmd @@ -21,7 +21,7 @@ if exist testResults.xml ( popd echo ----- end %DATE% %TIME% ----- exit code %_exit_code% ---------------------------------------------------------- :: ========================= END Test Execution =============================== - +dir :: The tests either failed or crashed, copy output files echo --- HELIX_WORKITEM_UPLOAD_ROOT %HELIX_WORKITEM_UPLOAD_ROOT% --------------------------------- echo --- EXECUTION_DIR %EXECUTION_DIR% ---------------------------------