From e4dacf5c8c1771360d7e2a2919727102308ac3bb Mon Sep 17 00:00:00 2001 From: Andreas Zerbst <73799582+andr317c@users.noreply.github.com> Date: Wed, 25 Sep 2024 07:04:12 +0200 Subject: [PATCH] V14 QA fixed E2E tests for SQL server (#17122) * Updated version of test helpers * Added option to run smoke tests * Found the issue * Fixed pipeline * Removed duplicate file creation * Removed * Always run sql server tests * Removed unused parameter * Enables sqlServer E2E to run on pipeline * Removed comment --- build/azure-pipelines.yml | 11 ++----- build/nightly-E2E-test-pipelines.yml | 30 +++++++++++-------- build/nightly-build-trigger.yml | 2 +- .../package-lock.json | 18 +++++------ .../Umbraco.Tests.AcceptanceTest/package.json | 4 +-- 5 files changed, 33 insertions(+), 32 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index dc5ef96bde..9e7207bf07 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -5,10 +5,6 @@ parameters: displayName: Run SQL Server Integration Tests type: boolean default: false - - name: sqlServerAcceptanceTests - displayName: Run SQL Server Acceptance Tests - type: boolean - default: false - name: myGetDeploy displayName: Deploy to MyGet type: boolean @@ -553,8 +549,6 @@ stages: - job: displayName: E2E Tests (SQL Server) - # condition: or(eq(stageDependencies.Build.A.outputs['build.NBGV_PublicRelease'], 'True'), ${{parameters.sqlServerAcceptanceTests}}) # Outcommented due to timeouts - condition: eq(${{parameters.sqlServerAcceptanceTests}}, True) variables: # Connection string CONNECTIONSTRINGS__UMBRACODBDSN: Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True @@ -590,7 +584,8 @@ stages: - pwsh: | "UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL) UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD) - URL=$(ASPNETCORE_URLS)" | Out-File .env + URL=$(ASPNETCORE_URLS) + STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env displayName: Generate .env workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest @@ -708,7 +703,7 @@ stages: dependsOn: - Unit - Integration -# - E2E + # - E2E condition: and(succeeded(), or(eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True'), ${{parameters.myGetDeploy}})) jobs: - job: diff --git a/build/nightly-E2E-test-pipelines.yml b/build/nightly-E2E-test-pipelines.yml index ce67b778e3..6a069ef38c 100644 --- a/build/nightly-E2E-test-pipelines.yml +++ b/build/nightly-E2E-test-pipelines.yml @@ -4,12 +4,12 @@ pr: none trigger: none schedules: -- cron: '0 0 * * *' - displayName: Daily midnight build - branches: - include: - - v14/dev - - v15/dev + - cron: '0 0 * * *' + displayName: Daily midnight build + branches: + include: + - v14/dev + - v15/dev variables: nodeVersion: 20 @@ -24,8 +24,8 @@ variables: NODE_OPTIONS: --max_old_space_size=16384 parameters: - - name: runSqlServerE2ETests - displayName: Run the SQL Server E2E Tests + - name: runSmokeTests + displayName: Run the smoke tests type: boolean default: false @@ -206,7 +206,10 @@ stages: workingDirectory: tests/Umbraco.Tests.AcceptanceTest # Test - - pwsh: npm run test --ignore-certificate-errors + - ${{ if eq(parameters.runSmokeTests, true) }}: + pwsh: npm run smokeTest --ignore-certificate-errors + ${{ else }}: + pwsh: npm run test --ignore-certificate-errors displayName: Run Playwright tests continueOnError: true workingDirectory: tests/Umbraco.Tests.AcceptanceTest @@ -242,7 +245,6 @@ stages: - job: displayName: E2E Tests (SQL Server) - condition: and(succeeded(), ${{ eq(parameters.runSqlServerE2ETests, true) }}) timeoutInMinutes: 180 variables: # Connection string @@ -279,7 +281,8 @@ stages: - pwsh: | "UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL) UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD) - URL=$(ASPNETCORE_URLS)" | Out-File .env + URL=$(ASPNETCORE_URLS) + STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env displayName: Generate .env workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest @@ -350,7 +353,10 @@ stages: workingDirectory: tests/Umbraco.Tests.AcceptanceTest # Test - - pwsh: npm run test --ignore-certificate-errors + - ${{ if eq(parameters.runSmokeTests, true) }}: + pwsh: npm run smokeTest --ignore-certificate-errors + ${{ else }}: + pwsh: npm run test --ignore-certificate-errors displayName: Run Playwright tests continueOnError: true workingDirectory: tests/Umbraco.Tests.AcceptanceTest diff --git a/build/nightly-build-trigger.yml b/build/nightly-build-trigger.yml index 16cc06533d..7e128b2af7 100644 --- a/build/nightly-build-trigger.yml +++ b/build/nightly-build-trigger.yml @@ -26,7 +26,7 @@ steps: useSameBranch: true waitForQueuedBuildsToFinish: false storeInEnvironmentVariable: false - templateParameters: 'sqlServerIntegrationTests: true, sqlServerAcceptanceTests: true, forceReleaseTestFilter: true, myGetDeploy: true, isNightly: true' + templateParameters: 'sqlServerIntegrationTests: true, forceReleaseTestFilter: true, myGetDeploy: true, isNightly: true' authenticationMethod: 'OAuth Token' enableBuildInQueueCondition: false dependentOnSuccessfulBuildCondition: false diff --git a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json index c8fe8a078f..bb227d8a12 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package-lock.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package-lock.json @@ -7,8 +7,8 @@ "name": "acceptancetest", "hasInstallScript": true, "dependencies": { - "@umbraco/json-models-builders": "^2.0.17", - "@umbraco/playwright-testhelpers": "^2.0.0-beta.82", + "@umbraco/json-models-builders": "^2.0.20", + "@umbraco/playwright-testhelpers": "^2.0.0-beta.84", "camelize": "^1.0.0", "dotenv": "^16.3.1", "node-fetch": "^2.6.7" @@ -55,21 +55,21 @@ } }, "node_modules/@umbraco/json-models-builders": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/@umbraco/json-models-builders/-/json-models-builders-2.0.18.tgz", - "integrity": "sha512-VC2KCuWVhae0HzVpo9RrOQt6zZSQqSpWqwCoKYYwmhRz/SYo6hARV6sH2ceEFsQwGqqJvakXuUWzlJK7bFqK1Q==", + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/@umbraco/json-models-builders/-/json-models-builders-2.0.20.tgz", + "integrity": "sha512-LmTtklne1HlhMr1nALA+P5FrjIC9jL3A6Pcxj4dy+IPnTgnU2vMYaQIfE8wwz5Z5fZ5AAhWx/Zpdi8xCTbVSuQ==", "license": "MIT", "dependencies": { "camelize": "^1.0.1" } }, "node_modules/@umbraco/playwright-testhelpers": { - "version": "2.0.0-beta.82", - "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-2.0.0-beta.82.tgz", - "integrity": "sha512-VkArVyvkKuTwJJH8eCHSvbho4H1Owx2ifidVuPyN8EVGDWbxOTb5i9jmtFjJnfDg9mg50JhRYKas4lUGvy1pBA==", + "version": "2.0.0-beta.84", + "resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-2.0.0-beta.84.tgz", + "integrity": "sha512-vH13Lg48knTkkLVTwhMXUKTOdjtmixFj0wF5Qhgb++13u4AVDb+oW+TbFwTjSYaLeNMraq5Uhwmto/XuJPs2Rw==", "license": "MIT", "dependencies": { - "@umbraco/json-models-builders": "2.0.18", + "@umbraco/json-models-builders": "2.0.20", "node-fetch": "^2.6.7" } }, diff --git a/tests/Umbraco.Tests.AcceptanceTest/package.json b/tests/Umbraco.Tests.AcceptanceTest/package.json index 78cbb58c73..30706ad5de 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/package.json +++ b/tests/Umbraco.Tests.AcceptanceTest/package.json @@ -18,8 +18,8 @@ "typescript": "^4.8.3" }, "dependencies": { - "@umbraco/json-models-builders": "^2.0.17", - "@umbraco/playwright-testhelpers": "^2.0.0-beta.82", + "@umbraco/json-models-builders": "^2.0.20", + "@umbraco/playwright-testhelpers": "^2.0.0-beta.84", "camelize": "^1.0.0", "dotenv": "^16.3.1", "node-fetch": "^2.6.7"