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

Improve E2E tests #12366

Merged
merged 36 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d793bfa
Improve pod.spec test
richard-cox Oct 25, 2024
d5fec21
Improve another repo spec test
richard-cox Oct 25, 2024
552a3fc
vai test improvements
richard-cox Oct 25, 2024
1b108c3
Various fixes
richard-cox Oct 25, 2024
9cc6868
pagination change fixes
richard-cox Oct 25, 2024
ff99823
pagination change fixes + new settings
richard-cox Oct 25, 2024
113df34
Update settings-utils.ts
richard-cox Oct 26, 2024
634924f
Fixes
richard-cox Oct 30, 2024
a365ae9
create name fixes
richard-cox Oct 30, 2024
6b36b0e
improve namespace picker test
richard-cox Oct 30, 2024
5c406d6
Fix user response
richard-cox Oct 30, 2024
667d758
fixes
richard-cox Oct 31, 2024
6369319
fixes
richard-cox Oct 31, 2024
066979e
fixes
richard-cox Oct 31, 2024
f4db933
Make up for userpreference lag by waiting for desired value
richard-cox Oct 31, 2024
9aaaabb
Dont include junk revision in mock resources
richard-cox Oct 31, 2024
85df794
update burger menu, make it clear there's pinned and other cluster lists
richard-cox Oct 31, 2024
e2ba319
improve tableRowsPerPageAndNamespaceFilter
richard-cox Oct 31, 2024
44bbe58
fix project-namespace
richard-cox Oct 31, 2024
1b3581d
more fixes...
richard-cox Oct 31, 2024
baba55e
Revert "Dont include junk revision in mock resources"
richard-cox Nov 1, 2024
7bb4347
real revision fix
richard-cox Nov 1, 2024
62eacc3
lint fixes are commenting out skip
richard-cox Nov 1, 2024
f121f90
use common resource revision
richard-cox Nov 1, 2024
86759e1
safer userpref check
richard-cox Nov 1, 2024
f5beb84
fix standard user tests
richard-cox Nov 1, 2024
ad8fbf7
more linting
richard-cox Nov 1, 2024
2afda2a
because why not
richard-cox Nov 1, 2024
daf99d5
fixes/improvements
richard-cox Nov 1, 2024
0588ce6
Add retry to updateNamespaceFilter
richard-cox Nov 1, 2024
a9a79ca
improve CRD list check for count
richard-cox Nov 1, 2024
d0dbd45
after own review
richard-cox Nov 1, 2024
27f9f6b
tie in failure and retry to tableRowsPerPageAndNamespaceFilter
richard-cox Nov 1, 2024
2fe4957
handle events count less than 500...
richard-cox Nov 1, 2024
0f61462
Merge remote-tracking branch 'upstream/master' into flaky-test-pod-spec
richard-cox Nov 6, 2024
6a4c4ba
fix merge fail
richard-cox Nov 6, 2024
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
1 change: 1 addition & 0 deletions cypress/e2e/blueprints/blueprint.utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const CYPRESS_SAFE_RESOURCE_REVISION = 999999999;
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { CYPRESS_SAFE_RESOURCE_REVISION } from '../blueprint.utils';

export const createPayloadData = {
id: 'e2e-pod-security-admission-1705617529465',
type: 'management.cattle.io.podsecurityadmissionconfigurationtemplate',
Expand All @@ -12,7 +14,7 @@ export const createPayloadData = {
},
kind: 'PodSecurityAdmissionConfigurationTemplate',
metadata: {
fields: ['e2e-pod-security-admission-1705617529465', '18s'], name: 'e2e-pod-security-admission-1705617529465', resourceVersion: '831667'
fields: ['e2e-pod-security-admission-1705617529465', '18s'], name: 'e2e-pod-security-admission-1705617529465', resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION
},
description: 'e2e-pod-security-admission-1705617529465-description'
};
Expand All @@ -31,7 +33,7 @@ export const updatePayloadData = {
},
kind: 'PodSecurityAdmissionConfigurationTemplate',
metadata: {
fields: ['e2e-pod-security-admission-1705628550961', '7s'], name: 'e2e-pod-security-admission-1705628550961', resourceVersion: '938739'
fields: ['e2e-pod-security-admission-1705628550961', '7s'], name: 'e2e-pod-security-admission-1705628550961', resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION
},
description: 'e2e-pod-security-admission-1705628550961-description-edit'
};
12 changes: 7 additions & 5 deletions cypress/e2e/blueprints/explorer/cluster/events.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { CYPRESS_SAFE_RESOURCE_REVISION } from '../../blueprint.utils';

