From 5e9b432f0e5fee48384b67abe7d848b0bd7def36 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Thu, 15 Feb 2024 09:42:16 -0600 Subject: [PATCH 1/2] Only run delete if folders exist --- eng/pipelines/common/device-tests-steps.yml | 4 ++-- eng/pipelines/common/ui-tests-compatibility-steps.yml | 4 ++-- eng/pipelines/common/ui-tests-steps.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/common/device-tests-steps.yml b/eng/pipelines/common/device-tests-steps.yml index a7ae64688e1b..2f612d5b22fd 100644 --- a/eng/pipelines/common/device-tests-steps.yml +++ b/eng/pipelines/common/device-tests-steps.yml @@ -81,8 +81,8 @@ steps: - ${{ if eq(parameters.platform, 'ios')}}: - bash: | - rm -r $HOME/Library/Logs/CoreSimulator/* - rm -r $HOME/Library/Logs/DiagnosticReports/* + if [ -d "$HOME/Library/Logs/CoreSimulator/" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -d "$HOME/Library/Logs/DiagnosticReports/" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi displayName: Delete Old Simulator Logs condition: always() continueOnError: true diff --git a/eng/pipelines/common/ui-tests-compatibility-steps.yml b/eng/pipelines/common/ui-tests-compatibility-steps.yml index ada65d4dc287..0a0a919b97f8 100644 --- a/eng/pipelines/common/ui-tests-compatibility-steps.yml +++ b/eng/pipelines/common/ui-tests-compatibility-steps.yml @@ -50,8 +50,8 @@ steps: displayName: 'Build the Legacy ControlGallery' - bash: | - rm -r $HOME/Library/Logs/CoreSimulator/* - rm -r $HOME/Library/Logs/DiagnosticReports/* + if [ -d "$HOME/Library/Logs/CoreSimulator/" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -d "$HOME/Library/Logs/DiagnosticReports/" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi displayName: Delete Old Simulator Logs condition: ${{ eq(parameters.platform, 'ios') }} continueOnError: true diff --git a/eng/pipelines/common/ui-tests-steps.yml b/eng/pipelines/common/ui-tests-steps.yml index ddbe2f6ead46..757f15f2dd99 100644 --- a/eng/pipelines/common/ui-tests-steps.yml +++ b/eng/pipelines/common/ui-tests-steps.yml @@ -107,8 +107,8 @@ steps: displayName: 'Build the samples' - bash: | - rm -r $HOME/Library/Logs/CoreSimulator/* - rm -r $HOME/Library/Logs/DiagnosticReports/* + if [ -d "$HOME/Library/Logs/CoreSimulator/" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -d "$HOME/Library/Logs/DiagnosticReports/" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi displayName: Delete Old Simulator Logs condition: ${{ eq(parameters.platform, 'ios') }} continueOnError: true From bdd82d6e4a81b87f330f983e40e474a8cc2c4d4a Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Thu, 15 Feb 2024 09:46:48 -0600 Subject: [PATCH 2/2] - fix --- eng/pipelines/common/device-tests-steps.yml | 4 ++-- eng/pipelines/common/ui-tests-compatibility-steps.yml | 4 ++-- eng/pipelines/common/ui-tests-steps.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/common/device-tests-steps.yml b/eng/pipelines/common/device-tests-steps.yml index 2f612d5b22fd..42de5562ab69 100644 --- a/eng/pipelines/common/device-tests-steps.yml +++ b/eng/pipelines/common/device-tests-steps.yml @@ -81,8 +81,8 @@ steps: - ${{ if eq(parameters.platform, 'ios')}}: - bash: | - if [ -d "$HOME/Library/Logs/CoreSimulator/" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi - if [ -d "$HOME/Library/Logs/DiagnosticReports/" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi + if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi displayName: Delete Old Simulator Logs condition: always() continueOnError: true diff --git a/eng/pipelines/common/ui-tests-compatibility-steps.yml b/eng/pipelines/common/ui-tests-compatibility-steps.yml index 0a0a919b97f8..7e8fbc347429 100644 --- a/eng/pipelines/common/ui-tests-compatibility-steps.yml +++ b/eng/pipelines/common/ui-tests-compatibility-steps.yml @@ -50,8 +50,8 @@ steps: displayName: 'Build the Legacy ControlGallery' - bash: | - if [ -d "$HOME/Library/Logs/CoreSimulator/" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi - if [ -d "$HOME/Library/Logs/DiagnosticReports/" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi + if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi displayName: Delete Old Simulator Logs condition: ${{ eq(parameters.platform, 'ios') }} continueOnError: true diff --git a/eng/pipelines/common/ui-tests-steps.yml b/eng/pipelines/common/ui-tests-steps.yml index 757f15f2dd99..2a2b9d7fc182 100644 --- a/eng/pipelines/common/ui-tests-steps.yml +++ b/eng/pipelines/common/ui-tests-steps.yml @@ -107,8 +107,8 @@ steps: displayName: 'Build the samples' - bash: | - if [ -d "$HOME/Library/Logs/CoreSimulator/" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi - if [ -d "$HOME/Library/Logs/DiagnosticReports/" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi + if [ -f "$HOME/Library/Logs/CoreSimulator/*" ]; then rm -r $HOME/Library/Logs/CoreSimulator/*; fi + if [ -f "$HOME/Library/Logs/DiagnosticReports/*" ]; then rm -r $HOME/Library/Logs/DiagnosticReports/*; fi displayName: Delete Old Simulator Logs condition: ${{ eq(parameters.platform, 'ios') }} continueOnError: true