From a75a3bf8d70078844661bd40b2515a2294072873 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 16 Jul 2024 11:39:06 -0400 Subject: [PATCH 01/25] check gcov --- .../android-x86_64-crosscompile-ci-pipeline.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 10d9a9a24d88a..fddbe40f7d761 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -108,7 +108,8 @@ stages: - stage: BUILD_AND_TEST_NNAPI_EP dependsOn: [] - condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') +# condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') + condition: never() variables: Codeql.ProjectConfigPath: .github/workflows Codeql.Enabled: true @@ -179,7 +180,7 @@ stages: # because coverage report is hard to support in cross machines. displayName: NNAPI MASTER BUILD&TEST dependsOn: [] - condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') +# condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') jobs: - job: NNAPI_EP_MASTER pool: onnxruntime-Ubuntu2204-AMD-CPU @@ -224,6 +225,13 @@ stages: --build_java \ --code_coverage displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator + - script: | + if command -v gcov >/dev/null 2>&1; then + echo "gcov is installed." + else + echo "gcov is not installed." && apt-get update && apt-get install -y gcovr + fi + displayName: Check if gcov is installed - script: | python3 -m pip install gcovr && \ From 9574da983fd88c9adc410cb5c614d185a216040d Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 16 Jul 2024 11:41:31 -0400 Subject: [PATCH 02/25] check gcov --- .../azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index fddbe40f7d761..4d0db2f2b840f 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -109,7 +109,7 @@ stages: - stage: BUILD_AND_TEST_NNAPI_EP dependsOn: [] # condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') - condition: never() + condition: not(always()) variables: Codeql.ProjectConfigPath: .github/workflows Codeql.Enabled: true From 60931994293f8b2007d3d9ce7f8227a1d05c4531 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 16 Jul 2024 11:47:12 -0400 Subject: [PATCH 03/25] check gcov --- .../azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 4d0db2f2b840f..8fd33c3266f15 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -187,7 +187,7 @@ stages: timeoutInMinutes: 180 workspace: clean: all - condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') + condition: always() steps: - task: UsePythonVersion@0 displayName: Use Python $(pythonVersion) From d56bfbc01334d6617ff19e27814d54cb819bddd4 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 16 Jul 2024 12:41:20 -0400 Subject: [PATCH 04/25] check python for coverage --- .../android-x86_64-crosscompile-ci-pipeline.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 8fd33c3266f15..867dc2a41832f 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -232,9 +232,16 @@ stages: echo "gcov is not installed." && apt-get update && apt-get install -y gcovr fi displayName: Check if gcov is installed - +# - displayName: Check if $(Build.SourcesDirectory)/build_nnapi/Debug/CMakeFiles/onnxruntime_test_all.dir/mnt/vss/_work/1/s/onnxruntime/test/framework/parallel_executor_test.cc.gcda exists +# script: | +# if [ -f Debug/CMakeFiles/onnxruntime_test_all.dir/mnt/vss/_work/1/s/onnxruntime/test/framework/parallel_executor_test.cc.gcda ]; then +# echo "Debug/CMakeFiles/onnxruntime_test_all.dir/mnt/vss/_work/1/s/onnxruntime/test/framework/parallel_executor_test.cc.gcda exists" +# else +# echo "Debug/CMakeFiles/onnxruntime_test_all.dir/mnt/vss/_work/1/s/onnxruntime/test/framework/parallel_executor_test.cc.gcda does not exist" +# exit 1 +# fi - script: | - python3 -m pip install gcovr && \ + set -e -x && \ python3 tools/ci_build/coverage.py \ --build_dir build_nnapi \ --android_sdk_path $ANDROID_HOME From a05dde0e4174a07c403ef96757db5c5d804464c9 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 16 Jul 2024 12:42:32 -0400 Subject: [PATCH 05/25] check python for coverage --- .../azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 867dc2a41832f..9275d1dc55ff5 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -242,6 +242,7 @@ stages: # fi - script: | set -e -x && \ + python3 -m pip install gcovr && \ python3 tools/ci_build/coverage.py \ --build_dir build_nnapi \ --android_sdk_path $ANDROID_HOME From 2cd5fc8484e4ac00c7236beae3725a805e5a3bc9 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 17 Jul 2024 11:35:35 -0400 Subject: [PATCH 06/25] adding verbose and debug the location of testcase_driver.cc.gcda --- tools/ci_build/coverage.py | 4 ++- .../github/android/run_nnapi_code_coverage.sh | 36 ------------------- 2 files changed, 3 insertions(+), 37 deletions(-) delete mode 100755 tools/ci_build/github/android/run_nnapi_code_coverage.sh diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index 48d919aa7358b..d30675b9ea206 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -52,11 +52,13 @@ def adb_shell(*args, **kwargs): adb_shell("cd /data/local/tmp && tar -zcf gcda_files.tar.gz *.dir") adb_pull("/data/local/tmp/gcda_files.tar.gz", cwd) os.chdir(cwd) - run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" ")) + run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" "),cwd=cwd) + run_subprocess(f"find {source_dir} -name testcase_driver.cc.gcda",cwd=cwd) cmd = ["gcovr", "-s", "-r"] cmd.append(os.path.join(source_dir, "onnxruntime")) cmd.extend([".", "-o"]) cmd.append(os.path.join(cwd, "coverage_rpt.txt")) + cmd.append("--verbose") run_subprocess(cmd, cwd=os.path.join(cwd, "CMakeFiles")) diff --git a/tools/ci_build/github/android/run_nnapi_code_coverage.sh b/tools/ci_build/github/android/run_nnapi_code_coverage.sh deleted file mode 100755 index 472e824eaa47a..0000000000000 --- a/tools/ci_build/github/android/run_nnapi_code_coverage.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# This script will run ORT build for Android with code coverage option - -set -e -set -x - -if [ $# -ne 1 ]; then - echo "One command line argument, the ROOT root directory, is expected" -fi - -ORT_ROOT=$1 -# Build and run onnxruntime using NNAPI execution provider targeting android emulator -python3 ${ORT_ROOT}/tools/ci_build/build.py \ - --android \ - --build_dir build_nnapi \ - --android_sdk_path $ANDROID_HOME \ - --android_ndk_path $ANDROID_NDK_HOME \ - --android_abi=x86_64 \ - --android_api=29 \ - --skip_submodule_sync \ - --parallel \ - --use_nnapi \ - --cmake_generator=Ninja \ - --build_java \ - --path_to_protoc_exe $ORT_ROOT/protobuf_install/bin/protoc \ - --code_coverage - -# Install gcovr -python3 -m pip install gcovr - -# Retrieve runtime code coverage files from the emulator and analyze -python3 ${ORT_ROOT}/tools/ci_build/coverage.py \ - --build_dir build_nnapi \ - --android_sdk_path $ANDROID_HOME - From e4a1036e2cff95a99e96dc929ff4edcd4824f42c Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 17 Jul 2024 13:02:45 -0400 Subject: [PATCH 07/25] adding verbose and debug the location of testcase_driver.cc.gcda --- tools/ci_build/coverage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index d30675b9ea206..4d1690839dc20 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -53,7 +53,7 @@ def adb_shell(*args, **kwargs): adb_pull("/data/local/tmp/gcda_files.tar.gz", cwd) os.chdir(cwd) run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" "),cwd=cwd) - run_subprocess(f"find {source_dir} -name testcase_driver.cc.gcda",cwd=cwd) + run_subprocess(f"find {source_dir} -name testcase_driver.cc.gcda".split(" "),cwd=cwd) cmd = ["gcovr", "-s", "-r"] cmd.append(os.path.join(source_dir, "onnxruntime")) cmd.extend([".", "-o"]) From 496175a6ed7ed7be5325dd7f8df9fdab25fc8293 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 17 Jul 2024 13:05:51 -0400 Subject: [PATCH 08/25] - script: | if command -v gcov >/dev/null 2>&1; then echo "gcov is installed." else echo "gcov is not installed." && apt-get update && apt-get install -y gcovr fi displayName: Check if gcov is installed --- .../android-x86_64-crosscompile-ci-pipeline.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 9275d1dc55ff5..c696e06b0d7a8 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -232,14 +232,15 @@ stages: echo "gcov is not installed." && apt-get update && apt-get install -y gcovr fi displayName: Check if gcov is installed -# - displayName: Check if $(Build.SourcesDirectory)/build_nnapi/Debug/CMakeFiles/onnxruntime_test_all.dir/mnt/vss/_work/1/s/onnxruntime/test/framework/parallel_executor_test.cc.gcda exists -# script: | -# if [ -f Debug/CMakeFiles/onnxruntime_test_all.dir/mnt/vss/_work/1/s/onnxruntime/test/framework/parallel_executor_test.cc.gcda ]; then -# echo "Debug/CMakeFiles/onnxruntime_test_all.dir/mnt/vss/_work/1/s/onnxruntime/test/framework/parallel_executor_test.cc.gcda exists" -# else -# echo "Debug/CMakeFiles/onnxruntime_test_all.dir/mnt/vss/_work/1/s/onnxruntime/test/framework/parallel_executor_test.cc.gcda does not exist" -# exit 1 -# fi + + - script: | + if command -v gcovr >/dev/null 2>&1; then + echo "gcov is installed." + else + echo "gcov is not installed." && apt-get update && apt-get install -y gcovr + fi + displayName: Check if gcovr is installed + - script: | set -e -x && \ python3 -m pip install gcovr && \ From 586a0041d0d7f9c342293408ba3400be0b2bf5de Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 17 Jul 2024 13:38:36 -0400 Subject: [PATCH 09/25] - script: | if command -v gcov >/dev/null 2>&1; then echo "gcov is installed." else echo "gcov is not installed." && apt-get update && apt-get install -y gcovr fi displayName: Check if gcov is installed --- .../android-x86_64-crosscompile-ci-pipeline.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index c696e06b0d7a8..fc073e8370d47 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -225,25 +225,26 @@ stages: --build_java \ --code_coverage displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator + - script: | - if command -v gcov >/dev/null 2>&1; then - echo "gcov is installed." + if command -v gcovr >/dev/null 2>&1; then + echo "gcovr is installed." else - echo "gcov is not installed." && apt-get update && apt-get install -y gcovr + echo "gcovr is not installed." && sudo apt-get update && sudo apt-get install -y gcovr fi - displayName: Check if gcov is installed + displayName: Check if gcovr is installed + continueOnError: true - script: | if command -v gcovr >/dev/null 2>&1; then - echo "gcov is installed." + echo "gcovr is installed." else - echo "gcov is not installed." && apt-get update && apt-get install -y gcovr + echo "gcovr is not installed." && python3 -m pip install gcovr fi displayName: Check if gcovr is installed - script: | set -e -x && \ - python3 -m pip install gcovr && \ python3 tools/ci_build/coverage.py \ --build_dir build_nnapi \ --android_sdk_path $ANDROID_HOME From 0dedf8f3d7ac75033e7d05240f71c8e80d84b56b Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 17 Jul 2024 13:40:22 -0400 Subject: [PATCH 10/25] Installing gcovr from apt-get --- .../android-x86_64-crosscompile-ci-pipeline.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index fc073e8370d47..4429f7d8383da 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -230,16 +230,19 @@ stages: if command -v gcovr >/dev/null 2>&1; then echo "gcovr is installed." else - echo "gcovr is not installed." && sudo apt-get update && sudo apt-get install -y gcovr + echo "gcovr is not installed. Installing gcovr from apt-get" && sudo apt-get update && sudo apt-get install -y gcovr fi - displayName: Check if gcovr is installed - continueOnError: true - - - script: | + + if command -v gcovr >/dev/null 2>&1; then + echo "gcovr is installed." + else + echo "gcovr is not installed. Installing gcovr from pip" && python3 -m pip install gcovr + fi + if command -v gcovr >/dev/null 2>&1; then echo "gcovr is installed." else - echo "gcovr is not installed." && python3 -m pip install gcovr + echo "Error: gcovr is still not installed." && exit 1 fi displayName: Check if gcovr is installed From 5c77a1af3e1707f2d8369633e03ca601a6b7d69e Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 17 Jul 2024 15:31:22 -0400 Subject: [PATCH 11/25] if command -v gcovr >/dev/null 2>&1; then echo "gcovr is installed." else echo "gcovr is not installed. Installing gcovr from pip" && python3 -m pip install gcovr fi --- .../android-x86_64-crosscompile-ci-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 4429f7d8383da..eb1634fd2352d 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -230,13 +230,13 @@ stages: if command -v gcovr >/dev/null 2>&1; then echo "gcovr is installed." else - echo "gcovr is not installed. Installing gcovr from apt-get" && sudo apt-get update && sudo apt-get install -y gcovr + echo "gcovr is not installed. Installing gcovr from pip" && python3 -m pip install gcovr fi if command -v gcovr >/dev/null 2>&1; then echo "gcovr is installed." else - echo "gcovr is not installed. Installing gcovr from pip" && python3 -m pip install gcovr + echo "gcovr is not installed. Installing gcovr from apt-get" && sudo apt-get update && sudo apt-get install -y gcovr fi if command -v gcovr >/dev/null 2>&1; then From 42c20a1bb4f3d8246364a222dbbb2e898e1d4c0d Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 17 Jul 2024 15:55:07 -0400 Subject: [PATCH 12/25] find coverage_rpt.txt --- tools/ci_build/coverage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index 4d1690839dc20..b02576e0cf9a7 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -54,11 +54,11 @@ def adb_shell(*args, **kwargs): os.chdir(cwd) run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" "),cwd=cwd) run_subprocess(f"find {source_dir} -name testcase_driver.cc.gcda".split(" "),cwd=cwd) + run_subprocess(f"find {source_dir} -name coverage_rpt.txt".split(" "),cwd=cwd) cmd = ["gcovr", "-s", "-r"] cmd.append(os.path.join(source_dir, "onnxruntime")) cmd.extend([".", "-o"]) cmd.append(os.path.join(cwd, "coverage_rpt.txt")) - cmd.append("--verbose") run_subprocess(cmd, cwd=os.path.join(cwd, "CMakeFiles")) From 6620a07c4a5f266416bfd0c89f1cd67206574402 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Wed, 17 Jul 2024 16:34:16 -0400 Subject: [PATCH 13/25] run_subprocess(f"ls -R {cwdCmakefiles}".split(" "),cwd=cwd) --- tools/ci_build/coverage.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index b02576e0cf9a7..dd897df3e4a47 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -59,7 +59,11 @@ def adb_shell(*args, **kwargs): cmd.append(os.path.join(source_dir, "onnxruntime")) cmd.extend([".", "-o"]) cmd.append(os.path.join(cwd, "coverage_rpt.txt")) - run_subprocess(cmd, cwd=os.path.join(cwd, "CMakeFiles")) + cwdCmakefiles=os.path.join(cwd, "CMakeFiles") + run_subprocess(f"ls -R {cwdCmakefiles}".split(" "),cwd=cwd) + run_subprocess(cmd, cwd=cwdCmakefiles) + run_subprocess(f"find {source_dir} -name coverage_rpt.txt".split(" "),cwd=cwd) + if __name__ == "__main__": From 32b440cf86e0b139cf824605107e16aa1a7cc6cb Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 18 Jul 2024 23:11:34 -0400 Subject: [PATCH 14/25] /mnt/vss/_work/5/s/build_nnapi/Debug/coverage_rpt.txt --- tools/ci_build/coverage.py | 8 ++---- ...ndroid-x86_64-crosscompile-ci-pipeline.yml | 28 +++---------------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index dd897df3e4a47..82249d8d401a1 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -53,15 +53,13 @@ def adb_shell(*args, **kwargs): adb_pull("/data/local/tmp/gcda_files.tar.gz", cwd) os.chdir(cwd) run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" "),cwd=cwd) - run_subprocess(f"find {source_dir} -name testcase_driver.cc.gcda".split(" "),cwd=cwd) - run_subprocess(f"find {source_dir} -name coverage_rpt.txt".split(" "),cwd=cwd) cmd = ["gcovr", "-s", "-r"] cmd.append(os.path.join(source_dir, "onnxruntime")) cmd.extend([".", "-o"]) cmd.append(os.path.join(cwd, "coverage_rpt.txt")) - cwdCmakefiles=os.path.join(cwd, "CMakeFiles") - run_subprocess(f"ls -R {cwdCmakefiles}".split(" "),cwd=cwd) - run_subprocess(cmd, cwd=cwdCmakefiles) + cwd_cmakefiles=os.path.join(cwd, "CMakeFiles") + run_subprocess(f"ls -R {cwd_cmakefiles}".split(" "),cwd=cwd) + run_subprocess(cmd, cwd=cwd_cmakefiles) run_subprocess(f"find {source_dir} -name coverage_rpt.txt".split(" "),cwd=cwd) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index eb1634fd2352d..2d55748813611 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -226,26 +226,6 @@ stages: --code_coverage displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator - - script: | - if command -v gcovr >/dev/null 2>&1; then - echo "gcovr is installed." - else - echo "gcovr is not installed. Installing gcovr from pip" && python3 -m pip install gcovr - fi - - if command -v gcovr >/dev/null 2>&1; then - echo "gcovr is installed." - else - echo "gcovr is not installed. Installing gcovr from apt-get" && sudo apt-get update && sudo apt-get install -y gcovr - fi - - if command -v gcovr >/dev/null 2>&1; then - echo "gcovr is installed." - else - echo "Error: gcovr is still not installed." && exit 1 - fi - displayName: Check if gcovr is installed - - script: | set -e -x && \ python3 tools/ci_build/coverage.py \ @@ -256,10 +236,6 @@ stages: - script: cat '$(Build.SourcesDirectory)/build_nnapi/Debug/coverage_rpt.txt' displayName: Print coverage report - - script: /bin/bash tools/ci_build/github/linux/ort_minimal/nnapi_minimal_build_minimal_ort_and_run_tests.sh $(pwd) - # Build Minimal ORT with NNAPI and reduced Ops, run unit tests on Android Emulator - displayName: Build Minimal ORT with NNAPI and run tests - - task: AzureCLI@2 displayName: 'Post Android Code Coverage To DashBoard' inputs: @@ -269,6 +245,10 @@ stages: arguments: '"$(Build.SourcesDirectory)/build_nnapi/Debug/coverage_rpt.txt" "https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=$(Build.BuildId)" arm android nnapi' workingDirectory: '$(Build.BinariesDirectory)' + - script: /bin/bash tools/ci_build/github/linux/ort_minimal/nnapi_minimal_build_minimal_ort_and_run_tests.sh $(pwd) + # Build Minimal ORT with NNAPI and reduced Ops, run unit tests on Android Emulator + displayName: Build Minimal ORT with NNAPI and run tests + - template: templates/use-android-emulator.yml parameters: stop: true From 35b175e2f4d3189baea8dc090f1fac435163cb09 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 18 Jul 2024 23:39:49 -0400 Subject: [PATCH 15/25] linintrunner --- tools/ci_build/coverage.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index 82249d8d401a1..55f53bdc24918 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -52,16 +52,15 @@ def adb_shell(*args, **kwargs): adb_shell("cd /data/local/tmp && tar -zcf gcda_files.tar.gz *.dir") adb_pull("/data/local/tmp/gcda_files.tar.gz", cwd) os.chdir(cwd) - run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" "),cwd=cwd) + run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" "), cwd=cwd) cmd = ["gcovr", "-s", "-r"] cmd.append(os.path.join(source_dir, "onnxruntime")) cmd.extend([".", "-o"]) cmd.append(os.path.join(cwd, "coverage_rpt.txt")) - cwd_cmakefiles=os.path.join(cwd, "CMakeFiles") - run_subprocess(f"ls -R {cwd_cmakefiles}".split(" "),cwd=cwd) + cwd_cmakefiles = os.path.join(cwd, "CMakeFiles") + run_subprocess(f"ls -R {cwd_cmakefiles}".split(" "), cwd=cwd) run_subprocess(cmd, cwd=cwd_cmakefiles) - run_subprocess(f"find {source_dir} -name coverage_rpt.txt".split(" "),cwd=cwd) - + run_subprocess(f"find {source_dir} -name coverage_rpt.txt".split(" "), cwd=cwd) if __name__ == "__main__": From cf262ce40557878f36e542f89c53997e43c28859 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 19 Jul 2024 12:11:55 -0400 Subject: [PATCH 16/25] python3 -m pip install gcovr --- tools/ci_build/coverage.py | 2 +- .../azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index 55f53bdc24918..27042ee590834 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -58,7 +58,7 @@ def adb_shell(*args, **kwargs): cmd.extend([".", "-o"]) cmd.append(os.path.join(cwd, "coverage_rpt.txt")) cwd_cmakefiles = os.path.join(cwd, "CMakeFiles") - run_subprocess(f"ls -R {cwd_cmakefiles}".split(" "), cwd=cwd) + # run_subprocess(f"ls -R {cwd_cmakefiles}".split(" "), cwd=cwd) run_subprocess(cmd, cwd=cwd_cmakefiles) run_subprocess(f"find {source_dir} -name coverage_rpt.txt".split(" "), cwd=cwd) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 2d55748813611..17b13f05ebb10 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -227,7 +227,7 @@ stages: displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator - script: | - set -e -x && \ + python3 -m pip install gcovr && \ python3 tools/ci_build/coverage.py \ --build_dir build_nnapi \ --android_sdk_path $ANDROID_HOME From c87c093cb88c5a977df684f809a6519813f4b82b Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 19 Jul 2024 15:51:54 -0400 Subject: [PATCH 17/25] --gcov-ignore-errors=no_working_dir_found --- tools/ci_build/coverage.py | 7 +++---- .../android-x86_64-crosscompile-ci-pipeline.yml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index 27042ee590834..78fab612b4299 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -52,14 +52,13 @@ def adb_shell(*args, **kwargs): adb_shell("cd /data/local/tmp && tar -zcf gcda_files.tar.gz *.dir") adb_pull("/data/local/tmp/gcda_files.tar.gz", cwd) os.chdir(cwd) - run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" "), cwd=cwd) + run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" ")) cmd = ["gcovr", "-s", "-r"] cmd.append(os.path.join(source_dir, "onnxruntime")) cmd.extend([".", "-o"]) cmd.append(os.path.join(cwd, "coverage_rpt.txt")) - cwd_cmakefiles = os.path.join(cwd, "CMakeFiles") - # run_subprocess(f"ls -R {cwd_cmakefiles}".split(" "), cwd=cwd) - run_subprocess(cmd, cwd=cwd_cmakefiles) + cmd.append("--gcov-ignore-errors=no_working_dir_found") + run_subprocess(cmd, cwd=os.path.join(cwd, "CMakeFiles")) run_subprocess(f"find {source_dir} -name coverage_rpt.txt".split(" "), cwd=cwd) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 17b13f05ebb10..c3b1482561a9c 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -227,7 +227,7 @@ stages: displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator - script: | - python3 -m pip install gcovr && \ +# python3 -m pip install gcovr && \ python3 tools/ci_build/coverage.py \ --build_dir build_nnapi \ --android_sdk_path $ANDROID_HOME From 78ee913a3b66cb0865cdbe5da2755380853dda14 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 22 Jul 2024 09:46:02 -0400 Subject: [PATCH 18/25] tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml --- .../azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index c3b1482561a9c..584829c75daa5 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -227,7 +227,6 @@ stages: displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator - script: | -# python3 -m pip install gcovr && \ python3 tools/ci_build/coverage.py \ --build_dir build_nnapi \ --android_sdk_path $ANDROID_HOME From 0312793853e1703c80bcdf077c6df5d9793c4c53 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 22 Jul 2024 10:30:25 -0400 Subject: [PATCH 19/25] Bring back the gcovr --- .../android-x86_64-crosscompile-ci-pipeline.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 584829c75daa5..10d9a9a24d88a 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -108,8 +108,7 @@ stages: - stage: BUILD_AND_TEST_NNAPI_EP dependsOn: [] -# condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') - condition: not(always()) + condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') variables: Codeql.ProjectConfigPath: .github/workflows Codeql.Enabled: true @@ -180,14 +179,14 @@ stages: # because coverage report is hard to support in cross machines. displayName: NNAPI MASTER BUILD&TEST dependsOn: [] -# condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') + condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') jobs: - job: NNAPI_EP_MASTER pool: onnxruntime-Ubuntu2204-AMD-CPU timeoutInMinutes: 180 workspace: clean: all - condition: always() + condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') steps: - task: UsePythonVersion@0 displayName: Use Python $(pythonVersion) @@ -227,6 +226,7 @@ stages: displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator - script: | + python3 -m pip install gcovr && \ python3 tools/ci_build/coverage.py \ --build_dir build_nnapi \ --android_sdk_path $ANDROID_HOME @@ -235,6 +235,10 @@ stages: - script: cat '$(Build.SourcesDirectory)/build_nnapi/Debug/coverage_rpt.txt' displayName: Print coverage report + - script: /bin/bash tools/ci_build/github/linux/ort_minimal/nnapi_minimal_build_minimal_ort_and_run_tests.sh $(pwd) + # Build Minimal ORT with NNAPI and reduced Ops, run unit tests on Android Emulator + displayName: Build Minimal ORT with NNAPI and run tests + - task: AzureCLI@2 displayName: 'Post Android Code Coverage To DashBoard' inputs: @@ -244,10 +248,6 @@ stages: arguments: '"$(Build.SourcesDirectory)/build_nnapi/Debug/coverage_rpt.txt" "https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=$(Build.BuildId)" arm android nnapi' workingDirectory: '$(Build.BinariesDirectory)' - - script: /bin/bash tools/ci_build/github/linux/ort_minimal/nnapi_minimal_build_minimal_ort_and_run_tests.sh $(pwd) - # Build Minimal ORT with NNAPI and reduced Ops, run unit tests on Android Emulator - displayName: Build Minimal ORT with NNAPI and run tests - - template: templates/use-android-emulator.yml parameters: stop: true From cbe95b1049cfdb432dff3e59b8f9ae158424420a Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 22 Jul 2024 12:42:26 -0400 Subject: [PATCH 20/25] Bring back the gcovr --- .../android-x86_64-crosscompile-ci-pipeline.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 10d9a9a24d88a..43de99f40dc70 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -108,7 +108,8 @@ stages: - stage: BUILD_AND_TEST_NNAPI_EP dependsOn: [] - condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') +# condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') + condition: never() variables: Codeql.ProjectConfigPath: .github/workflows Codeql.Enabled: true @@ -179,14 +180,14 @@ stages: # because coverage report is hard to support in cross machines. displayName: NNAPI MASTER BUILD&TEST dependsOn: [] - condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') +# condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') + condition: always() jobs: - job: NNAPI_EP_MASTER pool: onnxruntime-Ubuntu2204-AMD-CPU timeoutInMinutes: 180 workspace: clean: all - condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') steps: - task: UsePythonVersion@0 displayName: Use Python $(pythonVersion) @@ -239,15 +240,6 @@ stages: # Build Minimal ORT with NNAPI and reduced Ops, run unit tests on Android Emulator displayName: Build Minimal ORT with NNAPI and run tests - - task: AzureCLI@2 - displayName: 'Post Android Code Coverage To DashBoard' - inputs: - azureSubscription: AIInfraBuild - scriptType: bash - scriptPath: $(Build.SourcesDirectory)/tools/ci_build/github/linux/upload_code_coverage_data.sh - arguments: '"$(Build.SourcesDirectory)/build_nnapi/Debug/coverage_rpt.txt" "https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=$(Build.BuildId)" arm android nnapi' - workingDirectory: '$(Build.BinariesDirectory)' - - template: templates/use-android-emulator.yml parameters: stop: true From ca4090ec299961585d994803e4300da11ef3b1db Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 22 Jul 2024 13:39:37 -0400 Subject: [PATCH 21/25] condition: not(always()) --- .../azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 43de99f40dc70..2f277160822d1 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -109,7 +109,7 @@ stages: - stage: BUILD_AND_TEST_NNAPI_EP dependsOn: [] # condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') - condition: never() + condition: not(always()) variables: Codeql.ProjectConfigPath: .github/workflows Codeql.Enabled: true From 1a2923a779359e3d0605a6d220c2f7833356b9c1 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Thu, 25 Jul 2024 17:11:15 -0400 Subject: [PATCH 22/25] changing gcovr to gcov --- tools/ci_build/coverage.py | 2 +- .../azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index 78fab612b4299..6546fcb81810c 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -53,7 +53,7 @@ def adb_shell(*args, **kwargs): adb_pull("/data/local/tmp/gcda_files.tar.gz", cwd) os.chdir(cwd) run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" ")) - cmd = ["gcovr", "-s", "-r"] + cmd = ["gcov", "-s", "-r"] cmd.append(os.path.join(source_dir, "onnxruntime")) cmd.extend([".", "-o"]) cmd.append(os.path.join(cwd, "coverage_rpt.txt")) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index 2f277160822d1..c61d24b981c6f 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -227,7 +227,6 @@ stages: displayName: NNAPI EP, Build, Test, CodeCoverage on Android Emulator - script: | - python3 -m pip install gcovr && \ python3 tools/ci_build/coverage.py \ --build_dir build_nnapi \ --android_sdk_path $ANDROID_HOME From c5fb27e23ae0223580201904da02dba62f1cdb81 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 26 Jul 2024 11:19:01 -0400 Subject: [PATCH 23/25] # cmd.append("--gcov-ignore-errors=no_working_dir_found") --- tools/ci_build/coverage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index 6546fcb81810c..8a58cf2f096b4 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -57,7 +57,7 @@ def adb_shell(*args, **kwargs): cmd.append(os.path.join(source_dir, "onnxruntime")) cmd.extend([".", "-o"]) cmd.append(os.path.join(cwd, "coverage_rpt.txt")) - cmd.append("--gcov-ignore-errors=no_working_dir_found") + # cmd.append("--gcov-ignore-errors=no_working_dir_found") run_subprocess(cmd, cwd=os.path.join(cwd, "CMakeFiles")) run_subprocess(f"find {source_dir} -name coverage_rpt.txt".split(" "), cwd=cwd) From 355a67f147b0d83cc33fa5990703cbb85f31f4a6 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 26 Jul 2024 18:20:25 -0400 Subject: [PATCH 24/25] tools/ci_build/coverage.py --- tools/ci_build/coverage.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/ci_build/coverage.py b/tools/ci_build/coverage.py index 8a58cf2f096b4..48d919aa7358b 100644 --- a/tools/ci_build/coverage.py +++ b/tools/ci_build/coverage.py @@ -53,13 +53,11 @@ def adb_shell(*args, **kwargs): adb_pull("/data/local/tmp/gcda_files.tar.gz", cwd) os.chdir(cwd) run_subprocess("tar -zxf gcda_files.tar.gz -C CMakeFiles".split(" ")) - cmd = ["gcov", "-s", "-r"] + cmd = ["gcovr", "-s", "-r"] cmd.append(os.path.join(source_dir, "onnxruntime")) cmd.extend([".", "-o"]) cmd.append(os.path.join(cwd, "coverage_rpt.txt")) - # cmd.append("--gcov-ignore-errors=no_working_dir_found") run_subprocess(cmd, cwd=os.path.join(cwd, "CMakeFiles")) - run_subprocess(f"find {source_dir} -name coverage_rpt.txt".split(" "), cwd=cwd) if __name__ == "__main__": From bd36e06af2eed2128cc280ec9f96dc7114c8d489 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Sat, 27 Jul 2024 12:28:40 -0400 Subject: [PATCH 25/25] tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml --- .../android-x86_64-crosscompile-ci-pipeline.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml index dfda26b0baa2c..bcfe4cde9ce50 100644 --- a/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/android-x86_64-crosscompile-ci-pipeline.yml @@ -108,8 +108,7 @@ stages: - stage: BUILD_AND_TEST_NNAPI_EP dependsOn: [] -# condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') - condition: not(always()) + condition: notIn(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') variables: Codeql.ProjectConfigPath: .github/workflows Codeql.Enabled: true @@ -180,14 +179,14 @@ stages: # because coverage report is hard to support in cross machines. displayName: NNAPI MAIN BUILD&TEST dependsOn: [] -# condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') - condition: always() + condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') jobs: - job: NNAPI_EP_MASTER pool: onnxruntime-Ubuntu2204-AMD-CPU timeoutInMinutes: 180 workspace: clean: all + condition: in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI') steps: - task: UsePythonVersion@0 displayName: Use Python $(pythonVersion)