Skip to content

Commit

Permalink
[RFR] Fix Source analysis
Browse files Browse the repository at this point in the history
Signed-off-by: Karishma Punwatkar <[email protected]>

	modified:   cypress/e2e/models/migration/applicationinventory/application.ts
	modified:   cypress/e2e/models/migration/dynamic-report/issues/issues.ts

	modified:   cypress/e2e/models/migration/dynamic-report/issues/issues.ts

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

	modified:   cypress/fixtures/analysis.json

	modified:   cypress/e2e/models/migration/dynamic-report/issues/issues.ts
	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts
	modified:   cypress/fixtures/analysis.json
  • Loading branch information
kpunwatk committed Jan 23, 2025
1 parent 09a7bcd commit ca81a88
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
4 changes: 3 additions & 1 deletion cypress/e2e/models/migration/dynamic-report/issues/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ export class Issues {
);
Issues.validateSection(issue.name, sections.targetTechnologies, span, issue.targets);
Issues.validateSection(issue.name, sections.sourceTechnologies, div, issue.sources);
Issues.validateSection(issue.name, sections.ruleSet, div, issue.ruleSet);
if (issue.ruleSet) {
Issues.validateSection(issue.name, sections.ruleSet, div, issue.ruleSet);
}
Issues.validateSection(issue.name, sections.rule, div, issue.rule);
Issues.validateSection(issue.name, sections.labels, div, issue.labels);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ describe(["@tier1"], "Source Analysis", () => {
cy.wait(2 * SEC);
application.analyze();
application.verifyAnalysisStatus("Completed");
Application.open();
// Polarion TC 406
application.verifyEffort(this.analysisData["analysis_on_example-1-app"]["effort"]);
});
Expand All @@ -284,6 +285,7 @@ describe(["@tier1"], "Source Analysis", () => {
application.manageCredentials(source_credential.name, maven_credential.name);
application.analyze();
application.verifyAnalysisStatus("Completed");
Application.open();
application.verifyEffort(
this.analysisData["jws6_source+dep_analysis_on_tackletestapp"]["effort"]
);
Expand Down Expand Up @@ -364,22 +366,22 @@ describe(["@tier1"], "Source Analysis", () => {
cy.wait(5 * SEC);
application.analyze();
application.verifyAnalysisStatus("Completed");
Application.open();
application.verifyEffort(this.analysisData["tackle-testapp-public-4-targets"]["effort"]);
});

// Automates customer bug MTA-2973
it("Source analysis on tackle app public with custom rule", function () {
const { appData, analysisData } = this;
const applicationData = getRandomApplicationData("tackle-public-customRule", {
sourceData: appData["tackle-testapp-public"],
});

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

for (let i = 0; i < 2; i++) {
applicationsList.push(
new Analysis(applicationData, getRandomAnalysisData(analysisDataCustomRule))
const application = new Analysis(
getRandomApplicationData("tackle-public-customRule", {
sourceData: this.appData["tackle-testapp-public"],
}),
getRandomAnalysisData(this.analysisData["tackle-testapp-public-customRule"])
);
applicationsList.push(application);
}

// Analyze an application
Expand All @@ -388,10 +390,14 @@ describe(["@tier1"], "Source Analysis", () => {
if (credentials) application.manageCredentials(null, credentials.name);
application.analyze();
application.verifyAnalysisStatus("Completed");
application.validateIssues(analysisDataCustomRule.issues);
analysisDataCustomRule.issues.forEach((issue) => {
application.validateAffected(issue);
});
application.validateIssues(
this.analysisData["tackle-testapp-public-customRule"]["issues"]
);
this.analysisData["tackle-testapp-public-customRule"]["issues"].forEach(
(currentIssue: AppIssue) => {
application.validateAffected(currentIssue);
}
);
};

// Analyze application with Maven credentials
Expand Down
3 changes: 1 addition & 2 deletions cypress/fixtures/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -1403,9 +1403,8 @@
"totalEffort": 1,
"incidents": 1,
"affectedFiles": 1,
"ruleSet": "files",
"rule": "corporate-config-01000",
"labels": ["None"]
"labels": ["configuration", "konveyor.io/include=always"]
}
]
},
Expand Down

0 comments on commit ca81a88

Please sign in to comment.