// GET /v1/events - return empty events data
const eventsGetEmptyEventsSet = {
type: 'collection',
links: { self: `${ Cypress.env('api') }/v1/events` },
createTypes: { event: `${ Cypress.env('api') }/v1/events` },
actions: {},
resourceType: 'event',
revision: Number.MAX_VALUE, // The UI will use this point in history to start watching for changes from. If it's too low (than the global system revision) we will spam with requests
revision: CYPRESS_SAFE_RESOURCE_REVISION, // The UI will use this point in history to start watching for changes from. If it's too low (than the global system revision) we will spam with requests
data: []
};

Expand All @@ -16,7 +18,7 @@ const eventsGetResponseSmallSet = {
createTypes: { event: `${ Cypress.env('api') }/v1/events` },
actions: {},
resourceType: 'event',
revision: Number.MAX_VALUE, // The UI will use this point in history to start watching for changes from. If it's too low (than the global system revision) we will spam with requests
revision: CYPRESS_SAFE_RESOURCE_REVISION, // The UI will use this point in history to start watching for changes from. If it's too low (than the global system revision) we will spam with requests
count: 3,
data: [
{
Expand All @@ -40,7 +42,7 @@ const eventsGetResponseSmallSet = {
name: 'fleet-agent-0.17d80b90a6d2c7ab',
namespace: 'cattle-fleet-local-system',
relationships: null,
resourceVersion: '0',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down Expand Up @@ -71,7 +73,7 @@ const eventsGetResponseSmallSet = {
name: 'fleet-agent-0.17d80b90a6d2c7ab',
namespace: 'cattle-fleet-local-system',
relationships: null,
resourceVersion: '0',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down Expand Up @@ -102,7 +104,7 @@ const eventsGetResponseSmallSet = {
name: 'fleet-agent-0.17d80b90a6d2c7ab',
namespace: 'cattle-fleet-local-system',
relationships: null,
resourceVersion: '0',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down
12 changes: 7 additions & 5 deletions cypress/e2e/blueprints/explorer/core/service-accounts-get.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { CYPRESS_SAFE_RESOURCE_REVISION } from '../../blueprint.utils';

// GET /v1/serviceaccounts - return empty service accounts data
const serviceAccGetResponseEmpty = {
type: 'collection',
links: { self: 'https://yonasb29.qa.rancher.space/v1/serviceaccounts' },
createTypes: { serviceaccount: 'https://yonasb29.qa.rancher.space/v1/serviceaccounts' },
actions: {},
resourceType: 'serviceaccount',
revision: '129651',
revision: CYPRESS_SAFE_RESOURCE_REVISION,
count: 0,
data: []
};
Expand All @@ -17,7 +19,7 @@ const serviceAcctResponseSmallSet = {
createTypes: { serviceaccount: 'https://yonasb29.qa.rancher.space/v1/serviceaccounts' },
actions: {},
resourceType: 'serviceaccount',
revision: '129651',
revision: CYPRESS_SAFE_RESOURCE_REVISION,
count: 3,
data: [
{
Expand Down Expand Up @@ -55,7 +57,7 @@ const serviceAcctResponseSmallSet = {
state: 'succeeded'
}
],
resourceVersion: '7124',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down Expand Up @@ -104,7 +106,7 @@ const serviceAcctResponseSmallSet = {
state: 'deployed'
}
],
resourceVersion: '9344',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down Expand Up @@ -165,7 +167,7 @@ const serviceAcctResponseSmallSet = {
state: 'deployed'
}
],
resourceVersion: '9342',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down
10 changes: 6 additions & 4 deletions cypress/e2e/blueprints/explorer/fleet/contents-get.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { CYPRESS_SAFE_RESOURCE_REVISION } from '../../blueprint.utils';

// GET /v1/fleet.cattle.io.contents - return empty contents data
const fleetContentsGetResponseEmpty = {
type: 'collection',
links: { self: 'https://yonasb29head.qa.rancher.space/v1/fleet.cattle.io.contents' },
createTypes: { 'fleet.cattle.io.content': 'https://yonasb29head.qa.rancher.space/v1/fleet.cattle.io.contents' },
actions: {},
resourceType: 'fleet.cattle.io.content',
revision: '123',
revision: CYPRESS_SAFE_RESOURCE_REVISION,
count: 0,
data: []
};
Expand All @@ -17,7 +19,7 @@ const fleetContentsResponseSmallSet = {
createTypes: { 'fleet.cattle.io.content': 'https://yonasb29head.qa.rancher.space/v1/fleet.cattle.io.contents' },
actions: {},
resourceType: 'fleet.cattle.io.content',
revision: '123',
revision: CYPRESS_SAFE_RESOURCE_REVISION,
count: 2,
data: [
{
Expand All @@ -41,7 +43,7 @@ const fleetContentsResponseSmallSet = {
generation: 1,
name: 's-65075fe21d0e5087693027a2fdbb5ed559295ed1ffeb5957f98d77decb4a5',
relationships: null,
resourceVersion: '4380255',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down Expand Up @@ -73,7 +75,7 @@ const fleetContentsResponseSmallSet = {
generation: 1,
name: 's-807cc7bcb0de2dae39c913c375f676238d021519258d34913ccc842519c63',
relationships: null,
resourceVersion: '8041',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { CYPRESS_SAFE_RESOURCE_REVISION } from '../../../blueprint.utils';

// GET /v1/apiextensions.k8s.io.customresourcedefinitions - small set of crds data
const crdsGetResponseSmallSet = {
type: 'collection',
links: { self: 'https://yonasb29head.qa.rancher.space/v1/apiextensions.k8s.io.customresourcedefinitions' },
createTypes: { 'apiextensions.k8s.io.customresourcedefinition': 'https://yonasb29head.qa.rancher.space/v1/apiextensions.k8s.io.customresourcedefinitions' },
actions: {},
resourceType: 'apiextensions.k8s.io.customresourcedefinition',
revision: Number.MAX_VALUE, // The UI will use this point in history to start watching for changes from. If it's too low (than the global system revision) we will spam with requests
revision: CYPRESS_SAFE_RESOURCE_REVISION, // The UI will use this point in history to start watching for changes from. If it's too low (than the global system revision) we will spam with requests
count: 2,
data: [
{
Expand All @@ -28,7 +30,7 @@ const crdsGetResponseSmallSet = {
generation: 1,
name: 'users.management.cattle.io',
relationships: null,
resourceVersion: '4473',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'CRD is established',
Expand Down Expand Up @@ -129,7 +131,7 @@ const crdsGetResponseSmallSet = {
state: 'deployed'
}
],
resourceVersion: '1417',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'CRD is established',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { CYPRESS_SAFE_RESOURCE_REVISION } from '../../blueprint.utils';

// GET /v1/rbac.authorization.k8s.io.clusterrolebinding - return empty cluster role binding data
const clusterRoleBindingGetResponseEmpty = {
type: 'collection',
links: { self: 'https://yonasb29head.qa.rancher.space/v1/rbac.authorization.k8s.io.clusterrolebindings' },
createTypes: { 'rbac.authorization.k8s.io.clusterrolebinding': 'https://yonasb29head.qa.rancher.space/v1/rbac.authorization.k8s.io.clusterrolebindings' },
actions: {},
resourceType: 'rbac.authorization.k8s.io.clusterrolebinding',
revision: '123',
revision: CYPRESS_SAFE_RESOURCE_REVISION,
count: 0,
data: []
};
Expand All @@ -17,7 +19,7 @@ const clusterRoleBindingResponseSmallSet = {
createTypes: { 'rbac.authorization.k8s.io.clusterrolebinding': 'https://yonasb29head.qa.rancher.space/v1/rbac.authorization.k8s.io.clusterrolebindings' },
actions: {},
resourceType: 'rbac.authorization.k8s.io.clusterrolebinding',
revision: '123',
revision: CYPRESS_SAFE_RESOURCE_REVISION,
count: 2,
data: [
{
Expand Down Expand Up @@ -58,7 +60,7 @@ const clusterRoleBindingResponseSmallSet = {
state: 'deployed'
}
],
resourceVersion: '434584',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down Expand Up @@ -118,7 +120,7 @@ const clusterRoleBindingResponseSmallSet = {
state: 'deployed'
}
],
resourceVersion: '5149',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down
10 changes: 6 additions & 4 deletions cypress/e2e/blueprints/explorer/rbac/cluster-roles-get.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { CYPRESS_SAFE_RESOURCE_REVISION } from '../../blueprint.utils';

// GET /v1/rbac.authorization.k8s.io.clusterrolebinding - return empty cluster roles data
const clusterRolesGetResponseEmpty = {
type: 'collection',
links: { self: 'https://yonasb29h3.qa.rancher.space/v1/rbac.authorization.k8s.io.clusterroles' },
createTypes: { 'rbac.authorization.k8s.io.clusterrole': 'https://yonasb29h3.qa.rancher.space/v1/rbac.authorization.k8s.io.clusterroles' },
actions: {},
resourceType: 'rbac.authorization.k8s.io.clusterrole',
revision: '123',
revision: CYPRESS_SAFE_RESOURCE_REVISION,
count: 0,
data: []
};
Expand All @@ -17,7 +19,7 @@ const clusterRolesResponseSmallSet = {
createTypes: { 'rbac.authorization.k8s.io.clusterrole': 'https://yonasb29h3.qa.rancher.space/v1/rbac.authorization.k8s.io.clusterroles' },
actions: {},
resourceType: 'rbac.authorization.k8s.io.clusterrole',
revision: '123',
revision: CYPRESS_SAFE_RESOURCE_REVISION,
count: 2,
data: [
{
Expand Down Expand Up @@ -49,7 +51,7 @@ const clusterRolesResponseSmallSet = {
labels: { 'kubernetes.io/bootstrapping': 'rbac-defaults' },
name: 'admin',
relationships: null,
resourceVersion: '4878',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down Expand Up @@ -94,7 +96,7 @@ const clusterRolesResponseSmallSet = {
state: 'deployed'
}
],
resourceVersion: '4838',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down
12 changes: 7 additions & 5 deletions cypress/e2e/blueprints/explorer/rbac/role-bindings-get.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { CYPRESS_SAFE_RESOURCE_REVISION } from '../../blueprint.utils';

// GET /v1/rbac.authorization.k8s.io.rolebindings- return empty role binding data
const roleBindingGetResponseEmpty = {
type: 'collection',
links: { self: 'https://yonasb29head.qa.rancher.space/v1/rbac.authorization.k8s.io.rolebindings' },
createTypes: { 'rbac.authorization.k8s.io.rolebinding': 'https://yonasb29head.qa.rancher.space/v1/rbac.authorization.k8s.io.rolebindings' },
actions: {},
resourceType: 'rbac.authorization.k8s.io.rolebinding',
revision: '123',
revision: CYPRESS_SAFE_RESOURCE_REVISION,
count: 0,
data: []
};
Expand All @@ -17,7 +19,7 @@ const roleBindingResponseSmallSet = {
createTypes: { 'rbac.authorization.k8s.io.rolebinding': 'https://yonasb29head.qa.rancher.space/v1/rbac.authorization.k8s.io.rolebindings' },
actions: {},
resourceType: 'rbac.authorization.k8s.io.rolebinding',
revision: '123',
revision: CYPRESS_SAFE_RESOURCE_REVISION,
count: 3,
data: [
{
Expand Down Expand Up @@ -66,7 +68,7 @@ const roleBindingResponseSmallSet = {
message: 'Resource is current'
}
],
resourceVersion: '445143',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down Expand Up @@ -134,7 +136,7 @@ const roleBindingResponseSmallSet = {
message: 'Resource is current'
}
],
resourceVersion: '4386433',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down Expand Up @@ -203,7 +205,7 @@ const roleBindingResponseSmallSet = {
state: 'deployed'
}
],
resourceVersion: '5141',
resourceVersion: CYPRESS_SAFE_RESOURCE_REVISION,
state: {
error: false,
message: 'Resource is current',
Expand Down
Loading
Loading