Skip to content

Conversation

@irosenzw
Copy link
Contributor

@irosenzw irosenzw commented Oct 6, 2020

Signed-off-by: Ido Rosenzwig irosenzw@redhat.com

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label Oct 6, 2020
@openshift-ci-robot
Copy link
Contributor

@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
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
Details

In response to this:

Bug 1883766: Adjust tests due to UI changes

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.

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/kubevirt Related to kubevirt-plugin labels Oct 6, 2020
@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch 2 times, most recently from 555ec87 to e18a806 Compare October 6, 2020 14:33
Copy link
Member

@atiratree atiratree left a 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?

Copy link
Member

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.

Copy link
Contributor Author

@irosenzw irosenzw Oct 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove alltogether

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also change provisionSourceInputs

Copy link
Contributor Author

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 ?

Copy link
Member

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.

Copy link
Member

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.

@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch from e18a806 to 4cbe929 Compare October 7, 2020 15:28
@openshift-ci-robot openshift-ci-robot added the component/shared Related to console-shared label Oct 7, 2020
@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch from 4cbe929 to 84e6423 Compare October 7, 2020 16:33
@irosenzw
Copy link
Contributor Author

irosenzw commented Oct 8, 2020

/retest

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 11, 2020
@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch from 84e6423 to 461585a Compare October 11, 2020 07:17
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 11, 2020
@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch from 461585a to 1fdb93e Compare October 11, 2020 07:24
@irosenzw
Copy link
Contributor Author

/retest

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this

Copy link
Member

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

Copy link
Contributor Author

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 ?

Copy link
Member

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.

Copy link
Member

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?

Copy link
Member

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

Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Member

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

Copy link
Member

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

@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch 2 times, most recently from 82eb10a to 823237c Compare October 12, 2020 16:46
@gouyang
Copy link
Contributor

gouyang commented Oct 13, 2020

Test in vmtemplate.wizard.scenario.ts cannot be run due to vm.create() cannot load template data into wizard form.
All tests has to use

      await vmTemplate.createVMFromRowLink();
      await wizard.processWizard(vm.getData());

@irosenzw
Copy link
Contributor Author

irosenzw commented Oct 13, 2020

Test in vmtemplate.wizard.scenario.ts cannot be run due to vm.create() cannot load template data into wizard form.
All tests has to use

      await vmTemplate.createVMFromRowLink();
      await wizard.processWizard(vm.getData());

@gouyang I've changed vm.create() logic.
see link1 and link2

@gouyang
Copy link
Contributor

gouyang commented Oct 13, 2020

Test in vmtemplate.wizard.scenario.ts cannot be run due to vm.create() cannot load template data into wizard form.
All tests has to use

      await vmTemplate.createVMFromRowLink();
      await wizard.processWizard(vm.getData());

@gouyang I've changed vm.create() logic.
see link1 and link2

It should work in this way though I believe there is no need template at all, I will give it a try.

@irosenzw
Copy link
Contributor Author

irosenzw commented Oct 13, 2020

Test in vmtemplate.wizard.scenario.ts cannot be run due to vm.create() cannot load template data into wizard form.
All tests has to use

      await vmTemplate.createVMFromRowLink();
      await wizard.processWizard(vm.getData());

@gouyang I've changed vm.create() logic.
see link1 and link2

Ah, I pulled the head and didn't see it. It should work in this way though I believe there is no need template at all.

That's OK it is a small change among many I made in this PR.
btw, you need the template when you create it in the first place.

Copy link
Member

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

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is isEqual necessary?

Copy link
Member

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

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member

@atiratree atiratree Oct 14, 2020

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?

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Member

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?

@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch from 8f4f9d2 to e6a1fc9 Compare October 14, 2020 11:31
(await view.goldenImageCloneCheckbox.isPresent()) &&
(await view.goldenImageCloneCheckbox.isSelected())
) {
await click(view.goldenImageCloneCheckbox);
Copy link
Member

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)) {
Copy link
Member

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');
      }

Copy link
Contributor Author

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

Copy link
Member

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)

@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch from e6a1fc9 to 2d49325 Compare October 15, 2020 17:00
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@irosenzw
Copy link
Contributor Author

/retest

@gouyang
Copy link
Contributor

gouyang commented Oct 19, 2020

/lgtm

@openshift-ci-robot
Copy link
Contributor

@gouyang: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

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.

@jelkosz
Copy link

jelkosz commented Oct 19, 2020

/test kubevirt-plugin

1 similar comment
@atiratree
Copy link
Member

/test kubevirt-plugin

@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch from 2d49325 to 1b4bf6c Compare October 19, 2020 09:38
@atiratree
Copy link
Member

looks in a pretty good shape (except one nitpick). Let's hope the tests pass

@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch 2 times, most recently from 035eaa0 to fdcdfc7 Compare October 19, 2020 11:13
@atiratree
Copy link
Member

/approve

@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch from fdcdfc7 to bb3f7c0 Compare October 19, 2020 12:57
Signed-off-by: Ido Rosenzwig <irosenzw@redhat.com>
@irosenzw irosenzw force-pushed the fix-nic-disk-integration-tests branch from bb3f7c0 to c47ac36 Compare October 19, 2020 13:16
@rawagner
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 19, 2020
@openshift-ci-robot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 19, 2020
@irosenzw
Copy link
Contributor Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 5406db6 into openshift:master Oct 19, 2020
@openshift-ci-robot
Copy link
Contributor

@irosenzw: All pull requests linked via external trackers have merged:

Bugzilla bug 1883766 has been moved to the MODIFIED state.

Details

In response to this:

Bug 1883766: Adjust tests due to UI changes

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.

@spadgett spadgett added this to the v4.7 milestone Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/kubevirt Related to kubevirt-plugin component/shared Related to console-shared lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants