Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] Fix source analysis test case #1295

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,14 @@ export class Analysis extends Application {
if (["OpenJDK 11", "OpenJDK 17", "OpenJDK 21"].includes(target[i])) {
click(openjdkToggleButton);
clickByText(dropDownMenu, target[i]);
click(`#target-OpenJDK-select`);
} else if (["camel:3", "camel:4"].includes(target[i])) {
click(camelToggleButton);
clickByText(dropDownMenu, target[i]);
click(`#target-Camel-select`);
} else {
click(`#target-${target[i].replace(/ /g, "-")}-select`);
}
click(`#target-${target[i].replace(/ /g, "-")}-select`);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ describe(["@tier1"], "Source Analysis", () => {
application.verifyEffort(this.analysisData["analysis_on_example-1-app"]["effort"]);
});

it("Bug MTA-2916: JWS6 target Source + deps analysis on tackletest app", function () {
it("JWS6 target Source + deps analysis on tackletest app", function () {
// Source code analysis require both source and maven credentials
const application = new Analysis(
getRandomApplicationData("tackleTestApp_Source+dependencies_jws6", {
Expand All @@ -289,7 +289,7 @@ describe(["@tier1"], "Source Analysis", () => {
);
});

it("Bug MTA-2916: Openjdk17 Source + dependencies analysis on tackletest app", function () {
it("Bug MTA-4408: Openjdk17 Source + dependencies analysis on tackletest app", function () {
const application = new Analysis(
getRandomApplicationData("tackleTestApp_Source+dependencies_openjdk17", {
sourceData: this.appData["tackle-testapp-git"],
Expand All @@ -311,7 +311,7 @@ describe(["@tier1"], "Source Analysis", () => {
);
});

it("Bug MTA-2916: OpenJDK21 Source + dependencies analysis on daytrader app", function () {
it("OpenJDK21 Source + dependencies analysis on daytrader app", function () {
const application = new Analysis(
getRandomApplicationData("dayTraderApp_Source+dependencies_openjdk21", {
sourceData: this.appData["daytrader-app"],
Expand All @@ -325,6 +325,7 @@ describe(["@tier1"], "Source Analysis", () => {
cy.wait(2 * SEC);
application.analyze();
application.verifyAnalysisStatus("Completed");
Application.open();
application.verifyEffort(
this.analysisData["openJDK21_source+dep_analysis_on_dayTrader"]["effort"]
);
Expand Down Expand Up @@ -368,49 +369,38 @@ describe(["@tier1"], "Source Analysis", () => {

// Automates customer bug MTA-2973
it("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);
const { appData, analysisData } = this;
const applicationData = getRandomApplicationData("tackle-public-customRule", {
sourceData: appData["tackle-testapp-public"],
});

const analysisDataCustomRule = analysisData["tackle-testapp-public-customRule"];

for (let i = 0; i < 2; i++) {
applicationsList.push(
new Analysis(applicationData, getRandomAnalysisData(analysisDataCustomRule))
);
}

// Analyze an application
const analyzeApplication = (application, credentials) => {
application.create();
if (credentials) application.manageCredentials(null, credentials.name);
application.analyze();
application.verifyAnalysisStatus("Completed");
application.validateIssues(analysisDataCustomRule.issues);
analysisDataCustomRule.issues.forEach((issue) => {
application.validateAffected(issue);
});
};

// Analyze application with Maven credentials
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);
}
);
analyzeApplication(applicationsList[0], maven_credential);

// Analysis application without maven credential
cy.wait(2 * SEC);
// Analyze application without Maven credentials
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);
}
);
analyzeApplication(applicationsList[1], null);
});

it("Bug MTA-3701: Source analysis on tackle app with hash in Password", function () {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/views/analysis.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const enableAutomatedTagging = "input[name=autoTaggingEnabled]";
export const kebabTopMenuButton = "#toolbar-kebab";
export const camelToggleButton = "#Camel-toggle";
export const openjdkToggleButton = "#OpenJDK-toggle";
export const dropDownMenu = "ul.pf-v5-c-select__menu";
export const dropDownMenu = "ul.pf-v5-c-menu__list";
export const closeWizard = ".pf-v5-c-wizard__close > .pf-v5-c-button";
export const codeEditorControls = "div.pf-v5-c-code-editor__controls";
export const menuToggle = "button.pf-v5-c-menu-toggle";
Expand Down
14 changes: 7 additions & 7 deletions cypress/fixtures/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -1254,23 +1254,23 @@
"target": ["JBoss Web Server 6"],
"appName": "tackle-testapp",
"openSourceLibraries": true,
"effort": 2
"effort": 34
},

"openJDK17_source+dep_analysis_on_tackletestapp": {
"source": "Source code + dependencies",
"target": ["OpenJDK 17"],
"appName": "tackle-testapp",
"openSourceLibraries": true,
"effort": 4104
"effort": 1335
},

"openJDK21_source+dep_analysis_on_dayTrader": {
"source": "Source code + dependencies",
"target": ["OpenJDK 21"],
"appName": "deps",
"openSourceLibraries": true,
"effort": 596
"effort": 330
},

"jdk9_source_dep_analysis_on_tackletestapp": {
Expand Down Expand Up @@ -1321,8 +1321,8 @@
{
"name": "Hardcoded IP Address",
"category": "mandatory",
"source": "None",
"targets": ["cloud-readiness", "discovery"],
"sources": ["None"],
"targets": ["cloud-readiness"],
"effort": 1,
"totalEffort": 1,
"incidents": 1,
Expand All @@ -1334,8 +1334,8 @@
{
"name": "Legacy configuration with io.konveyor.demo.config.ApplicationConfiguration",
"category": "mandatory",
"sources": ["java", "java-ee"],
"targets": ["cloud-readiness"],
"sources": ["traditional-corporate-framework"],
"targets": ["cloud-corporate-framework"],
"effort": 1,
"totalEffort": 1,
"incidents": 1,
Expand Down
Loading