Skip to content

Commit 2001701

Browse files
feat: new data connector linking modal and tests update (#4431)
1 parent 4c68e34 commit 2001701

3 files changed

Lines changed: 58 additions & 61 deletions

File tree

cypress-tests/cypress/e2e/v2/dataConnectors.cy.ts

Lines changed: 52 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@ import {
1010
deleteDataConnector,
1111
} from "../../support/utils/dataConnectors";
1212
import { login } from "../../support/utils/general";
13+
import { verifySearchIndexing } from "../../support/utils/search";
1314

1415
const sessionId = ["dataConnectors", getRandomString()];
16+
const searchDataConnectorType = "type:DataConnector";
17+
const searchDataConnectorSlug = "slug:";
1518

1619
describe("Data Connectors", () => {
1720
const randomString = getRandomString();
1821
const projectName = `Project for data connector tests ${randomString}`;
1922
const projectSlug = `project-for-data-connector-tests-${randomString}`;
2023
let userNamespace: string;
2124
let dataConnectorName: string;
22-
let projectId: string;
25+
let projectId: string | undefined;
2326
let groupName: string;
2427
let groupSlug: string;
2528

@@ -43,7 +46,7 @@ describe("Data Connectors", () => {
4346
});
4447

4548
after(() => {
46-
deleteProject(projectId);
49+
if (projectId) deleteProject(projectId);
4750
});
4851

4952
beforeEach(() => {
@@ -121,8 +124,6 @@ describe("Data Connectors", () => {
121124
cy.getDataCy("data-connector-menu-dropdown").click();
122125
cy.getDataCy("data-connector-delete").click();
123126
});
124-
125-
// Confirm deletion by typing the slug
126127
cy.getDataCy("delete-confirmation-input").type(dataConnectorName);
127128
cy.getDataCy("delete-data-connector-modal-button").click();
128129

@@ -248,7 +249,6 @@ describe("Data Connectors", () => {
248249
projectId,
249250
);
250251

251-
// ? Currently, data connectors newly linked might not appear immediately
252252
visitCurrentProject();
253253
cy.getDataCy("data-connector-box")
254254
.find(`[data-cy=data-connector-name]`)
@@ -279,70 +279,54 @@ describe("Data Connectors", () => {
279279
cy.getDataCy("data-connector-edit-close-button").click();
280280

281281
// Verify the data connector is present with the edited name
282-
visitCurrentProject();
283282
cy.getDataCy("data-connector-box")
284283
.find(`[data-cy=data-connector-name]`)
285284
.contains(newName);
286285
});
287286

288-
it("Link an existing data connector to a project", () => {
289-
// Create a data connector not linked to a project
287+
it("Link and unlink an existing data connector to a project", () => {
288+
// Create a data connector not linked to a project and check it has been indexed
290289
const dataConnectorIdentifier = `${userNamespace}/${dataConnectorName}`;
291290
createDataConnector(dataConnectorIdentifier);
291+
verifySearchIndexing(
292+
`${searchDataConnectorType} ${searchDataConnectorSlug}${dataConnectorName}`,
293+
1,
294+
);
292295

293-
// Now link the data connector to the project
296+
// Link the data connector to the project
294297
visitCurrentProject();
295298
cy.getDataCy("add-data-connector").click();
296-
cy.getDataCy("project-data-controller-mode-link").click();
297-
298-
// Enter the data connector identifier
299-
cy.get("#data-connector-identifier")
299+
cy.getDataCy("data-connector-search-input")
300300
.should("be.empty")
301301
.type(dataConnectorIdentifier);
302-
cy.getDataCy("link-data-connector-button").click();
302+
cy.getDataCy("data-connector-search-body")
303+
.contains("[data-cy=link-data-connector-list-item]", dataConnectorName)
304+
.find(`[data-cy=data-connector-link-button]`)
305+
.click();
303306

304307
// Verify the data connector is linked to the project
305-
visitCurrentProject();
308+
cy.getDataCy("project-data-connector-connect-header")
309+
.find('button[data-bs-dismiss="modal"]')
310+
.click();
306311
cy.getDataCy("data-connector-box")
307312
.find(`[data-cy=data-connector-name]`)
308313
.contains(dataConnectorName);
309-
});
310314

311-
it("Unlink a data connector from a project", () => {
312-
// Create a data connector not linked to a project
313-
const dataConnectorIdentifier = `${userNamespace}/${dataConnectorName}`;
314-
createDataConnector(dataConnectorIdentifier);
315-
316-
// Now link the data connector to the project
317-
visitCurrentProject();
318-
cy.getDataCy("add-data-connector").click();
319-
cy.getDataCy("project-data-controller-mode-link").click();
320-
321-
// Enter the data connector identifier
322-
cy.get("#data-connector-identifier")
323-
.should("be.empty")
324-
.type(dataConnectorIdentifier);
325-
cy.getDataCy("link-data-connector-button").click();
326-
327-
// ? Currently, data connectors newly linked might not appear immediately
328-
visitCurrentProject();
315+
// Unlink the data connector from the project
329316
cy.getDataCy("data-connector-box")
330317
.find(`[data-cy=data-connector-name]`)
331318
.contains(dataConnectorName)
332319
.click();
333-
334320
cy.getDataCy("data-connector-view").within(() => {
335321
cy.getDataCy("data-connector-title")
336322
.should("be.visible")
337323
.contains(dataConnectorName);
338324
cy.getDataCy("data-connector-menu-dropdown").click();
339-
cy.getDataCy("data-connector-unlink").should("be.visible").click();
325+
cy.getDataCy("data-connector-unlink").click();
340326
});
341-
342327
cy.getDataCy("delete-data-connector-modal-button").click();
343328

344329
// Verify the data connector is no longer linked to the project
345-
visitCurrentProject();
346330
cy.getDataCy("data-connector-box")
347331
.contains(`[data-cy=data-connector-name]`, dataConnectorName)
348332
.should("not.exist");
@@ -359,31 +343,38 @@ describe("Data Connectors", () => {
359343
slug: otherProjectName,
360344
visibility: "private",
361345
}).then((response) => {
362-
const otherProjectId = response.body.id;
346+
const otherProjectId = response.body.id ?? "";
363347

364348
// Defer-delete the other project (which will also delete the data connector)
365349
cy.defer(() => {
366-
deleteProject(otherProjectId);
350+
if (otherProjectId) deleteProject(otherProjectId);
367351
});
368352

369-
// Create a data connector in the other project
353+
// Create a data connector in the other project and check it has been indexed
370354
const dataConnectorIdentifier = `${userNamespace}/${otherProjectName}/${dataConnectorName}`;
371355
createDataConnector(dataConnectorIdentifier, otherProjectId);
356+
verifySearchIndexing(
357+
`${searchDataConnectorType} ${searchDataConnectorSlug}${dataConnectorName}`,
358+
1,
359+
);
372360

373361
// Navigate to the main project
374362
visitCurrentProject();
375363

376364
// Link the data connector from the other project to the main project
377365
cy.getDataCy("add-data-connector").click();
378-
cy.getDataCy("project-data-controller-mode-link").click();
379-
380-
cy.get("#data-connector-identifier")
366+
cy.getDataCy("data-connector-search-input")
381367
.should("be.empty")
382368
.type(dataConnectorIdentifier);
383-
cy.getDataCy("link-data-connector-button").click();
369+
cy.getDataCy("data-connector-search-body")
370+
.contains("[data-cy=link-data-connector-list-item]", dataConnectorName)
371+
.find(`[data-cy=data-connector-link-button]`)
372+
.click();
384373

385374
// Verify the data connector is linked to the main project
386-
visitCurrentProject();
375+
cy.getDataCy("project-data-connector-connect-header")
376+
.find('button[data-bs-dismiss="modal"]')
377+
.click();
387378
cy.getDataCy("data-connector-box")
388379
.find(`[data-cy=data-connector-name]`)
389380
.contains(dataConnectorName)
@@ -395,12 +386,11 @@ describe("Data Connectors", () => {
395386
.should("be.visible")
396387
.contains(dataConnectorName);
397388
cy.getDataCy("data-connector-menu-dropdown").click();
398-
cy.getDataCy("data-connector-unlink").should("be.visible").click();
389+
cy.getDataCy("data-connector-unlink").click();
399390
});
400391
cy.getDataCy("delete-data-connector-modal-button").click();
401392

402393
// Verify the data connector is no longer linked to the main project
403-
visitCurrentProject();
404394
cy.getDataCy("data-connector-box")
405395
.contains(`[data-cy=data-connector-name]`, dataConnectorName)
406396
.should("not.exist");
@@ -468,21 +458,28 @@ describe("Data Connectors", () => {
468458
// Create a data connector owned by the group
469459
const dataConnectorIdentifier = `${groupSlug}/${dataConnectorName}`;
470460
createDataConnector(dataConnectorIdentifier);
461+
verifySearchIndexing(
462+
`${searchDataConnectorType} ${searchDataConnectorSlug}${dataConnectorName}`,
463+
1,
464+
);
471465

472466
// Navigate to the user's project
473467
visitCurrentProject();
474468

475469
// Link the group data connector to the user's project
476470
cy.getDataCy("add-data-connector").click();
477-
cy.getDataCy("project-data-controller-mode-link").click();
478-
479-
// Enter the data connector identifier
480-
cy.get("#data-connector-identifier")
471+
cy.getDataCy("data-connector-search-input")
481472
.should("be.empty")
482473
.type(dataConnectorIdentifier);
483-
cy.getDataCy("link-data-connector-button").click();
474+
cy.getDataCy("data-connector-search-body")
475+
.contains("[data-cy=link-data-connector-list-item]", dataConnectorName)
476+
.find(`[data-cy=data-connector-link-button]`)
477+
.click();
484478

485479
// Verify the data connector is linked to the project
480+
cy.getDataCy("project-data-connector-connect-header")
481+
.find('button[data-bs-dismiss="modal"]')
482+
.click();
486483
cy.getDataCy("data-connector-box")
487484
.find(`[data-cy=data-connector-name]`)
488485
.contains(dataConnectorName)
@@ -493,8 +490,8 @@ describe("Data Connectors", () => {
493490
cy.getDataCy("data-connector-title")
494491
.should("be.visible")
495492
.contains(dataConnectorName);
496-
cy.getDataCy("data-connector-menu-dropdown").should("be.visible").click();
497-
cy.getDataCy("data-connector-unlink").should("be.visible").click();
493+
cy.getDataCy("data-connector-menu-dropdown").click();
494+
cy.getDataCy("data-connector-unlink").click();
498495
});
499496
cy.getDataCy("delete-data-connector-modal-button").click();
500497

cypress-tests/cypress/support/utils/dataConnectors.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@ export function createDataConnector(
4646
visibility: body.visibility || "private",
4747
description: body.description || "Test data connector description",
4848
storage: {
49-
storage_type: "s3",
5049
configuration: {
5150
type: "s3",
5251
provider: "AWS",
53-
region: "us-east-1",
5452
},
5553
source_path: "giab",
5654
target_path: body.slug || "/",

helm-chart/renku/values.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ ui:
548548
replicaCount: 1
549549
image:
550550
repository: renku/renku-ui
551-
tag: "4.21.0"
551+
tag: "4.22.0"
552552
pullPolicy: IfNotPresent
553553
## Optionally specify an array of imagePullSecrets.
554554
## Secrets must be manually created in the namespace.
@@ -740,7 +740,7 @@ ui:
740740
keepCookies: []
741741
image:
742742
repository: renku/renku-ui-server
743-
tag: "4.21.0"
743+
tag: "4.22.0"
744744
pullPolicy: IfNotPresent
745745
imagePullSecrets: []
746746
nameOverride: ""
@@ -822,7 +822,8 @@ dlf-chart:
822822
enabled: false
823823
dataset-operator-chart:
824824
enabled: true
825-
csi-rclone: {}
825+
csi-rclone:
826+
{}
826827
# This section is only relevant if you are installing csi-rclone as part of Renku
827828
## Name of the csi storage class to use for RClone/Cloudstorage. Should be unique per cluster.
828829
# storageClassName: csi-rclone
@@ -1244,7 +1245,8 @@ dataService:
12441245
## The name of the BuildStrategy to use for image builds.
12451246
strategyName: renku-buildpacks-v3
12461247
## Configuration overrides for specific target platforms
1247-
platformOverrides: {}
1248+
platformOverrides:
1249+
{}
12481250
# linux/arm64:
12491251
# builderImage: "ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/cuda-selector:0.5.1"
12501252
# runImage: "ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/cuda-run-image:0.5.1"

0 commit comments

Comments
 (0)