mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Do not allow clearing Android logs if the emulator is not running (#21578)
### Description Do not allow clearing Android logs if the emulator is not running ### Motivation and Context Previously the Clearing Android logs step stuck until the pipeline timeout. If one of the previous steps failed.
This commit is contained in:
parent
ff3e8b02c3
commit
6c1a3f85a6
1 changed files with 13 additions and 2 deletions
|
|
@ -5,12 +5,23 @@ parameters:
|
||||||
type: stepList
|
type: stepList
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- task: CmdLine@2
|
||||||
|
input:
|
||||||
|
script: |
|
||||||
|
if [ -f $(Build.BinariesDirectory)/emulator.pid ]; then
|
||||||
|
echo "Emulator is running."
|
||||||
|
echo "##vso[task.setvariable variable=isEmulatorRunning]True"
|
||||||
|
else
|
||||||
|
echo "Emulator is not running."
|
||||||
|
fi
|
||||||
|
name: Determine if emulator is running
|
||||||
|
|
||||||
- task: CmdLine@2
|
- task: CmdLine@2
|
||||||
inputs:
|
inputs:
|
||||||
script: |
|
script: |
|
||||||
python3 tools/python/run_adb.py logcat --clear
|
python3 tools/python/run_adb.py logcat --clear
|
||||||
displayName: "Clear Android logs"
|
displayName: "Clear Android logs"
|
||||||
condition: succeededOrFailed()
|
condition: eq(variables['isEmulatorRunning'], 'True')
|
||||||
|
|
||||||
- ${{ parameters.steps }}
|
- ${{ parameters.steps }}
|
||||||
|
|
||||||
|
|
@ -19,4 +30,4 @@ steps:
|
||||||
script: |
|
script: |
|
||||||
python3 tools/python/run_adb.py logcat -d
|
python3 tools/python/run_adb.py logcat -d
|
||||||
displayName: "Dump Android logs"
|
displayName: "Dump Android logs"
|
||||||
condition: succeededOrFailed()
|
condition: eq(variables['isEmulatorRunning'], 'True')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue