diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts index 2e3fc51d1..55aa64316 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts @@ -34,6 +34,7 @@ import * as data from "../../../../../utils/data_utils"; import { CredentialsSourceControlUsername } from "../../../../models/administration/credentials/credentialsSourceControlUsername"; import { CredentialsSourceControlKey } from "../../../../models/administration/credentials/credentialsSourceControlKey"; import { Application } from "../../../../models/migration/applicationinventory/application"; +import { AppIssue } from "../../../../types/types"; let source_credential: CredentialsSourceControlUsername; let maven_credential: CredentialsMaven; let applicationsList: Array = []; @@ -347,6 +348,53 @@ describe(["@tier1"], "Source Analysis", () => { application.verifyEffort(this.analysisData["tackle-testapp-public-4-targets"]["effort"]); }); + // Automates customer bug MTA-2973 + it("Bug MTA-3163: Source analysis on tackle app public with custom rule", function () { + const applicationList = [ + new Analysis( + getRandomApplicationData("tackle-public-customRule", { + sourceData: this.appData["tackle-testapp-public"], + }), + getRandomAnalysisData(this.analysisData["tackle-testapp-public-customRule"]) + ), + ]; + + // Analysis application with maven credential + cy.wait(2 * SEC); + Application.open(); + applicationList[0].create(); + applicationList[0].manageCredentials(null, maven_credential.name); + applicationsList.push(applicationList[0]); + cy.wait(5 * SEC); + applicationList[0].analyze(); + applicationList[0].verifyAnalysisStatus("Completed"); + applicationList[0].validateIssues( + this.analysisData["tackle-testapp-public-customRule"]["issues"] + ); + this.analysisData["tackle-testapp-public-customRule"]["issues"].forEach( + (currentIssue: AppIssue) => { + applicationList[0].validateAffected(currentIssue); + } + ); + + // Analysis application without maven credential + cy.wait(2 * SEC); + Application.open(); + applicationList[1].create(); + applicationsList.push(applicationList[0]); + cy.wait(5 * SEC); + applicationList[1].analyze(); + applicationList[1].verifyAnalysisStatus("Completed"); + applicationList[1].validateIssues( + this.analysisData["tackle-testapp-public-customRule"]["issues"] + ); + this.analysisData["tackle-testapp-public-customRule"]["issues"].forEach( + (currentIssue: AppIssue) => { + applicationList[1].validateAffected(currentIssue); + } + ); + }); + after("Perform test data clean up", function () { deleteByList(applicationsList); writeMavenSettingsFile(data.getRandomWord(5), data.getRandomWord(5)); diff --git a/cypress/fixtures/analysis.json b/cypress/fixtures/analysis.json index 71c9df722..7abfb04a7 100644 --- a/cypress/fixtures/analysis.json +++ b/cypress/fixtures/analysis.json @@ -1211,5 +1211,40 @@ "source": "Source code", "target": ["Application server migration to", "OpenJDK", "Containerization", "Linux"], "effort": 20 + }, + "tackle-testapp-public-customRule": { + "appName": "tackle-testapp-public", + "source": "Source code", + "target": ["Containerization", "Linux", "OracleJDK to OpenJDK"], + "customRule": ["corporate-framework-config.windup.xml"], + "effort": 2, + "issues": [ + { + "name": "Hardcoded IP Address", + "category": "mandatory", + "source": "None", + "targets": ["cloud-readiness", "discovery"], + "effort": 1, + "totalEffort": 1, + "incidents": 1, + "affectedFiles": 1, + "ruleSet": "discovery-rules", + "rule": "hardcoded-ip-address", + "labels": "discovery" + }, + { + "name": "Legacy configuration with io.konveyor.demo.config.ApplicationConfiguration", + "category": "mandatory", + "sources": ["java", "java-ee"], + "targets": ["cloud-readiness"], + "effort": 1, + "totalEffort": 1, + "incidents": 1, + "affectedFiles": 1, + "ruleSet": "files", + "rule": "corporate-config-01000", + "labels": ["None"] + } + ] } }