diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1faea5b8ce..727028c5fe 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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' @@ -189,6 +157,7 @@ extends: mergeTestResults: true condition: succeededOrFailed() + - job: E2ETestAndroidA displayName: 'E2E Tests - Android - Plan A' pool: diff --git a/tools/yaml-templates/cdn-e2e-tests-job.yml b/tools/yaml-templates/cdn-e2e-tests-job.yml new file mode 100644 index 0000000000..854774160c --- /dev/null +++ b/tools/yaml-templates/cdn-e2e-tests-job.yml @@ -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()