Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 8 additions & 39 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,45 +118,13 @@ extends:
AppHostingSdk: AppHostingSdk
versionBranch: 'Latest'

- job: E2ETestCDN
timeoutInMinutes: 120
displayName: 'E2E Tests - CDN (only runs on release builds)'
# This test only runs after deployment from a release branch and the new CDN version has been deployed
# This check will run on the PR to merge the release branch back into main
condition: and(
eq(variables['Build.Reason'], 'PullRequest'),
startsWith(variables['System.PullRequest.SourceBranch'], 'release/'),
eq(variables['System.PullRequest.TargetBranch'], 'main')
)
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: 'ubuntu-latest'
os: linux
steps:
- template: tools/yaml-templates/build-app-host.yml@self
parameters:
appHostGitPath: AppHostingSdk

- task: CmdLine@2
displayName: 'Build Test App CDN'
inputs:
script: |
pnpm build-test-app-CDN
workingDirectory: '$(ClientSdkProjectDirectory)'

- bash: 'pnpm exec ts-node tools/cli/runAppsWithE2ETests.ts --useDataFromLocal=true --reportFileName=e2e-tests-report-cdn-script-tag --envType=cdnScriptTag'
displayName: 'Run E2E integration tests with local script tag on latest cdn bundles'
condition: succeeded()
workingDirectory: '$(AppHostingSdkProjectDirectory)'
enabled: true

- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/e2e-tests-report*.xml'
testRunTitle: 'E2E Tests - CDN'
mergeTestResults: true
condition: succeededOrFailed()
# CDN E2E tests split by test name prefix pattern to avoid timeout
# This test only runs after deployment from a release branch and the new CDN version has been deployed
# This check will run on the PR to merge the release branch back into main
- template: tools/yaml-templates/cdn-e2e-tests-job.yml@self
parameters:
testPrefixPatternGroups:
['app(?=\.)','{appE,appI,appS,auth}']

- stage: Perf_and_Android_E2E
displayName: 'Perf & Android E2E Tests'
Expand Down Expand Up @@ -189,6 +157,7 @@ extends:
mergeTestResults: true
condition: succeededOrFailed()


- job: E2ETestAndroidA
displayName: 'E2E Tests - Android - Plan A'
pool:
Expand Down
70 changes: 70 additions & 0 deletions tools/yaml-templates/cdn-e2e-tests-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This template handles running CDN E2E tests split by test name prefix pattern.
# It will run one E2E job for each testPrefixPattern in the testPrefixPatternGroups parameter.

parameters:
- name: testPrefixPatternGroups
type: object
default: ['{[A-Z],[a-z],[0-9]}']

jobs:
- ${{each testPrefixPattern in parameters.testPrefixPatternGroups}}:
- job: E2ETestsCDN_${{ replace(
replace(
replace(
replace(
replace(
replace(
replace(
replace(
replace(
replace(
replace(replace(replace(testPrefixPattern, '[', 'LB'),']', 'RB'),'{', 'LC'),'}', 'RC'),',', 'COMMA'),'-', 'DASH'),
'*', 'STAR'),
'?', 'QMARK'),
'\', 'BS'),
'.', 'DOT'),
'(', 'LP'),
')', 'RP'),
'=', 'EQUALS') }}

timeoutInMinutes: 120
displayName: 'E2E Tests - CDN - ${{testPrefixPattern}} (only runs on release builds)'
condition: and(
eq(variables['Build.Reason'], 'PullRequest'),
startsWith(variables['System.PullRequest.SourceBranch'], 'release/'),
eq(variables['System.PullRequest.TargetBranch'], 'main')
)
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: 'ubuntu-latest'
os: linux
steps:
- template: build-app-host.yml
parameters:
appHostGitPath: AppHostingSdk

- task: CmdLine@2
displayName: 'Build Test App CDN'
inputs:
script: |
pnpm build-test-app-CDN
workingDirectory: '$(ClientSdkProjectDirectory)'

- bash: >
pnpm exec ts-node tools/cli/runAppsWithE2ETests.ts
--useDataFromLocal=true
--testPrefixPattern "${{testPrefixPattern}}"
--reportFileName=e2e-tests-report-cdn-script-tag
--envType=cdnScriptTag
displayName: 'Run E2E CDN tests (${{testPrefixPattern}})'
condition: succeeded()
workingDirectory: '$(AppHostingSdkProjectDirectory)'
enabled: true

- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/e2e-tests-report*.xml'
testRunTitle: 'E2E Tests - CDN - ${{testPrefixPattern}}'
mergeTestResults: true
condition: succeededOrFailed()
Loading