1- parameters :
2- schema : ' MSAL Test Automation (iOS)'
3- full_path : ' build/Build/Products/MSAL Test Automation (iOS)_iphonesimulator18.1-x86_64.xctestrun'
4- destination : ' platform=iOS Simulator,name=iPhone 16,OS=18.1'
5- sdk : ' iphonesimulator'
6- retry_tests : true
7-
81steps :
92 - checkout : self
103 clean : true
@@ -56,29 +49,33 @@ steps:
5649 | tee xcodebuild.log \
5750 | xcpretty -c
5851
59- - task : Bash@3
60- displayName : Run automations
61- inputs :
62- targetType : ' inline'
63- script : |
64- ls build/Build/Products/
65- #Use retry-tests-on-failure only if tests don't already use "Maximum Test Repetitions"
66- if ['${{ parameters.retry_tests }}' == true]; then
67- xcodebuild test-without-building \
68- -xctestrun '${{ parameters.full_path }}' \
69- -destination '${{ parameters.destination }}' \
70- -retry-tests-on-failure \
71- -parallel-testing-enabled NO \
72- -resultBundlePath '$(Agent.BuildDirectory)/s/test_output/report.xcresult'
73-
74- else
75- xcodebuild test-without-building \
76- -xctestrun '${{ parameters.full_path }}' \
77- -destination '${{ parameters.destination }}' \
78- -parallel-testing-enabled NO \
79- -resultBundlePath '$(Agent.BuildDirectory)/s/test_output/report.xcresult'
80-
81- fi
52+ - ${{ if eq(parameters.retry_tests, 'true') }} :
53+ - task : Bash@3
54+ displayName : Run automations
55+ inputs :
56+ targetType : ' inline'
57+ script : |
58+ ls build/Build/Products/
59+ xcodebuild test-without-building \
60+ -xctestrun '${{ parameters.full_path }}' \
61+ -destination '${{ parameters.destination }}' \
62+ -retry-tests-on-failure \
63+ -test-iterations 3 \
64+ -parallel-testing-enabled NO \
65+ -quiet \
66+ -resultBundlePath '$(Agent.BuildDirectory)/s/test_output/report.xcresult'
67+ - ${{ if eq(parameters.retry_tests, 'false') }} :
68+ - task : Bash@3
69+ displayName : Run automations
70+ inputs :
71+ targetType : ' inline'
72+ script : |
73+ ls build/Build/Products/
74+ xcodebuild test-without-building \
75+ -xctestrun '${{ parameters.full_path }}' \
76+ -destination '${{ parameters.destination }}' \
77+ -parallel-testing-enabled NO \
78+ -resultBundlePath '$(Agent.BuildDirectory)/s/test_output/report.xcresult'
8279
8380 # https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/pipeline-artifacts?view=azure-devops&tabs=yaml#q-can-i-delete-pipeline-artifacts-when-re-running-failed-jobs
8481 - task : PublishPipelineArtifact@1
@@ -87,4 +84,11 @@ steps:
8784 targetPath : ' $(Agent.BuildDirectory)/s/test_output/'
8885 artifactName : ' TestOutputs Attempt - $(System.StageAttempt) - ${{ parameters.schema }}'
8986 publishLocation : ' pipeline'
87+ - task : PublishPipelineArtifact@1
88+ condition : failed()
89+ displayName : " Publish crash report if any"
90+ inputs :
91+ targetPath : " /Users/runner/Library/Logs/DiagnosticReports"
92+ artifactName : " crash folder"
93+ publishLocation : " pipeline"
9094
0 commit comments