Skip to content

Commit d7e0175

Browse files
Merge pull request #13480 from rhamilto/OCPBUGS-26041
OCPBUGS-25780: add integration test to check that Update cluster moda…
2 parents 39749c2 + f598ce3 commit d7e0175

2 files changed

Lines changed: 259 additions & 0 deletions

File tree

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
export const clusterVersionWithUpdate = {
2+
apiVersion: 'config.openshift.io/v1',
3+
kind: 'ClusterVersion',
4+
metadata: {
5+
creationTimestamp: '2024-01-04T05:14:57Z',
6+
generation: 4,
7+
managedFields: [
8+
{
9+
apiVersion: 'config.openshift.io/v1',
10+
fieldsType: 'FieldsV1',
11+
fieldsV1: {
12+
'f:spec': {
13+
'.': {},
14+
'f:clusterID': {},
15+
},
16+
},
17+
manager: 'cluster-bootstrap',
18+
operation: 'Update',
19+
time: '2024-01-04T05:14:57Z',
20+
},
21+
{
22+
apiVersion: 'config.openshift.io/v1',
23+
fieldsType: 'FieldsV1',
24+
fieldsV1: {
25+
'f:spec': {
26+
'f:upstream': {},
27+
},
28+
},
29+
manager: 'oc',
30+
operation: 'Update',
31+
time: '2024-01-04T05:37:09Z',
32+
},
33+
{
34+
apiVersion: 'config.openshift.io/v1',
35+
fieldsType: 'FieldsV1',
36+
fieldsV1: {
37+
'f:spec': {
38+
'f:channel': {},
39+
},
40+
},
41+
manager: 'Mozilla',
42+
operation: 'Update',
43+
time: '2024-01-04T13:58:00Z',
44+
},
45+
{
46+
apiVersion: 'config.openshift.io/v1',
47+
fieldsType: 'FieldsV1',
48+
fieldsV1: {
49+
'f:status': {
50+
'.': {},
51+
'f:availableUpdates': {},
52+
'f:capabilities': {
53+
'.': {},
54+
'f:enabledCapabilities': {},
55+
'f:knownCapabilities': {},
56+
},
57+
'f:conditions': {
58+
'.': {},
59+
'k:{"type":"Available"}': {
60+
'.': {},
61+
'f:lastTransitionTime': {},
62+
'f:message': {},
63+
'f:status': {},
64+
'f:type': {},
65+
},
66+
'k:{"type":"Failing"}': {
67+
'.': {},
68+
'f:lastTransitionTime': {},
69+
'f:status': {},
70+
'f:type': {},
71+
},
72+
'k:{"type":"ImplicitlyEnabledCapabilities"}': {
73+
'.': {},
74+
'f:lastTransitionTime': {},
75+
'f:message': {},
76+
'f:reason': {},
77+
'f:status': {},
78+
'f:type': {},
79+
},
80+
'k:{"type":"Progressing"}': {
81+
'.': {},
82+
'f:lastTransitionTime': {},
83+
'f:message': {},
84+
'f:status': {},
85+
'f:type': {},
86+
},
87+
'k:{"type":"ReleaseAccepted"}': {
88+
'.': {},
89+
'f:lastTransitionTime': {},
90+
'f:message': {},
91+
'f:reason': {},
92+
'f:status': {},
93+
'f:type': {},
94+
},
95+
'k:{"type":"RetrievedUpdates"}': {
96+
'.': {},
97+
'f:lastTransitionTime': {},
98+
'f:status': {},
99+
'f:type': {},
100+
},
101+
'k:{"type":"Upgradeable"}': {
102+
'.': {},
103+
'f:lastTransitionTime': {},
104+
'f:message': {},
105+
'f:reason': {},
106+
'f:status': {},
107+
'f:type': {},
108+
},
109+
},
110+
'f:desired': {
111+
'.': {},
112+
'f:image': {},
113+
'f:version': {},
114+
},
115+
'f:history': {},
116+
'f:observedGeneration': {},
117+
'f:versionHash': {},
118+
},
119+
},
120+
manager: 'cluster-version-operator',
121+
operation: 'Update',
122+
subresource: 'status',
123+
time: '2024-01-04T13:58:01Z',
124+
},
125+
],
126+
name: 'version',
127+
resourceVersion: '370626',
128+
uid: '40b1ad1b-13d2-4c7c-932a-ce78c4447ed8',
129+
},
130+
spec: {
131+
channel: 'stable-4.16',
132+
clusterID: '4976480a-15e1-4c94-bafe-aafb96bc0248',
133+
upstream: 'https://openshift-release.apps.ci.l2s4.p1.openshiftapps.com/graph',
134+
},
135+
status: {
136+
availableUpdates: [
137+
{
138+
image:
139+
'registry.ci.openshift.org/ocp/release@sha256:f31d5b0e23c8f978b57f5ef74c8811e7f87103187aa1895880f67eac4eb76f6d',
140+
version: '4.16.0-0.nightly-2024-01-04-011543',
141+
},
142+
],
143+
capabilities: {
144+
enabledCapabilities: [
145+
'Build',
146+
'CSISnapshot',
147+
'CloudCredential',
148+
'Console',
149+
'DeploymentConfig',
150+
'ImageRegistry',
151+
'Insights',
152+
'MachineAPI',
153+
'NodeTuning',
154+
'OperatorLifecycleManager',
155+
'Storage',
156+
'baremetal',
157+
'marketplace',
158+
'openshift-samples',
159+
],
160+
knownCapabilities: [
161+
'Build',
162+
'CSISnapshot',
163+
'CloudCredential',
164+
'Console',
165+
'DeploymentConfig',
166+
'ImageRegistry',
167+
'Insights',
168+
'MachineAPI',
169+
'NodeTuning',
170+
'OperatorLifecycleManager',
171+
'Storage',
172+
'baremetal',
173+
'marketplace',
174+
'openshift-samples',
175+
],
176+
},
177+
conditions: [
178+
{
179+
lastTransitionTime: '2024-01-04T05:37:10Z',
180+
status: 'True',
181+
type: 'RetrievedUpdates',
182+
},
183+
{
184+
lastTransitionTime: '2024-01-04T05:15:00Z',
185+
message: 'Capabilities match configured spec',
186+
reason: 'AsExpected',
187+
status: 'False',
188+
type: 'ImplicitlyEnabledCapabilities',
189+
},
190+
{
191+
lastTransitionTime: '2024-01-04T05:15:00Z',
192+
message:
193+
'Payload loaded version="4.16.0-0.nightly-2024-01-03-193825" image="registry.ci.openshift.org/ocp/release@sha256:ff486203f5b065836105fcd56f29467229bfc6258e5d8ba7f479ac575d81c721" architecture="amd64"',
194+
reason: 'PayloadLoaded',
195+
status: 'True',
196+
type: 'ReleaseAccepted',
197+
},
198+
{
199+
lastTransitionTime: '2024-01-04T05:35:14Z',
200+
message: 'Done applying 4.16.0-0.nightly-2024-01-03-193825',
201+
status: 'True',
202+
type: 'Available',
203+
},
204+
{
205+
lastTransitionTime: '2024-01-04T05:35:14Z',
206+
status: 'False',
207+
type: 'Failing',
208+
},
209+
{
210+
lastTransitionTime: '2024-01-04T05:35:14Z',
211+
message: 'Cluster version is 4.16.0-0.nightly-2024-01-03-193825',
212+
status: 'False',
213+
type: 'Progressing',
214+
},
215+
{
216+
lastTransitionTime: '2024-01-04T05:45:29Z',
217+
message:
218+
'Cluster operator operator-lifecycle-manager should not be upgraded between minor versions: ClusterServiceVersions blocking cluster upgrade: openshift-operators/openshift-pipelines-operator-rh.v1.12.2 is incompatible with OpenShift minor versions greater than 4.14',
219+
reason: 'IncompatibleOperatorsInstalled',
220+
status: 'False',
221+
type: 'Upgradeable',
222+
},
223+
],
224+
desired: {
225+
image:
226+
'registry.ci.openshift.org/ocp/release@sha256:ff486203f5b065836105fcd56f29467229bfc6258e5d8ba7f479ac575d81c721',
227+
version: '4.16.0-0.nightly-2024-01-03-193825',
228+
},
229+
history: [
230+
{
231+
completionTime: '2024-01-04T05:35:14Z',
232+
image:
233+
'registry.ci.openshift.org/ocp/release@sha256:ff486203f5b065836105fcd56f29467229bfc6258e5d8ba7f479ac575d81c721',
234+
startedTime: '2024-01-04T05:15:00Z',
235+
state: 'Completed',
236+
verified: false,
237+
version: '4.16.0-0.nightly-2024-01-03-193825',
238+
},
239+
],
240+
observedGeneration: 3,
241+
versionHash: 'rqBs61ZyVwQ=',
242+
},
243+
};

