diff --git a/playwright-tests/impl/reporter/JiraWritebackReporter.ts b/playwright-tests/impl/reporter/JiraWritebackReporter.ts index 1d2a40e3..d71f3c5c 100644 --- a/playwright-tests/impl/reporter/JiraWritebackReporter.ts +++ b/playwright-tests/impl/reporter/JiraWritebackReporter.ts @@ -6,6 +6,8 @@ import OrtoniReport, { OrtoniReportConfig } from "ortoni-report"; let jiraCardNumber = process.env.JIRA_CARD_NUMBER || ''; const isRegressionRun = process.env.IS_REGRESSION === 'true'? true: false; +const isCreateBugSubtasks = !isRegressionRun; // DO NOT create anything for a regression run. Temporary for this project. In library package, this will be a config option. +const isCreateTestSubtasks = !isRegressionRun; const jiraProjectKey = process.env.JIRA_PROJECT_KEY!; const jiraEpicKey = process.env.JIRA_EPIC_KEY!; const passTransitionId = '111'; @@ -374,7 +376,7 @@ export default class JiraWritebackReporter implements Reporter { const subTask = this.getCreateTestSubtask(test, result); // Will return undefined if test status is 'skipped' const bug = this.getCreateBug(test, result); // Will return undefined if we don't need one - if (subTask) { + if (subTask && isCreateTestSubtasks) { // Create or Edit Subtask if (existingTestSubtask) { if (result.status === 'passed') { @@ -390,7 +392,7 @@ export default class JiraWritebackReporter implements Reporter { } } - if (bug) { + if (bug && isCreateBugSubtasks) { // Create or Edit Bug if (existingBug) { // Leave it alone. This reporter should not modify existing bugs. @@ -409,7 +411,9 @@ export default class JiraWritebackReporter implements Reporter { */ onTestEnd(test: TestCase, result: TestResult) { this.ortoniReport.onTestEnd(test, result); - this.loadIssueCalls.push(() => { this.loadIssue(test, result); }); + if (isCreateBugSubtasks || isCreateTestSubtasks) { // IF any type of subtasks should be created/modified, call loadIssue(). Otherwise, do not call it. + this.loadIssueCalls.push(() => { this.loadIssue(test, result); }); + } } /**