From cc8cc67c0b7a64fdec6b91c3d4b2083c1cc20d94 Mon Sep 17 00:00:00 2001 From: Shveta Sachdeva Date: Thu, 25 May 2023 10:18:24 -0700 Subject: [PATCH 1/7] Revert bulk selection checkbox for 6.1.1 (#502) Signed-off-by: Shveta --- cypress/utils/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/utils/utils.ts b/cypress/utils/utils.ts index 4b8ac12a6..06c871e15 100644 --- a/cypress/utils/utils.ts +++ b/cypress/utils/utils.ts @@ -668,7 +668,7 @@ export function deleteApplicationTableRows(currentPage = false): void { cy.get(".pf-c-dropdown__toggle-button").click({ force: true }); clickByText(button, "Select page"); } else { - cy.get("input#bulk-selected-items-checkbox", { + cy.get("input#bulk-selected-apps-checkbox", { timeout: 10 * SEC, }).check({ force: true }); } From 29df7423bb1d068fca32e58235bed9e03aed9767 Mon Sep 17 00:00:00 2001 From: Caleb Evans Date: Fri, 9 Jun 2023 13:43:31 -0600 Subject: [PATCH 2/7] Add the interop Dockerfile (#518) Signed-off-by: Caleb Evans --- dockerfiles/interop/Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dockerfiles/interop/Dockerfile diff --git a/dockerfiles/interop/Dockerfile b/dockerfiles/interop/Dockerfile new file mode 100644 index 000000000..ba145fecf --- /dev/null +++ b/dockerfiles/interop/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/cypress/included:12.11.0 + +# point Cypress at the /tmp/cache no matter what user account is used +# see https://on.cypress.io/caching +ENV CYPRESS_CACHE_FOLDER=/tmp/.cache/Cypress +ENV npm_config_cache=/tmp/.cache/npm + +# Update container and install unzip +RUN apt -y update && \ + apt install -y unzip + +RUN mkdir /tmp/tackle-ui-tests +WORKDIR /tmp/tackle-ui-tests +COPY . . +RUN npm install . +RUN cypress install + +# Set required permissions for OpenShift usage +RUN chgrp -R 0 /tmp && \ + chmod -R g=u /tmp + +ENTRYPOINT ["/bin/bash"] \ No newline at end of file From a134097348f48d855d404cd7ed8017318cdbd12f Mon Sep 17 00:00:00 2001 From: Igor Braginsky Date: Tue, 13 Jun 2023 17:37:53 +0300 Subject: [PATCH 3/7] Skipping failing tests (#521) Signed-off-by: Igor Braginsky --- cypress/e2e/tests/rbac/custom-rules.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/tests/rbac/custom-rules.test.ts b/cypress/e2e/tests/rbac/custom-rules.test.ts index 2ed21fccf..0bdb944e7 100644 --- a/cypress/e2e/tests/rbac/custom-rules.test.ts +++ b/cypress/e2e/tests/rbac/custom-rules.test.ts @@ -81,7 +81,7 @@ describe(["@tier2"], "Custom Rules RBAC operations", function () { }); }); - it("Admin, Rules from public repository", function () { + it.skip("Admin, Rules from public repository, skipping tests failing due to a known bug MTA-458", function () { analysisWithPublicRules = new Analysis( getRandomApplicationData("bookServerApp", { sourceData: this.appData["bookserver-app"], @@ -132,12 +132,14 @@ describe(["@tier2"], "Custom Rules RBAC operations", function () { logout(); }); - it("Architect, Rules from public repository", function () { + it.skip("Architect, Rules from public repository, skipping tests failing due to a known bug MTA-458", function () { architect.login(); analyzeAndVerify(analysisWithPublicRules, AnalysisStatuses.completed); }); it("Architect, Rules from private repository with credentials", function () { + // Moved login here cause previous test should be skipped + architect.login(); analyzeAndVerify(analysisWithPrivateRules, AnalysisStatuses.completed); }); @@ -146,12 +148,14 @@ describe(["@tier2"], "Custom Rules RBAC operations", function () { architect.logout(); }); - it("Migrator, Rules from public repository", function () { + it.skip("Migrator, Rules from public repository, skipping tests failing due to a known bug MTA-458", function () { migrator.login(); analyzeAndVerify(analysisWithPublicRules, AnalysisStatuses.completed); }); it("Migrator, Rules from private repository with credentials", function () { + // Moved login here cause previous test should be skipped + migrator.login(); analyzeAndVerify(analysisWithPrivateRules, AnalysisStatuses.completed); }); From 02bbd9d427f0e232fceecc3eb6c8c72e7e077660 Mon Sep 17 00:00:00 2001 From: Igor Braginsky Date: Thu, 22 Jun 2023 10:31:37 +0300 Subject: [PATCH 4/7] Added @rhsso tag to relevant tests, removed unused import (#541) --- cypress/e2e/tests/rbac/architect.test.ts | 6 +++--- cypress/e2e/tests/rbac/migrator.test.ts | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/tests/rbac/architect.test.ts b/cypress/e2e/tests/rbac/architect.test.ts index b82d39926..c251b593a 100644 --- a/cypress/e2e/tests/rbac/architect.test.ts +++ b/cypress/e2e/tests/rbac/architect.test.ts @@ -6,12 +6,11 @@ import { Analysis } from "../../models/migration/applicationinventory/analysis"; import { CredentialsSourceControlUsername } from "../../models/administration/credentials/credentialsSourceControlUsername"; import { CredentialType } from "../../types/constants"; import { Application } from "../../models/migration/applicationinventory/application"; -import { RbacValidationRules } from "../../types/types"; -import { Stakeholders } from "../../models/migration/controls/stakeholders"; import { Assessment } from "../../models/migration/applicationinventory/assessment"; +import { Stakeholders } from "../../models/migration/controls/stakeholders"; import * as data from "../../../utils/data_utils"; -describe(["@tier2"], "Architect RBAC operations", function () { +describe(["@tier2", "@rhsso"], "Architect RBAC operations", function () { let userArchitect = new UserArchitect(getRandomUserData()); const application = new Assessment(getRandomApplicationData()); let stakeholdersList: Array = []; @@ -22,6 +21,7 @@ describe(["@tier2"], "Architect RBAC operations", function () { ); before("Creating RBAC users, adding roles for them", function () { + //Need to log in as admin and create simple app with known name to use it for tests login(); // Navigate to stakeholders control tab and create new stakeholder const stakeholder = new Stakeholders(data.getEmail(), data.getFullName()); diff --git a/cypress/e2e/tests/rbac/migrator.test.ts b/cypress/e2e/tests/rbac/migrator.test.ts index 43c4e8e6c..d765b0e30 100644 --- a/cypress/e2e/tests/rbac/migrator.test.ts +++ b/cypress/e2e/tests/rbac/migrator.test.ts @@ -5,13 +5,12 @@ import { deleteByList, getRandomApplicationData, login, logout } from "../../../ import { Analysis } from "../../models/migration/applicationinventory/analysis"; import { CredentialsSourceControlUsername } from "../../models/administration/credentials/credentialsSourceControlUsername"; import { CredentialType } from "../../types/constants"; -import { RbacValidationRules } from "../../types/types"; import { Application } from "../../models/migration/applicationinventory/application"; import { Assessment } from "../../models/migration/applicationinventory/assessment"; import { Stakeholders } from "../../models/migration/controls/stakeholders"; import * as data from "../../../utils/data_utils"; -describe(["@tier2"], "Migrator RBAC operations", () => { +describe(["@tier2", "@rhsso"], "Migrator RBAC operations", () => { let userMigrator = new UserMigrator(getRandomUserData()); const application = new Assessment(getRandomApplicationData()); let stakeholdersList: Array = []; From 7542fb204cc6edda6c887a222b89324640bb7ec3 Mon Sep 17 00:00:00 2001 From: Igor Braginsky Date: Thu, 17 Aug 2023 22:46:06 +0300 Subject: [PATCH 5/7] Fixed patching of tackle CR (#683) Signed-off-by: Igor Braginsky --- cypress/utils/utils.ts | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/cypress/utils/utils.ts b/cypress/utils/utils.ts index 06c871e15..21cf377e7 100644 --- a/cypress/utils/utils.ts +++ b/cypress/utils/utils.ts @@ -1437,6 +1437,22 @@ export function isRwxEnabled(): boolean { return Cypress.env("rwx_enabled"); } +export function getUrl(): string { + return window.location.href; +} + +export function getNamespace(): string { + // This is regexp pattern to search between first `-` and first `.` + const namespacePattern = /-(.*?)\./; + // First match, means `-` + const match = getUrl().match(namespacePattern); + if (match && match[1]) { + return match[1].toString(); + } else { + return "konveyor-tackle"; + } +} + // This method is patching export function configureRWX(isEnabled = true): void { // Patching CR to set value @@ -1447,14 +1463,12 @@ export function configureRWX(isEnabled = true): void { value = "false"; } let command = ""; - let tackleCr = "tackle=$(oc get tackle --all-namespaces|grep -iv name|awk '{print $2}'); "; - let namespace = - 'namespace=$(oc get tackle --all-namespaces|egrep "tackle|mta"|cut -d " " -f 1); '; + let namespace = getNamespace(); + let tackleCr = `tackle=$(oc get tackle -n${namespace}|grep -iv name|awk '{print $1}'); `; command += tackleCr; - command += namespace; command += "oc patch tackle "; command += "$tackle "; - command += "-n$namespace "; + command += `-n${namespace} `; command += "--type merge "; command += `--patch '{"spec":{"rwx_supported": ${value}}}'`; cy.log(command); From ed2124b616bfcc87979b94441fd1a23c0bafa90f Mon Sep 17 00:00:00 2001 From: Igor Braginsky Date: Mon, 28 Aug 2023 13:18:56 +0300 Subject: [PATCH 6/7] Fixed custom migration targets RBAC (#696) Signed-off-by: Igor Braginsky --- .../tests/rbac/custom-migration-target.test.ts | 15 +++++---------- cypress/utils/utils.ts | 9 +++++++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/tests/rbac/custom-migration-target.test.ts b/cypress/e2e/tests/rbac/custom-migration-target.test.ts index 9d86f6e79..90cc567fd 100644 --- a/cypress/e2e/tests/rbac/custom-migration-target.test.ts +++ b/cypress/e2e/tests/rbac/custom-migration-target.test.ts @@ -19,16 +19,13 @@ import { clickByText, getRandomAnalysisData, getRandomApplicationData, - hasToBeSkipped, login, logout, - preservecookies, resetURL, selectItemsPerPage, } from "../../../utils/utils"; import { analyzeButton, - application, button, SEC, CustomRuleType, @@ -56,7 +53,7 @@ describe(["tier2", "@dc"], "Custom Migration Targets RBAC operations", function login(); cy.fixture("custom-rules").then((customMigrationTargets) => { - const targetData = customMigrationTargets.rules_from_bookServerApp; + const targetData = customMigrationTargets["rules_from_bookServerApp"]; const repositoryData: RulesRepositoryFields = { ...targetData.repository, type: CustomRuleType.Repository, @@ -72,8 +69,6 @@ describe(["tier2", "@dc"], "Custom Migration Targets RBAC operations", function }); beforeEach("Persist session", function () { - preservecookies(); - cy.fixture("application").then(function (appData) { this.appData = appData; }); @@ -108,14 +103,14 @@ describe(["tier2", "@dc"], "Custom Migration Targets RBAC operations", function it("Look for created target on an analysis as architect user", function () { architect.login(); assertTargetIsVisible(analysis, target); - analyzeAndVerify(analysis); + analyzeAndVerify(analysis, architect); architect.logout(); }); it("Look for created target on an analysis as migrator user", function () { migrator.login(); assertTargetIsVisible(analysis, target); - analyzeAndVerify(analysis); + analyzeAndVerify(analysis, migrator); migrator.logout(); }); @@ -150,11 +145,11 @@ describe(["tier2", "@dc"], "Custom Migration Targets RBAC operations", function clickByText(button, "Cancel"); }; - const analyzeAndVerify = (analysis: Analysis) => { + const analyzeAndVerify = (analysis: Analysis, user?: User) => { analysis.analyze(); cy.wait(10 * SEC); analysis.verifyAnalysisStatus(AnalysisStatuses.completed); analysis.openReport(); - resetURL(); + resetURL(user); }; }); diff --git a/cypress/utils/utils.ts b/cypress/utils/utils.ts index 21cf377e7..88092c23b 100644 --- a/cypress/utils/utils.ts +++ b/cypress/utils/utils.ts @@ -79,6 +79,7 @@ import { Application } from "../e2e/models/migration/applicationinventory/applic import { switchToggle } from "../e2e/views/reports.view"; import { rightSideMenu } from "../e2e/views/analysis.view"; import Chainable = Cypress.Chainable; +import { User } from "../e2e/models/keycloak/users/user"; let userName = Cypress.env("user"); let userPassword = Cypress.env("pass"); @@ -180,10 +181,14 @@ export function logout(userName?: string): void { cy.get("h1", { timeout: 15 * SEC }).contains("Sign in to your account"); } -export function resetURL(): void { +export function resetURL(user?: User): void { cy.url().then(($url) => { if ($url.includes("report") || $url.includes("tasks")) { - login(); + if (!user) { + login(); + } else { + user.login(); + } } }); } From 733ccbd9d243a30f20dcd0cd3d1c24ebc6a2d7c7 Mon Sep 17 00:00:00 2001 From: Shveta Sachdeva Date: Mon, 30 Oct 2023 13:51:33 -0700 Subject: [PATCH 7/7] Remove story point check Signed-off-by: Shveta Sachdeva --- .../analysis/binary_analysis.test.ts | 1 - .../analysis/source_analysis.test.ts | 9 --------- .../analysis/upload_binary_analysis.test.ts | 10 ---------- 3 files changed, 20 deletions(-) diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/binary_analysis.test.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/binary_analysis.test.ts index 9fe37d180..36fec60b4 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/binary_analysis.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/binary_analysis.test.ts @@ -122,6 +122,5 @@ describe(["@tier1"], "Binary Analysis", () => { application.downloadReport("HTML"); application.downloadReport("CSV"); application.openReport(); - application.validateStoryPoints(); }); }); 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 ba2deff98..a9fd8af07 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/source_analysis.test.ts @@ -113,7 +113,6 @@ describe(["@tier1"], "Source Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); }); it("Source + dependencies analysis on tackletest app", function () { @@ -131,7 +130,6 @@ describe(["@tier1"], "Source Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); }); it("Source + dependencies analysis on daytrader app", function () { @@ -148,7 +146,6 @@ describe(["@tier1"], "Source Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); }); it("Analysis on daytrader app with maven credentials", function () { @@ -166,7 +163,6 @@ describe(["@tier1"], "Source Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); }); it("Source Analysis on tackle testapp", function () { @@ -184,7 +180,6 @@ describe(["@tier1"], "Source Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); }); it("Analysis on tackle test app with ssh credentials", function () { @@ -209,7 +204,6 @@ describe(["@tier1"], "Source Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); }); it("Source Analysis on tackle testapp for svn repo type", function () { @@ -227,7 +221,6 @@ describe(["@tier1"], "Source Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); }); it("Analysis for known Open Source libraries on tackleTest app", function () { @@ -245,7 +238,6 @@ describe(["@tier1"], "Source Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); }); it("Automated tagging using Source Analysis on tackle testapp", function () { @@ -298,6 +290,5 @@ describe(["@tier1"], "Source Analysis", () => { application.analyze(); application.verifyAnalysisStatus(AnalysisStatuses.completed); application.openReport(); - application.validateStoryPoints(); }); }); diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts index ca22a2c69..537a767e5 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/upload_binary_analysis.test.ts @@ -92,7 +92,6 @@ describe(["@tier1"], "Upload Binary Analysis", () => { application.verifyAnalysisStatus("Completed"); application.downloadReport("HTML"); application.openReport(); - application.validateStoryPoints(); }); it("Custom rules with custom targets", function () { @@ -109,7 +108,6 @@ describe(["@tier1"], "Upload Binary Analysis", () => { application.verifyAnalysisStatus("Completed"); application.downloadReport("CSV"); application.openReport(); - application.validateStoryPoints(); }); it("DIVA report generation", function () { @@ -124,7 +122,6 @@ describe(["@tier1"], "Upload Binary Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); application.validateTransactionReport(); }); @@ -141,7 +138,6 @@ describe(["@tier1"], "Upload Binary Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateIncidents(); }); it("Analysis for camunda-bpm-spring-boot-starter", function () { @@ -155,8 +151,6 @@ describe(["@tier1"], "Upload Binary Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); - application.validateIncidents(); }); it("Analysis for complete-duke app upload binary ", function () { @@ -172,8 +166,6 @@ describe(["@tier1"], "Upload Binary Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); - application.validateIncidents(); }); it("Analysis for kafka-clients-sb app ", function () { @@ -187,7 +179,5 @@ describe(["@tier1"], "Upload Binary Analysis", () => { application.analyze(); application.verifyAnalysisStatus("Completed"); application.openReport(); - application.validateStoryPoints(); - application.validateIncidents(); }); });