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

Bug 1798862: VMI list integration tests #4209

Merged
merged 7 commits into from Feb 12, 2020

Conversation

yaacov
Copy link
Member

@yaacov yaacov commented Feb 5, 2020

A test to check that we see VMs and VMIs in the Virtual Machine list page

@yaacov
Copy link
Member Author

yaacov commented Feb 5, 2020

@rhrazdil please review

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 5, 2020
@openshift-ci-robot openshift-ci-robot added the component/kubevirt Related to kubevirt-plugin label Feb 5, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2020
@yaacov yaacov changed the title VMI list integration tests Bug 1798862: VMI list integration tests Feb 6, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Feb 6, 2020
@openshift-ci-robot
Copy link
Contributor

@yaacov: This pull request references Bugzilla bug 1798862, 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.

In response to this:

Bug 1798862: VMI list integration tests

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.

@@ -28,8 +28,8 @@ import { KubevirtDetailView } from './kubevirtDetailView';
import { ImportWizard } from './importWizard';

export class VirtualMachine extends KubevirtDetailView {
constructor(config) {
super({ ...config, kind: 'virtualmachines' });
constructor(config, kind?: 'virtualmachines' | 'virtualmachineinstances') {
Copy link

Choose a reason for hiding this comment

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

It's an interesting idea. I'm just wondering whether we should or should not differentiate the type of VirtualMachine and VirtualMachineInstance more explicitly.
@suomiy wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

whether we should or should not differentiate the type of VirtualMachine and VirtualMachineInstance more explicitly.

The page rendering VM and VMI share the same component, it renders a vmiLike object that can be VM or VMI. When rendering we have small changes, mainly page title, how status is calculated, and what is allowed to be edit:
https://github.com/openshift/console/blob/master/frontend/packages/kubevirt-plugin/src/components/vms/vm-details.tsx#L72

IMHO it makes sense to share the testing methods of this components too.

Copy link

Choose a reason for hiding this comment

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

VM and VMI objects are very similar, not the same though. You can't do the same (or any basically) actions with VMI, which would be nice to have reflected in our testing framework.
But it could be achieved this way as well.

Copy link
Member

Choose a reason for hiding this comment

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

yes there will be differences in actions and also editing and we should reflect that and not use the same class for them. Let's figure out the best approach

Copy link
Member

Choose a reason for hiding this comment

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

ok; we decided to keep it simple for now after offline discussion.

Radim will revisits this once his VMBuilder PR is up.

Let's just think of it as temporary solution for now.

@@ -237,6 +238,49 @@ export function getVMManifest(
throw Error('Provision source not Implemented');
}

const spec = {
Copy link
Member

@atiratree atiratree Feb 6, 2020

Choose a reason for hiding this comment

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

can you please rename this to vmiSpec ?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, done

spec,
};

return kind === 'VirtualMachineInstance' ? vmiResource : vmResource;
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 rather have two functions getVMManifest and getVMIManifest which would use common settings of them?

Copy link
Member Author

Choose a reason for hiding this comment

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

done 👍

@@ -28,8 +28,8 @@ import { KubevirtDetailView } from './kubevirtDetailView';
import { ImportWizard } from './importWizard';

export class VirtualMachine extends KubevirtDetailView {
constructor(config) {
super({ ...config, kind: 'virtualmachines' });
constructor(config, kind?: 'virtualmachines' | 'virtualmachineinstances') {
Copy link
Member

Choose a reason for hiding this comment

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

yes there will be differences in actions and also editing and we should reflect that and not use the same class for them. Let's figure out the best approach

);

beforeAll(async () => {
await waitForVM(testVM, VM_STATUS.Off, leakedResources);
Copy link
Member

Choose a reason for hiding this comment

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

should this be really in before all block? Shouldn't we also check the vmi status change?

Copy link
Member Author

Choose a reason for hiding this comment

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

should this be really in before all block?

The test is to filter by status, knowing the the vmi is Running while the vm is Off
So we need one vm in Off status and one vmi in Running status, before we start the tests.

Shouldn't we also check the vmi status change?

vmi is always running ( if evrything is ok :-) )

Copy link
Member

Choose a reason for hiding this comment

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

ok then

await isLoaded();
};

describe('Test List View Filtering (VMI)', () => {
Copy link
Member

Choose a reason for hiding this comment

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

not sure if the naming applies ^^, we are not filtering anything - we show all of the VMs and VMIs at once

Copy link
Member Author

Choose a reason for hiding this comment

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

we are not filtering anything

We are filtering by status, we have 1 Off vm and 1 Running vmi,
A side affect of this filtering procedure is the we know for sure the we list both vm and vmi in one list.

Copy link
Member

Choose a reason for hiding this comment

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

I mean the name implies that we are testing the filtering feature of the UI. We are just reading the values and not testing it

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct, we are actually testing vmStatusFilter that filter the vm/vmi list, and not the actual filtering feature of the UI , implemented in MultiListPage.

This actually makes sense here because the UI filtering is a core feature that we should not test in our module, maybe we should rename the test to make it clear we test vmStatusFilter and not MultiListPage that does the UI filtering ?

@rhrazdil @suomiy WDYT ?

Copy link

@rhrazdil rhrazdil Feb 11, 2020

Choose a reason for hiding this comment

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

It's true that name like: Test List View Filter counts or similar would probably better describe what is done here.
I would keep the test names e2e oriented from user's perspective. IMO there is no need to make distinction betweem our plugin vs core in the test cases names.

@yaacov
Copy link
Member Author

yaacov commented Feb 10, 2020

/test e2e-gcp-console

@yaacov
Copy link
Member Author

yaacov commented Feb 11, 2020

/test e2e-gcp-console

it('Displays correct count of Running VMIs', async () => {
const vmiImportingCount = await filterBoxCount(VM_STATUS.Running);
expect(vmiImportingCount).toEqual(1);
});

Choose a reason for hiding this comment

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

Now when I think about it, it may be a good idea to add one more test case that the VMI is displayed in the list.

Something like:

import {
  resourceRowsPresent,
  textFilter,
} from '@console/internal-integration-tests/views/crud.view';

it('Displays VMIs in the list of VirtualMachines', async () => {
await fillInput(textFilter, testVMI.metadata.name);
await resourceRowsPresent();
});

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks 👍

@yaacov
Copy link
Member Author

yaacov commented Feb 12, 2020

/test e2e-gcp-console

1 similar comment
@yaacov
Copy link
Member Author

yaacov commented Feb 12, 2020

/test e2e-gcp-console

@rhrazdil
Copy link

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhrazdil, suomiy, yaacov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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-merge-robot openshift-merge-robot merged commit 0d80328 into openshift:master Feb 12, 2020
@openshift-ci-robot
Copy link
Contributor

@yaacov: All pull requests linked via external trackers have merged. Bugzilla bug 1798862 has been moved to the MODIFIED state.

In response to this:

Bug 1798862: VMI list integration tests

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.4 milestone Feb 17, 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/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/kubevirt Related to kubevirt-plugin lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants