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] Check discovery tasks for app with source code and branch name #1303

Merged
merged 1 commit into from
Jan 13, 2025
Merged
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
5 changes: 3 additions & 2 deletions cypress/e2e/models/migration/task-manager/task-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ export class TaskManager {
public static verifyTaskStatus(application: string, kind: TaskKind, status: TaskStatus) {
TaskManager.open();
TaskManager.getTaskRow(application, kind)
.find(tasksStatusColumn)
.contains(status, { timeout: 10 * MIN });
// The assertion will automatically retry as long as the parent command respects the timeout
.find(tasksStatusColumn, { timeout: 10 * MIN })
.should("contain.text", status);
}

public static applyFilter(filterType: TaskFilter, filterValue: string) {
Expand Down
19 changes: 17 additions & 2 deletions cypress/e2e/tests/migration/task-manager/task_manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import {
import { Analysis } from "../../../models/migration/applicationinventory/analysis";
import { Application } from "../../../models/migration/applicationinventory/application";
import { TaskManager } from "../../../models/migration/task-manager/task-manager";
import { TaskKind, TaskStatus } from "../../../types/constants";
import { SEC, TaskKind, TaskStatus } from "../../../types/constants";
import { TaskManagerColumns, tasksTable } from "../../../views/taskmanager.view";

let applicationsList: Array<Analysis> = [];
let applicationsList: Array<Application> = [];
let application: Analysis;

describe(["@tier1"], "Task Manager", () => {
Expand Down Expand Up @@ -81,6 +81,21 @@ describe(["@tier1"], "Task Manager", () => {
clearAllFilters();
});

it("Create an app with source code and branch name - discovery tasks should succeed", function () {
Application.open();
const app = new Application(
getRandomApplicationData("", {
sourceData: this.appData["konveyor-exampleapp"],
})
);
app.create();
cy.wait("@getApplication", { timeout: 2 * SEC });
applicationsList.push(app);
TaskManager.open();
TaskManager.verifyTaskStatus(app.name, TaskKind.languageDiscovery, TaskStatus.succeeded);
TaskManager.verifyTaskStatus(app.name, TaskKind.techDiscovery, TaskStatus.succeeded);
});

it("Delete an application - related tasks are deleted", function () {
// Remove the last element from applicationsList
const app = applicationsList.pop();
Expand Down
Loading