From 2ebc6badd701667ee8073fe88de1cd1c000d3f6a Mon Sep 17 00:00:00 2001 From: Nhu Dinh <150406148+nhudinh0309@users.noreply.github.com> Date: Mon, 3 Mar 2025 13:11:07 +0700 Subject: [PATCH] V15 QA Publish E2E test results in the Azure pipeline (#18498) * Updated playwright config to export the Junit report * Published the Junit report * Fixed * Updated outputDir * Make one test failed * Changed npm command * Fixed outputFile * Updated folder to export test result * Make another tests failed * Updated publish test results job * Changed testSQLite command * Updated testRunTitle * Changed npm command * Updated testRunTitle * Reverted * Fixed comment * Make some tests failed to test * Reverted --- build/azure-pipelines.yml | 26 +++++++++++++++++-- build/nightly-E2E-test-pipelines.yml | 20 ++++++++++++++ .../playwright.config.ts | 3 ++- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 966c4b982e..781e2e69fd 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -623,13 +623,24 @@ stages: displayName: Copy Playwright results condition: succeededOrFailed() - # Publish + # Publish test artifacts - task: PublishPipelineArtifact@1 displayName: Publish test artifacts condition: succeededOrFailed() inputs: targetPath: $(Build.ArtifactStagingDirectory) artifact: "Acceptance Test Results - $(Agent.JobName) - Attempt #$(System.JobAttempt)" + + # Publish test results + - task: PublishTestResults@2 + displayName: "Publish test results" + condition: succeededOrFailed() + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: '*.xml' + searchFolder: "tests/Umbraco.Tests.AcceptanceTest/results" + testRunTitle: "$(Agent.JobName)" + - job: displayName: E2E Tests (SQL Server) variables: @@ -788,13 +799,24 @@ stages: displayName: Copy Playwright results condition: succeededOrFailed() - # Publish + # Publish test artifacts - task: PublishPipelineArtifact@1 displayName: Publish test artifacts condition: succeededOrFailed() inputs: targetPath: $(Build.ArtifactStagingDirectory) artifact: "Acceptance Test Results - $(Agent.JobName) - Attempt #$(System.JobAttempt)" + + # Publish test results + - task: PublishTestResults@2 + displayName: "Publish test results" + condition: succeededOrFailed() + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: '*.xml' + searchFolder: "tests/Umbraco.Tests.AcceptanceTest/results" + testRunTitle: "$(Agent.JobName)" + ############################################### ## Release ############################################### diff --git a/build/nightly-E2E-test-pipelines.yml b/build/nightly-E2E-test-pipelines.yml index 9435aadfd8..8cbb065cd7 100644 --- a/build/nightly-E2E-test-pipelines.yml +++ b/build/nightly-E2E-test-pipelines.yml @@ -248,6 +248,16 @@ stages: targetPath: $(Build.ArtifactStagingDirectory) artifact: "Acceptance Test Results - $(Agent.JobName) - Attempt #$(System.JobAttempt)" + # Publish test results + - task: PublishTestResults@2 + displayName: "Publish test results" + condition: succeededOrFailed() + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: '*.xml' + searchFolder: "tests/Umbraco.Tests.AcceptanceTest/results" + testRunTitle: "$(Agent.JobName)" + - job: displayName: E2E Tests (SQL Server) timeoutInMinutes: 180 @@ -418,3 +428,13 @@ stages: inputs: targetPath: $(Build.ArtifactStagingDirectory) artifact: "Acceptance Test Results - $(Agent.JobName) - Attempt #$(System.JobAttempt)" + + # Publish test results + - task: PublishTestResults@2 + displayName: "Publish test results" + condition: succeededOrFailed() + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: '*.xml' + searchFolder: "tests/Umbraco.Tests.AcceptanceTest/results" + testRunTitle: "$(Agent.JobName)" diff --git a/tests/Umbraco.Tests.AcceptanceTest/playwright.config.ts b/tests/Umbraco.Tests.AcceptanceTest/playwright.config.ts index 00483cdc83..5a784172c2 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/playwright.config.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/playwright.config.ts @@ -23,7 +23,8 @@ export default defineConfig({ // We don't want to run parallel, as tests might differ in state workers: 1, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: process.env.CI ? 'line' : 'html', + //reporter: process.env.CI ? 'line' : 'html', + reporter: process.env.CI ? [['line'], ['junit', {outputFile: 'results/results.xml'}]] : 'html', outputDir: "./results", /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: {