diff --git a/.azure/pipelines/components-e2e-tests-internal.yml b/.azure/pipelines/components-e2e-tests-internal.yml new file mode 100644 index 000000000000..dadc4d2116e0 --- /dev/null +++ b/.azure/pipelines/components-e2e-tests-internal.yml @@ -0,0 +1,62 @@ +# +# See https://learn.microsoft.com/azure/devops/pipelines/yaml-schema for details on this file. +# + +# Configure which branches trigger builds +trigger: none + +pr: + autoCancel: true + branches: + include: + - '*' + paths: + include: + - eng/* + - src/Components/* + - src/Extensions/* + - src/Framework/* + - src/Hosting/* + - src/Http/* + - src/Middleware/HttpLogging/* + - src/Middleware/HttpOverrides/* + - src/Middleware/HttpsPolicy/* + - src/Middleware/Localization/* + - src/Middleware/Session/* + - src/Middleware/StaticFiles/* + - src/Middleware/WebSockets/* + - src/Servers/* + - src/SignalR/* + exclude: + - '**/*.md' + +variables: +- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE + value: true +- name: EXECUTE_COMPONENTS_E2E_TESTS + value: true +- name: _TeamName + value: AspNetCore +- template: /eng/common/templates-official/variables/pool-providers.yml@self + +resources: + repositories: + # Repo: 1ESPipelineTemplates/1ESPipelineTemplates + - repository: 1esPipelines + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +extends: + template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines + parameters: + sdl: + sourceAnalysisPool: + name: NetCore1ESPool-Svc-Internal + image: windows.vs2022.amd64 + os: windows + stages: + - stage: test + displayName: Test + jobs: + - template: .azure/pipelines/jobs/components-e2e-test-job.yml@self diff --git a/.azure/pipelines/components-e2e-tests.yml b/.azure/pipelines/components-e2e-tests.yml index 3443c8440217..2c4eafa1a348 100644 --- a/.azure/pipelines/components-e2e-tests.yml +++ b/.azure/pipelines/components-e2e-tests.yml @@ -28,58 +28,4 @@ variables: - template: /eng/common/templates/variables/pool-providers.yml jobs: -- template: jobs/default-build.yml - parameters: - jobName: Components_E2E_Test - jobDisplayName: "Test: Blazor E2E tests on Linux" - agentOs: Linux - isAzDOTestingJob: true - enablePublishTestResults: false - timeoutInMinutes: 120 - steps: - - script: git submodule update --init - displayName: Update submodules - - script: ./restore.sh - displayName: Run restore.sh - - script: yarn install --frozen-lockfile --cwd ./src/Components/test/E2ETest || yarn install --frozen-lockfile --cwd ./src/Components/test/E2ETest - displayName: NPM install - - script: .dotnet/dotnet build ./src/Components/test/E2ETest -c $(BuildConfiguration) --no-restore - displayName: Build - - script: .dotnet/dotnet test ./src/Components/test/E2ETest -c $(BuildConfiguration) --no-build --filter 'Quarantined!=true|Quarantined=false' - --logger:"trx%3BLogFileName=Microsoft.AspNetCore.Components.E2ETests.trx" - --logger:"html%3BLogFileName=Microsoft.AspNetCore.Components.E2ETests.html" - --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(BuildConfiguration)/Unquarantined - displayName: Run E2E tests - - script: .dotnet/dotnet test ./src/Components/test/E2ETest -c $(BuildConfiguration) --no-build --filter 'Quarantined=true' -p:RunQuarantinedTests=true - --logger:"trx%3BLogFileName=Microsoft.AspNetCore.Components.E2ETests.trx" - --logger:"html%3BLogFileName=Microsoft.AspNetCore.Components.E2ETests.html" - --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(BuildConfiguration)/Quarantined - displayName: Run Quarantined E2E tests - continueOnError: true - - task: PublishTestResults@2 - displayName: Publish E2E Test Results - inputs: - testResultsFormat: 'VSTest' - testResultsFiles: '*.trx' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(BuildConfiguration)/Unquarantined' - testRunTitle: ComponentsE2E-$(AgentOsName)-$(BuildConfiguration)-xunit - condition: always() - - task: PublishTestResults@2 - displayName: Publish Quarantined E2E Test Results - inputs: - testResultsFormat: 'VSTest' - testResultsFiles: '*.trx' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(BuildConfiguration)/Quarantined' - testRunTitle: Quarantine-$(AgentOsName)-$(BuildConfiguration)-xunit - mergeTestResults: true - condition: always() - - artifacts: - - name: Components_E2E_Logs - path: artifacts/log/ - publishOnError: true - includeForks: true - - name: Components_E2E_Test_Logs - path: '$(Build.SourcesDirectory)/artifacts/TestResults/$(BuildConfiguration)' - includeForks: true - publishOnError: true +- template: jobs/components-e2e-test-job.yml diff --git a/.azure/pipelines/jobs/components-e2e-test-job.yml b/.azure/pipelines/jobs/components-e2e-test-job.yml new file mode 100644 index 000000000000..4062b8f8d179 --- /dev/null +++ b/.azure/pipelines/jobs/components-e2e-test-job.yml @@ -0,0 +1,60 @@ +# components-e2e-test-job.yml +# Shared job definition for Components E2E tests. +# Used by both components-e2e-tests.yml and components-e2e-tests-internal.yml. + +jobs: +- template: default-build.yml + parameters: + jobName: Components_E2E_Test + jobDisplayName: "Test: Blazor E2E tests on Linux" + agentOs: Linux + isAzDOTestingJob: true + enablePublishTestResults: false + timeoutInMinutes: 120 + steps: + - script: git submodule update --init + displayName: Update submodules + - script: ./restore.sh + displayName: Run restore.sh + - script: yarn install --frozen-lockfile --cwd ./src/Components/test/E2ETest || yarn install --frozen-lockfile --cwd ./src/Components/test/E2ETest + displayName: NPM install + - script: .dotnet/dotnet build ./src/Components/test/E2ETest -c $(BuildConfiguration) --no-restore + displayName: Build + - script: .dotnet/dotnet test ./src/Components/test/E2ETest -c $(BuildConfiguration) --no-build --filter 'Quarantined!=true|Quarantined=false' + --logger:"trx%3BLogFileName=Microsoft.AspNetCore.Components.E2ETests.trx" + --logger:"html%3BLogFileName=Microsoft.AspNetCore.Components.E2ETests.html" + --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(BuildConfiguration)/Unquarantined + displayName: Run E2E tests + - script: .dotnet/dotnet test ./src/Components/test/E2ETest -c $(BuildConfiguration) --no-build --filter 'Quarantined=true' -p:RunQuarantinedTests=true + --logger:"trx%3BLogFileName=Microsoft.AspNetCore.Components.E2ETests.trx" + --logger:"html%3BLogFileName=Microsoft.AspNetCore.Components.E2ETests.html" + --results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(BuildConfiguration)/Quarantined + displayName: Run Quarantined E2E tests + continueOnError: true + - task: PublishTestResults@2 + displayName: Publish E2E Test Results + inputs: + testResultsFormat: 'VSTest' + testResultsFiles: '*.trx' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(BuildConfiguration)/Unquarantined' + testRunTitle: ComponentsE2E-$(AgentOsName)-$(BuildConfiguration)-xunit + condition: always() + - task: PublishTestResults@2 + displayName: Publish Quarantined E2E Test Results + inputs: + testResultsFormat: 'VSTest' + testResultsFiles: '*.trx' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(BuildConfiguration)/Quarantined' + testRunTitle: Quarantine-$(AgentOsName)-$(BuildConfiguration)-xunit + mergeTestResults: true + condition: always() + + artifacts: + - name: Components_E2E_Logs + path: artifacts/log/ + publishOnError: true + includeForks: true + - name: Components_E2E_Test_Logs + path: '$(Build.SourcesDirectory)/artifacts/TestResults/$(BuildConfiguration)' + includeForks: true + publishOnError: true