-
Notifications
You must be signed in to change notification settings - Fork 667
Bug 1883766: Adjust tests due to UI changes #6850
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
Bug 1883766: Adjust tests due to UI changes #6850
Conversation
|
@irosenzw: This pull request references Bugzilla bug 1883766, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
555ec87 to
e18a806
Compare
atiratree
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@irosenzw can we also include wizard tests in kubevirt-gating suite once we fix them here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please create a PR for moving object-enum to console/shared? So we don't have to depend on the kubevirt code base here?
Or I can do the PR - up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove alltogether
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can compare just the provisionSource here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source can be included in the ProvisionSource object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also change provisionSourceInputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is wrong with provisionSourceInputs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the keys are a string and should rather refer to the enum. Anyway it fails currently since the method is a description and not the right constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not create a VM from a template. Please consider template use cases properly.
e18a806 to
4cbe929
Compare
4cbe929 to
84e6423
Compare
|
/retest |
84e6423 to
461585a
Compare
461585a to
1fdb93e
Compare
|
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use the enum also in provisionSourceInputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how would you suggest to use it? I used the values as keys. how else would you do it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ ProvisionSource.Container.getValue()] like this? Or you can move the inputs to the provisionSource enum but please beware circular deps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you compare the value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, can compare just the objects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using ObjectEnum.getAllClassEnumProperties makes this easier. Please see other object enums
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I don't use it. I'll just remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we compare just the provision sources? Also the value will never equal to description right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need the whole template every time we want to create a VM from it. Can we utilize the create method to open the wizard (either from template or plain wizard) and process all the steps?
The create processes additional attributes like startOnCreate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there would be also a less need to create an instance of the wizard every time
82eb10a to
823237c
Compare
|
Test in |
It should work in this way though I believe there is no need |
That's OK it is a small change among many I made in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's also use the same logic for navigating to Virtualization section as openWizard does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectTemplate and templateSelect should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is isEqual necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to navigateToListView if you change the openWizard logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two if (provisionSource) { now, better to remove the first one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provisionSource === ProvisionSource.DISK this never return true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please debug what is the value of provisionSource then? Maybe we are passing and setting just a simple "DISK" string or something wrong elsewhere. Or maybe the bootable prop is set to false in your case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of them looks exactly the same, but it should not be the same object, so it never be true.
I tried to use provisionSource.value and ProvisionSource.DISK.value but it will have other issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of them returns
ProvisionSource {
getValue: [Function],
value: 'PXE',
getDescription: [Function],
getSource: [Function],
description: 'PXE (network boot - adds network interface)',
source: null
}
ProvisionSource {
getValue: [Function],
value: 'Disk',
getDescription: [Function],
getSource: [Function],
description: 'Existing PVC (adds disk)',
source: null
}
It fails at create vm from disk.
1) Kubevirt create VM using wizard : ID(CNV-2446) Create VM using Disk.
Error: Please select the boot source.
at Wizard.<anonymous> /home/gouyang/console/frontend/packages/kubevirt-plugin/integration-tests/tests/models/wizard.ts:83:13
at Generator.next <anonymous>
at fulfilled /home/gouyang/console/frontend/packages/kubevirt-plugin/integration-tests/tests/models/wizard.ts:5:58
at runMicrotasks <anonymous>
at processTicksAndRejections internal/process/task_queues.js:97:5
From: Task: Run it("IDCNV-2446 Create VM using Disk.") in control flow
at UserContext.<anonymous> /home/gouyang/console/frontend/node_modules/jasminewd2/index.js:94:19
From asynchronous test:
Error
at Suite.<anonymous> /home/gouyang/console/frontend/packages/kubevirt-plugin/integration-tests/tests/vm.wizard.scenario.ts:69:5
at Env.<anonymous> /home/gouyang/console/frontend/node_modules/jasmine-fail-fast/dist/jasmine-fail-fast.js:57:26
at Env.wrapper [as describe] /home/gouyang/console/frontend/node_modules/jasmine-fail-fast/node_modules/lodash/index.js:3592:19
at Object.<anonymous> /home/gouyang/console/frontend/packages/kubevirt-plugin/integration-tests/tests/vm.wizard.scenario.ts:40:1
at Module._compile internal/modules/cjs/loader.js:1137:30
at Module.m._compile /home/gouyang/console/frontend/node_modules/ts-node/src/index.ts:400:23
If use provisionSource.value and ProvisionSource.DISK.value, error see in vmtemplate tests.
1) Create VM from Template using wizard : ID(CNV-871) Create VM Template using Container.
TypeError: Cannot read property 'value' of undefined
at Wizard.<anonymous> /home/gouyang/console/frontend/packages/kubevirt-plugin/integration-tests/tests/models/wizard.ts:294:27
at Generator.next <anonymous>
at fulfilled /home/gouyang/console/frontend/packages/kubevirt-plugin/integration-tests/tests/models/wizard.ts:5:58
at runMicrotasks <anonymous>
at processTicksAndRejections internal/process/task_queues.js:97:5
From: Task: Run it("IDCNV-871 Create VM Template using Container.") in control flow
at UserContext.<anonymous> /home/gouyang/console/frontend/node_modules/jasminewd2/index.js:94:19
From asynchronous test:
Error
at Suite.<anonymous> /home/gouyang/console/frontend/packages/kubevirt-plugin/integration-tests/tests/vmtemplate.wizard.scenario.ts:50:5
at Env.<anonymous> /home/gouyang/console/frontend/node_modules/jasmine-fail-fast/dist/jasmine-fail-fast.js:57:26
at Env.wrapper [as describe] /home/gouyang/console/frontend/node_modules/jasmine-fail-fast/node_modules/lodash/index.js:3592:19
at Object.<anonymous> /home/gouyang/console/frontend/packages/kubevirt-plugin/integration-tests/tests/vmtemplate.wizard.scenario.ts:25:1
at Module._compile internal/modules/cjs/loader.js:1137:30
at Module.m._compile /home/gouyang/console/frontend/node_modules/ts-node/src/index.ts:400:23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failure related to the Disk provision source is not as a result of this PR but changes in the golden images feature. we should see a fix in the next HCO release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main issue is that we are using cloneDeep on the data that we use, which clones the object and effectively changes the reference.
The solution is to echange of cloneDeep method in the integration tests with following custom implementation.
import { ObjectEnum } from '@console/shared/src/constants/object-enum';
import * as _ from 'lodash';
export const cloneDeepCustom = (object) => {
return _.cloneDeepWith(object, (value) => {
if (value instanceof ObjectEnum) {
return value;
}
return undefined;
});
};PS please keep it in a separate file to prevent circular dependencies
@irosenzw can you please replace all _.isEqual to plain comparisons?
8f4f9d2 to
e6a1fc9
Compare
| (await view.goldenImageCloneCheckbox.isPresent()) && | ||
| (await view.goldenImageCloneCheckbox.isSelected()) | ||
| ) { | ||
| await click(view.goldenImageCloneCheckbox); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed on my env that some clicks (like next) dont always go through. Can you please add this to the click implementation?
await browser.executeScript('arguments[0].scrollIntoView();', elem);
| throw Error('VM OS not defined'); | ||
| } | ||
|
|
||
| if (provisionSource && !_.isEqual(provisionSource, ProvisionSource.DISK)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use a simpler logic please?
if (provisionSource) {
if (provisionSource === ProvisionSource.DISK) {
await this.disableGoldenImageCloneCheckbox();
}
await this.selectProvisionSource(provisionSource);
} else {
throw Error('VM Provision source not defined');
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we said provisionSource === ProvisionSource.DISK doesn't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it works if you clone it properly - please see #6850 (comment)
e6a1fc9 to
2d49325
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is called right after the os selection which might make this appear. IMO we should wait at least 1sec if it does not appear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create should be here. Please see https://github.com/openshift/console/pull/6850/files#r503824368
|
/retest |
|
/lgtm |
|
@gouyang: changing LGTM is restricted to collaborators DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/test kubevirt-plugin |
1 similar comment
|
/test kubevirt-plugin |
2d49325 to
1b4bf6c
Compare
|
looks in a pretty good shape (except one nitpick). Let's hope the tests pass |
035eaa0 to
fdcdfc7
Compare
|
/approve |
fdcdfc7 to
bb3f7c0
Compare
Signed-off-by: Ido Rosenzwig <irosenzw@redhat.com>
bb3f7c0 to
c47ac36
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gouyang, irosenzw, rawagner, suomiy The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@irosenzw: All pull requests linked via external trackers have merged: Bugzilla bug 1883766 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Ido Rosenzwig irosenzw@redhat.com