Skip to content

Commit

Permalink
Automate Close-loop bug MTA-2972
Browse files Browse the repository at this point in the history
Signed-off-by: Karishma Punwatkar <[email protected]>

	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts
	modified:   cypress/fixtures/analysis.json

	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts
	modified:   cypress/fixtures/analysis.json

	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts
	modified:   cypress/fixtures/analysis.json

	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts

	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts
  • Loading branch information
kpunwatk committed Aug 21, 2024
1 parent 22a761a commit 2b1d5f2
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Analysis> = [];
Expand Down Expand Up @@ -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));
Expand Down
35 changes: 35 additions & 0 deletions cypress/fixtures/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
]
}
}

0 comments on commit 2b1d5f2

Please sign in to comment.