V16 QA Publish Console Error Logs (#19417)
* Updated configuration * Updated pipeline * Updated nightly pipeline * Bumped version * updated if statement
This commit is contained in:
@@ -567,7 +567,8 @@ stages:
|
||||
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
|
||||
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
|
||||
URL=$(ASPNETCORE_URLS)
|
||||
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
|
||||
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json
|
||||
CONSOLE_ERRORS_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/console-errors.json" | Out-File .env
|
||||
displayName: Generate .env
|
||||
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
|
||||
|
||||
@@ -650,6 +651,14 @@ stages:
|
||||
displayName: Copy Playwright results
|
||||
condition: succeededOrFailed()
|
||||
|
||||
# Copy console error log
|
||||
- pwsh: |
|
||||
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/console-errors.json) {
|
||||
Copy-Item tests/Umbraco.Tests.AcceptanceTest/console-errors.json $(Build.ArtifactStagingDirectory)
|
||||
}
|
||||
displayName: Copy console error log
|
||||
condition: succeededOrFailed()
|
||||
|
||||
# Publish test artifacts
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: Publish test artifacts
|
||||
@@ -725,7 +734,8 @@ stages:
|
||||
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
|
||||
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
|
||||
URL=$(ASPNETCORE_URLS)
|
||||
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
|
||||
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json
|
||||
CONSOLE_ERRORS_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/console-errors.json" | Out-File .env
|
||||
displayName: Generate .env
|
||||
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
|
||||
|
||||
@@ -826,6 +836,14 @@ stages:
|
||||
displayName: Copy Playwright results
|
||||
condition: succeededOrFailed()
|
||||
|
||||
# Copy console error log
|
||||
- pwsh: |
|
||||
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/console-errors.json) {
|
||||
Copy-Item tests/Umbraco.Tests.AcceptanceTest/console-errors.json $(Build.ArtifactStagingDirectory)
|
||||
}
|
||||
displayName: Copy console error log
|
||||
condition: succeededOrFailed()
|
||||
|
||||
# Publish test artifacts
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: Publish test artifacts
|
||||
|
||||
@@ -180,7 +180,8 @@ stages:
|
||||
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
|
||||
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
|
||||
URL=$(ASPNETCORE_URLS)
|
||||
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
|
||||
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json
|
||||
CONSOLE_ERRORS_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/console-errors.json" | Out-File .env
|
||||
displayName: Generate .env
|
||||
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
|
||||
|
||||
@@ -268,6 +269,14 @@ stages:
|
||||
displayName: Copy Playwright results
|
||||
condition: succeededOrFailed()
|
||||
|
||||
# Copy console error log
|
||||
- pwsh: |
|
||||
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/console-errors.json) {
|
||||
Copy-Item tests/Umbraco.Tests.AcceptanceTest/console-errors.json $(Build.ArtifactStagingDirectory)
|
||||
}
|
||||
displayName: Copy console error log
|
||||
condition: succeededOrFailed()
|
||||
|
||||
# Publish
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: Publish test artifacts
|
||||
@@ -343,7 +352,8 @@ stages:
|
||||
"UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
|
||||
UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
|
||||
URL=$(ASPNETCORE_URLS)
|
||||
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json" | Out-File .env
|
||||
STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json
|
||||
CONSOLE_ERRORS_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/console-errors.json" | Out-File .env
|
||||
displayName: Generate .env
|
||||
workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
|
||||
|
||||
@@ -449,6 +459,14 @@ stages:
|
||||
displayName: Copy Playwright results
|
||||
condition: succeededOrFailed()
|
||||
|
||||
# Copy console error log
|
||||
- pwsh: |
|
||||
if (Test-Path tests/Umbraco.Tests.AcceptanceTest/console-errors.json) {
|
||||
Copy-Item tests/Umbraco.Tests.AcceptanceTest/console-errors.json $(Build.ArtifactStagingDirectory)
|
||||
}
|
||||
displayName: Copy console error log
|
||||
condition: succeededOrFailed()
|
||||
|
||||
# Publish
|
||||
- task: PublishPipelineArtifact@1
|
||||
displayName: Publish test artifacts
|
||||
|
||||
@@ -2,45 +2,48 @@ const prompt = require('prompt');
|
||||
const fs = require('fs');
|
||||
|
||||
const properties = [
|
||||
{
|
||||
description: 'Enter your Umbraco superadmin username/email',
|
||||
name: 'username',
|
||||
required: true
|
||||
},
|
||||
{
|
||||
description: 'Enter your Umbraco superadmin password',
|
||||
name: 'password',
|
||||
hidden: true,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
description: 'Enter CMS URL, or leave empty for default(https://localhost:44339)',
|
||||
name: 'baseUrl'
|
||||
}
|
||||
{
|
||||
description: 'Enter your Umbraco superadmin username/email',
|
||||
name: 'username',
|
||||
required: true
|
||||
},
|
||||
{
|
||||
description: 'Enter your Umbraco superadmin password',
|
||||
name: 'password',
|
||||
hidden: true,
|
||||
required: true
|
||||
},
|
||||
{
|
||||
description: 'Enter CMS URL, or leave empty for default(https://localhost:44339)',
|
||||
name: 'baseUrl'
|
||||
}
|
||||
];
|
||||
|
||||
const configPath = './.env';
|
||||
|
||||
const configPath = './.env'
|
||||
|
||||
console.log("Configure your Umbraco test environment")
|
||||
console.log("Configure your Umbraco test environment");
|
||||
|
||||
prompt.start();
|
||||
|
||||
prompt.get(properties, function (error, result) {
|
||||
if (error) { return onError(error); }
|
||||
if (error) {
|
||||
return onError(error);
|
||||
}
|
||||
|
||||
var fileContent = `UMBRACO_USER_LOGIN=${result.username}
|
||||
const fileContent = `UMBRACO_USER_LOGIN=${result.username}
|
||||
UMBRACO_USER_PASSWORD=${result.password}
|
||||
URL=${result.baseUrl || "https://localhost:44339"}
|
||||
STORAGE_STAGE_PATH=${__dirname.replace(/\\/g,'/')}/playwright/.auth/user.json`;
|
||||
STORAGE_STAGE_PATH=${__dirname.replace(/\\/g, '/')}/playwright/.auth/user.json
|
||||
CONSOLE_ERRORS_PATH=${__dirname.replace(/\\/g, '/')}/console-errors.json`;
|
||||
|
||||
fs.writeFile(configPath, fileContent, function (error) {
|
||||
if (error) return console.error(error);
|
||||
console.log('Configuration saved');
|
||||
});
|
||||
|
||||
fs.writeFile(configPath, fileContent, function (error) {
|
||||
if (error) return console.error(error);
|
||||
console.log('Configuration saved');
|
||||
});
|
||||
});
|
||||
|
||||
function onError(error) {
|
||||
console.error(error);
|
||||
return true;
|
||||
console.error(error);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const configPath = './.env';
|
||||
const consoleErrorsPath = './console-errors.json';
|
||||
|
||||
try {
|
||||
if (fs.existsSync(configPath)) {
|
||||
//file exists
|
||||
// file exists
|
||||
console.log("Skips configuration as file already exists, run 'npm run config' to change your configuration.");
|
||||
} else {
|
||||
require('./config.js');
|
||||
}
|
||||
} catch(err) {
|
||||
console.error(err)
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
try {
|
||||
if (!fs.existsSync(consoleErrorsPath)) {
|
||||
const consoleErrorsFileContent = `{
|
||||
"consoleErrors": []
|
||||
}`;
|
||||
|
||||
fs.writeFileSync(consoleErrorsPath, consoleErrorsFileContent);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user