|
84 | 84 | failTaskOnFailedTests: true
|
85 | 85 | testRunTitle: 'Test Run - $(target)'
|
86 | 86 |
|
| 87 | +- job: fetch_pr_labels |
| 88 | + displayName: 'Check for PR Label' |
| 89 | + timeoutInMinutes: 5 |
| 90 | + pool: |
| 91 | + vmImage: 'macOS-14' |
| 92 | + steps: |
| 93 | + - script: | |
| 94 | + url="https://api.github.com/repos/$BUILD_REPOSITORY_ID/issues/$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER/labels" |
| 95 | +
|
| 96 | + echo "Fetching labels from $url " |
| 97 | +
|
| 98 | + # Temporary file to store the raw response |
| 99 | + temp_file=$(mktemp) |
| 100 | +
|
| 101 | + # Store the response code and the raw response in separate variables |
| 102 | + response_code=$(curl -s -w "%{http_code}" -o "$temp_file" "$url") |
| 103 | + response_content=$(cat "$temp_file") |
| 104 | +
|
| 105 | + echo "Response code: $response_code" |
| 106 | + echo "Raw response: $response_content" |
| 107 | +
|
| 108 | + if [[ "$response_code" -eq 200 ]]; then |
| 109 | + label_names=$(echo $response_content | jq -r '.[].name' | paste -sd ', ' -) |
| 110 | + echo "##vso[task.setvariable variable=PR_LABELS;isOutput=true]$label_names" |
| 111 | + [ -z "$label_names" ] && echo "PR labels: <empty>" || echo "PR labels: $label_names" |
| 112 | + else |
| 113 | + echo "Request failed with status code: $response_code - Skipping Native Auth E2E tests as a preventive measure" |
| 114 | + echo "##vso[task.setvariable variable=PR_LABELS;isOutput=true]'skip-native-auth-e2e-tests'" |
| 115 | + fi |
| 116 | +
|
| 117 | + name: fetchPrLabels |
| 118 | +
|
| 119 | +- job: e2e_test_native_auth |
| 120 | + displayName: 'Run MSAL E2E tests for native auth' |
| 121 | + dependsOn: fetch_pr_labels |
| 122 | + condition: and( succeeded(), not(contains(dependencies.fetch_pr_labels.outputs['fetchPrLabels.PR_LABELS'], 'skip-native-auth-e2e-tests')) ) |
| 123 | + timeoutInMinutes: 30 |
| 124 | + cancelTimeoutInMinutes: 5 |
| 125 | + pool: |
| 126 | + vmImage: 'macOS-14' |
| 127 | + workspace: |
| 128 | + clean: all |
| 129 | + |
| 130 | + steps: |
| 131 | + - template: templates/tests-with-conf-file.yml |
| 132 | + parameters: |
| 133 | + schema: 'MSAL iOS Native Auth E2E Tests' |
| 134 | + build: 'MSAL iOS Native Auth E2E Tests_MSAL iOS Native Auth E2E Tests' |
| 135 | + |
87 | 136 | - job: 'Validate_SPM_Integration'
|
88 | 137 | displayName: Validate SPM Integration
|
89 | 138 | pool:
|
|
0 commit comments