frontend/packages/integration-tests-cypress/tests/cluster-settings/cluster-settings.cy.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import { clusterVersionWithUpdate } from '../../mocks/cluster-version';
12
import { checkErrors } from '../../support';
23
import { detailsPage } from '../../views/details-page';
34

5+
const CLUSTER_VERSION_ALIAS = 'clusterVersion';
6+
47
describe('Cluster Settings', () => {
58
before(() => {
69
cy.login();
@@ -28,6 +31,19 @@ describe('Cluster Settings', () => {
2831
it('displays channel update modal and closes it', () => {
2932
detailsPage.selectTab('Details');
3033
cy.byLegacyTestID('current-channel-update-link').should('be.visible').click();
34+
cy.byLegacyTestID('modal-title').should('contain.text', 'channel');
35+
cy.byLegacyTestID('modal-cancel-action').should('be.visible').click();
36+
});
37+
38+
it('displays cluster update modal and closes it', () => {
39+
detailsPage.selectTab('Details');
40+
cy.intercept(
41+
'/api/kubernetes/apis/config.openshift.io/v1/clusterversions/version',
42+
clusterVersionWithUpdate,
43+
).as(CLUSTER_VERSION_ALIAS);
44+
cy.wait(`@${CLUSTER_VERSION_ALIAS}`, { requestTimeout: 300000 });
45+
cy.byLegacyTestID('cv-update-button').should('be.visible').click();
46+
cy.byLegacyTestID('modal-title').should('contain.text', 'Update cluster');
3147
cy.byLegacyTestID('modal-cancel-action').should('be.visible').click();
3248
});
3349

0 commit comments

Comments
 (0)