From 6d43d51eb045a89ed8fe0322578b16d7015368c5 Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Wed, 17 May 2023 23:31:16 +0800 Subject: [PATCH] [Fix] No test result report while not using ctest (#15976) ### Description 1. Set gtest output while ctest is set to empty. 2. onnx_src in _deps shouldn't be removed because onnx_test_pytorch_converted and onnx_test_pytorch_converted need to read data from onnx/backend/test/data/.. ### Motivation and Context Test result report is important to find the flaky tests. ### To do Tests are not inconsistent. If ctest_path is empty, onnx_test_pytorch_converted and onnx_test_pytorch_converted will not be executed, if it's not, onnxruntime_mlas_test will not be executed. https://github.com/microsoft/onnxruntime/blob/270c09a37f36e13ee986144b2385199d23e030a0/tools/ci_build/build.py#L1743-L1753 --- tools/ci_build/build.py | 4 ++-- .../ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 3ad5df6aec..acebad09d0 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1748,8 +1748,8 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs): executables.append("onnxruntime_api_tests_without_env") executables.append("onnxruntime_customopregistration_test") for exe in executables: - run_subprocess([os.path.join(cwd, exe)], cwd=cwd, dll_path=dll_path) - + test_output = f"--gtest_output=xml:{cwd}/{exe}.{config}.results.xml" + run_subprocess([os.path.join(cwd, exe), test_output], cwd=cwd, dll_path=dll_path) else: ctest_cmd = [ctest_path, "--build-config", config, "--verbose", "--timeout", args.test_all_timeout] run_subprocess(ctest_cmd, cwd=cwd, dll_path=dll_path) diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml index 0819ce04ea..1052f3ee85 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml @@ -88,9 +88,9 @@ jobs: - task: CmdLine@2 inputs: script: | - rm -rf $(Build.BinariesDirectory)/Release/onnxruntime $(Build.BinariesDirectory)/Release/pybind11 $(Build.BinariesDirectory)/Release/_deps + rm -rf $(Build.BinariesDirectory)/Release/onnxruntime $(Build.BinariesDirectory)/Release/pybind11 rm -f $(Build.BinariesDirectory)/Release/models - rm -rf $(Build.BinariesDirectory)/Release/_deps + find $(Build.BinariesDirectory)/Release/_deps -mindepth 1 ! -regex '^$(Build.BinariesDirectory)/Release/_deps/onnx-src\(/.*\)?' -delete cd $(Build.BinariesDirectory)/Release find -executable -type f > $(Build.BinariesDirectory)/Release/perms.txt