Skip to content

Commit a57ea25

Browse files
Merge branch 'master' into lorenzo/data-connector-modal
2 parents 9f2075b + 5163a0f commit a57ea25

7 files changed

Lines changed: 133 additions & 65 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ describe("Anonymous users can only access public resources", () => {
9797
cy.getDataCy("search-query-input").clear().type(randomString);
9898
cy.getDataCy("search-query-button").click();
9999
cy.wait("@searchQuery");
100-
cy.getDataCy("search-list-item")
101-
.should("have.length", 2);
102-
cy.getDataCy("search-list-item")
103-
.should("contain.text", randomString);
100+
cy.getDataCy("search-list-item").should("have.length", 2);
101+
cy.getDataCy("search-list-item").should("contain.text", randomString);
104102

105103
// Log out and search for the projects as an anonymous user
106104
cy.session(anonymousSession.id, anonymousSession.setup);
@@ -112,7 +110,9 @@ describe("Anonymous users can only access public resources", () => {
112110
cy.getDataCy("search-query-input").clear().type(randomString);
113111
cy.getDataCy("search-query-button").click();
114112
cy.wait("@searchQuery");
115-
cy.getDataCy("search-list-item").should("have.length", 1).contains(randomString);
113+
cy.getDataCy("search-list-item")
114+
.should("have.length", 1)
115+
.contains(randomString);
116116
cy.getDataCy("search-list-item").click();
117117
cy.getDataCy("project-name").should("contain", publicProjectName);
118118
cy.getDataCy("project-settings-link").click();

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

Lines changed: 81 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,68 +6,119 @@ import {
66
} from "../../support/utils/projects";
77
import { login } from "../../support/utils/general";
88
import { User } from "../../support/types/user";
9+
import { validateLoginV2 } from "../../support/commands/general";
10+
import type { Project } from "../../support/types/projects";
911

1012
const projectTestConfig = {
1113
projectAlreadyExists: false,
12-
projectName: generatorProjectName("dashboardV2"),
14+
projectName: `project-dashboard-test-${getRandomString()}`,
1315
};
1416

15-
const prefixProjectTitle = "My Renku Project";
16-
const sessionId = ["dashboard", getRandomString()];
17+
const anonymousSession = {
18+
id: ["dashboard-anonymousUser", getRandomString()],
19+
setup: () => {
20+
cy.log("Anonymous session");
21+
},
22+
};
23+
const loggedSession = {
24+
id: ["dashboard-loggedUser", getRandomString()],
25+
setup: () => {
26+
cy.log("Logged in session");
27+
cy.robustLogin("v2");
28+
},
29+
};
1730

1831
describe("Dashboard v2 - Authenticated user", () => {
19-
const projectSlug = projectTestConfig.projectName;
20-
let projectId: string | null = null;
21-
22-
after(() => {
23-
if (!projectTestConfig.projectAlreadyExists) {
24-
deleteProject(projectId);
25-
}
26-
});
32+
let projectId: string = "";
2733

28-
beforeEach(() => {
29-
login(sessionId);
34+
before(() => {
35+
cy.session(loggedSession.id, loggedSession.setup, validateLoginV2);
3036

3137
getUserData().then((user: User) => {
3238
createProjectIfMissingV2({
33-
description: "Test project for dashboard tests",
34-
name: `${prefixProjectTitle} ${projectSlug}`,
39+
name: projectTestConfig.projectName,
3540
namespace: user.username,
36-
slug: projectSlug,
41+
slug: projectTestConfig.projectName,
42+
description: "Test project for dashboard tests",
3743
visibility: "private",
3844
}).then((response) => {
3945
projectId = response.body.id;
4046
});
4147
});
4248
});
4349

44-
it("Can see own project on the dashboard", () => {
50+
after(() => {
51+
if (!projectTestConfig.projectAlreadyExists) {
52+
deleteProject(projectId);
53+
}
54+
});
55+
56+
beforeEach(() => {
57+
cy.session(loggedSession.id, loggedSession.setup, validateLoginV2);
58+
});
59+
60+
it("Can see own project on the dashboard or in the search results", () => {
61+
let projectIsOnDashboard: boolean = false;
62+
cy.intercept("/api/data/projects?direct_member=true*", (request) => {
63+
request.on("after:response", (response) => {
64+
expect(response.statusCode).to.eq(200);
65+
const projects = response.body as Project[];
66+
projectIsOnDashboard = projects.some(({ id }) => id === projectId);
67+
});
68+
}).as("projectList");
69+
4570
cy.visit("/");
46-
cy.getDataCy("dashboard-project-list")
47-
.find("a")
48-
.should("have.length.at.least", 1);
49-
cy.getDataCy("dashboard-project-list")
50-
.find("a")
51-
.should("contain.text", `${prefixProjectTitle} ${projectSlug}`);
52-
cy.getDataCy("dashboard-project-list")
53-
.find("a")
54-
.should("contain.text", projectSlug);
71+
72+
cy.wait("@projectList").then(() => {
73+
cy.getDataCy("dashboard-project-list")
74+
.find("a")
75+
.should("have.length.at.least", 1);
76+
77+
if (projectIsOnDashboard) {
78+
cy.getDataCy("dashboard-project-list")
79+
.find("a")
80+
.should("contain.text", projectTestConfig.projectName);
81+
cy.getDataCy("dashboard-project-list")
82+
.find("a")
83+
.should("contain.text", projectTestConfig.projectName);
84+
} else {
85+
cy.getDataCy("view-my-Projects-btn")
86+
.contains(new RegExp("View all my [0-9]+ projects"))
87+
.click();
88+
cy.getDataCy("search-list-item").should("have.length.at.least", 1);
89+
cy.getDataCy("search-query-input")
90+
.clear()
91+
.type(projectTestConfig.projectName);
92+
cy.getDataCy("search-query-button").click();
93+
cy.getDataCy("search-list-item")
94+
.contains(projectTestConfig.projectName)
95+
.should("be.visible");
96+
}
97+
});
5598
});
5699

57100
it("Can find project in the search results", () => {
58101
cy.visit("/");
59102
cy.getDataCy("view-my-Projects-btn").click();
60103
cy.getDataCy("search-list-item").should("have.length.at.least", 1);
61-
cy.getDataCy("search-list-item").should(
62-
"contain.text",
63-
`${prefixProjectTitle} ${projectSlug}`,
64-
);
104+
cy.getDataCy("search-query-input")
105+
.clear()
106+
.type(projectTestConfig.projectName);
107+
cy.getDataCy("search-query-button").click();
108+
cy.getDataCy("search-list-item")
109+
.contains(projectTestConfig.projectName)
110+
.should("be.visible");
65111
});
66112
});
67113

68114
describe("Dashboard v2 - Non-Authenticated user", () => {
115+
beforeEach(() => {
116+
cy.session(anonymousSession.id, anonymousSession.setup);
117+
});
118+
69119
it("Cannot see projects and groups on Dashboard when logged out", () => {
70120
cy.visit("/");
121+
cy.get("#rk-anon-home-frame").should("be.visible");
71122
cy.getDataCy("user-container").should("not.exist");
72123
});
73124
});

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

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,25 @@ describe("Groups", () => {
216216
cy.getDataCy("group-search-link").click();
217217
cy.wait("@searchQuery", { timeout: TIMEOUTS.long });
218218

219-
cy.getDataCy("search-filter-type-Project").filter(":visible").should("be.checked");
219+
cy.getDataCy("search-filter-type-Project")
220+
.filter(":visible")
221+
.should("be.checked");
220222
// Verify the project is visible
221223
cy.contains(projectName).should("be.visible");
222-
cy.getDataCy("search-filter-type-DataConnector").filter(":visible").last().click();
224+
cy.getDataCy("search-filter-type-DataConnector")
225+
.filter(":visible")
226+
.last()
227+
.click();
223228
cy.wait("@searchQuery");
224229
cy.getDataCy("search-filter-type-DataConnector").should("be.checked");
225230

226-
227-
cy.getDataCy("search-filter-type-DataConnector").filter(":visible").last().click();
231+
cy.getDataCy("search-filter-type-DataConnector")
232+
.filter(":visible")
233+
.last()
234+
.click();
228235
cy.wait("@searchQuery");
229236
cy.getDataCy("search-filter-type-DataConnector").should("be.checked");
230237

231-
232238
// Verify data connectors are visible
233239
cy.contains(dataConnectorName).should("be.visible");
234240
cy.contains(projectDataConnectorName).should("be.visible");
@@ -274,16 +280,23 @@ describe("Groups", () => {
274280
cy.getDataCy("group-search-link").click();
275281
cy.wait("@searchQuery", { timeout: TIMEOUTS.long });
276282

277-
278-
cy.getDataCy("search-filter-type-Project").filter(":visible").should("be.checked");
283+
cy.getDataCy("search-filter-type-Project")
284+
.filter(":visible")
285+
.should("be.checked");
279286
// Verify the project no longer appears in group search
280287
cy.contains(projectName).should("not.exist");
281288

282-
cy.getDataCy("search-filter-type-DataConnector").filter(":visible").last().click();
289+
cy.getDataCy("search-filter-type-DataConnector")
290+
.filter(":visible")
291+
.last()
292+
.click();
283293
cy.wait("@searchQuery", { timeout: TIMEOUTS.long });
284294
cy.getDataCy("search-filter-type-DataConnector").should("be.checked");
285295

286-
cy.getDataCy("search-filter-type-DataConnector").filter(":visible").last().click();
296+
cy.getDataCy("search-filter-type-DataConnector")
297+
.filter(":visible")
298+
.last()
299+
.click();
287300

288301
// Verify the project's data connectors no longer appears in group search
289302
cy.contains(dataConnectorName).should("be.visible");

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,13 @@ describe("Search for resources: groups, projects, users", () => {
9797
cy.getDataCy("search-query-input").clear().type(stringRandomOne);
9898
cy.getDataCy("search-query-button").click();
9999
cy.wait("@searchQuery");
100-
cy.getDataCy("search-list-item")
101-
.should("have.length", 1);
102-
cy.getDataCy("search-list-item")
103-
.should("contain.text", stringRandomOne);
100+
cy.getDataCy("search-list-item").should("have.length", 1);
101+
cy.getDataCy("search-list-item").should("contain.text", stringRandomOne);
104102
cy.getDataCy("search-query-input").clear().type(stringRandomTwo);
105103
cy.getDataCy("search-query-button").click();
106104
cy.wait("@searchQuery");
107-
cy.getDataCy("search-list-item")
108-
.should("have.length", 1);
109-
cy.getDataCy("search-list-item")
110-
.should("contain.text", stringRandomTwo);
105+
cy.getDataCy("search-list-item").should("have.length", 1);
106+
cy.getDataCy("search-list-item").should("contain.text", stringRandomTwo);
111107

112108
// Filter for projects and groups
113109
cy.getDataCy("search-filter-type-Group").filter(":visible").click();
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
export interface Project {
2-
id?: string;
1+
export type ProjectVisibility = "public" | "private";
2+
3+
export interface ProjectPost {
34
name: string;
45
namespace: string;
56
slug: string;
67
description?: string;
7-
visibility?: "public" | "private";
8+
visibility?: ProjectVisibility;
9+
}
10+
11+
export interface Project {
12+
id: string;
13+
name: string;
14+
namespace: string;
15+
slug: string;
816
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Project } from "../types/projects";
1+
import type { Project, ProjectPost } from "../types/projects";
22

33
export function getProjectByNamespaceSlug(
44
namespace: string,
@@ -12,7 +12,7 @@ export function getProjectByNamespaceSlug(
1212
}
1313

1414
export function createProjectIfMissingV2(
15-
project: Project,
15+
project: ProjectPost,
1616
): Cypress.Chainable<Cypress.Response<Project>> {
1717
return getProjectByNamespaceSlug(project.namespace, project.slug).then(
1818
(response) => {

helm-chart/renku/values.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,12 +1183,12 @@ dataService:
11831183
existingPriorityClass: ""
11841184
image:
11851185
repository: renku/renku-data-service
1186-
tag: "0.72.1"
1186+
tag: "0.72.2"
11871187
pullPolicy: IfNotPresent
11881188
k8sWatcher:
11891189
image:
11901190
repository: renku/data-service-k8s-watcher
1191-
tag: "0.72.1"
1191+
tag: "0.72.2"
11921192
pullPolicy: IfNotPresent
11931193
resources: {}
11941194
sentry:
@@ -1199,7 +1199,7 @@ dataService:
11991199
dataTasks:
12001200
image:
12011201
repository: renku/data-service-data-tasks
1202-
tag: "0.72.1"
1202+
tag: "0.72.2"
12031203
pullPolicy: IfNotPresent
12041204
resources: {}
12051205
enableResourceRequestTracking: false
@@ -1239,17 +1239,17 @@ dataService:
12391239
## The container image prefix for images built from code
12401240
outputImagePrefix: harbor.dev.renku.ch/renku-build/
12411241
## The builder image (see https://buildpacks.io/docs/for-platform-operators/concepts/builder/)
1242-
builderImage: "ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/selector:0.5.0"
1242+
builderImage: "ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/selector:0.5.1"
12431243
## The run image (see https://buildpacks.io/docs/for-platform-operators/concepts/base-images/)
1244-
runImage: "ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/run-image:0.5.0"
1244+
runImage: "ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/run-image:0.5.1"
12451245
## The name of the BuildStrategy to use for image builds.
12461246
strategyName: renku-buildpacks-v3
12471247
## Configuration overrides for specific target platforms
12481248
platformOverrides:
12491249
{}
12501250
# linux/arm64:
1251-
# builderImage: "ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/cuda-selector:0.5.0"
1252-
# runImage: "ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/cuda-run-image:0.5.0"
1251+
# builderImage: "ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/cuda-selector:0.5.1"
1252+
# runImage: "ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/cuda-run-image:0.5.1"
12531253
# strategyName: renku-buildpacks-v3
12541254
# nodeSelector:
12551255
# kubernetes.io/arch: arm64
@@ -1330,7 +1330,7 @@ authz:
13301330
secretsStorage:
13311331
image:
13321332
repository: renku/secrets-storage
1333-
tag: "0.72.1"
1333+
tag: "0.72.2"
13341334
pullPolicy: IfNotPresent
13351335
service:
13361336
type: ClusterIP

0 commit comments

Comments
 (0)