Skip to content

Conversation

@pacevedom
Copy link
Contributor

No description provided.

@openshift-ci openshift-ci bot requested review from deads2k and sosiouxme September 1, 2022 08:57
o.Expect(out).To(o.ContainSubstring("storage.k8s.io/v1"))
})

g.It("can output expected information about openshift api-resources [apigroup:build.openshift.io][apigroup:project.openshift.io][apigroup:user.openshift.io]", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about this part of the change. Logically it's saying that if the API exists then it should show up in the output from api-resources, but aren't we using the same query to see if it exists that oc uses to produce its output? Is that a useful test?

I know we've said we didn't want to generally, but this feels like a case where we should say "If the cluster is MicroShift, skip" so that we can have a separate test that checks for the expected APIs when the cluster is MicroShift.

{Group: "template.openshift.io", Version: "v1", Resource: "templateinstances"},
}

microShiftBuiltinTypes = []schema.GroupVersionResource{
Copy link
Contributor

Choose a reason for hiding this comment

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

How hard would it be for us to put these microshift-specific tests in the microshift repo? If not now, eventually?

I know @bparees has been looking at splitting up the tests, so maybe we can be an early adopter of that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have local e2e tests? I have seen other operators do it before.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 8, 2022
@pacevedom
Copy link
Contributor Author

/hold
Need to rework.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 13, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 14, 2022
@pacevedom
Copy link
Contributor Author

pacevedom commented Sep 14, 2022

/unhold
Ready for review. Depends on #27345
/assign @ingvagabund

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 14, 2022
o.Expect(out).To(o.ContainSubstring("storage.k8s.io/v1"))
})

g.It("can output expected information about openshift api-resources [apigroup:build.openshift.io][apigroup:project.openshift.io][apigroup:user.openshift.io]", func() {
Copy link
Member

@ingvagabund ingvagabund Sep 21, 2022

Choose a reason for hiding this comment

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

To increase the flexibility it's worth introducing new g.It for each apigroup. E.g.:

g.It("can output expected information about openshift build api-resources [apigroup:build.openshift.io]", func() {
   ...
}
g.It("can output expected information about openshift image api-resources [apigroup:image.openshift.io]", func() {
   ...
}
g.It("can output expected information about openshift project api-resources [apigroup:project.openshift.io]", func() {
   ...
}
g.It("can output expected information about openshift user api-resources [apigroup:user.openshift.io]", func() {
   ...
}
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

o.Expect(os.Unsetenv("MYENV")).NotTo(o.HaveOccurred())
})

g.It("works as expected with cluster operators [apigroup:config.openshift.io]", func() {
Copy link
Member

Choose a reason for hiding this comment

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

Why separate when the original works as expected [apigroup:config.openshift.io] name still keeps the apigroup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

})
}

for group, bts := range builtinTypes {
Copy link
Member

Choose a reason for hiding this comment

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

Is the loop duplicated by accident or is there a reason for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

builtinTypes is defined as map[string][]schema.GroupVersionResource. This loop takes the apigroup as group and the list is assigned to bts. This is passed to verifySpecStatusExplain which takes a schema.GroupVersionResource as the last argument.

Copy link
Member

@ingvagabund ingvagabund Oct 11, 2022

Choose a reason for hiding this comment

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

Both

	for group, bts := range builtinTypes {
		g.It(fmt.Sprintf("should contain spec+status for %s [apigroup:%s]", group, group), func() {
			for _, bt := range bts {
				o.Expect(verifySpecStatusExplain(oc, nil, bt)).NotTo(o.HaveOccurred())
			}
		})
	}

and

	for group, bts := range builtinTypes {
		g.It(fmt.Sprintf("should contain spec+status for %s [apigroup:%s]", group, group), func() {
			for _, bt := range bts {
				e2e.Logf("Checking %s...", bt)
				o.Expect(verifySpecStatusExplain(oc, nil, bt)).NotTo(o.HaveOccurred())
			}
		})
	}

are identical up to `e2e.Logf("Checking %s...", bt) line unless I am overlooking something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh wait, misunderstood you. You are absolutely right, should be fixed now.

}
)

func getCrdTypes(oc *exutil.CLI) []schema.GroupVersionResource {
Copy link
Member

Choose a reason for hiding this comment

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

getCrdTypes is invoked by two tests:

  • "list uncovered GroupVersionResources"
  • "should contain proper spec+status for CRDs [apigroup:config.openshift.io]"

The second already assumes existence of the config apigroup which is getting detected inside getCrdTypes.

getCrdTypes is always constructing the list of crd types from baseCRDTypes, autoscalingTypes, machineTypes and additionalOperatorTypes which belong to their corresponding groups as well. Which at least requires to label both tests with the corresponding groups as well. Making both tests as another place for refactoring and looping through through the apigroups.

@pacevedom this tests requires more refactoring than anticipated. Though, better to do it properly now than later/never. Nevertheless, very good progress here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"should contain proper spec+status for CRDs [apigroup:config.openshift.io]" requires config API because it checks for control plane topology in order to select different CRDs.
The nature of this test is to check explicitly for presence of those APIs that get built in getCRDTypes. If they are not present (or are poorly defined) then that should be an error. Maybe we should have a MicroShift specific test with the CRDs we install there instead? To me it is not only about checking that whatever is present is ok, it is also about specifying what should be installed.

"list uncovered GroupVersionResources" goes after API groups not covered in this file to list them. It does not perform any checks besides producing logs for those uncovered.

Copy link
Member

@ingvagabund ingvagabund Oct 12, 2022

Choose a reason for hiding this comment

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

should contain proper spec+status for CRDs [apigroup:config.openshift.io] checks presence of explanation text for corresponding CRD's spec and status.

The nature of this test is to check explicitly for presence of those APIs that get built in getCRDTypes. If they are not present (or are poorly defined) then that should be an error.

The test does not check whether a cluster has a required list of CRDs present. Unless I am missing the specific line. The test checks whether CRDs listed by getCRDTypes have the spec and status properly described when running oc explain command. I.e. testing implication (is a given crd present -> has the crd spec/status properly explained). For that the list of CRDs can still be broken down based on the apigroup and each apigroup test separately. If there's a need to explicitly check for a presence of a specific list of CRDs, new test needs to be written.

To me it is not only about checking that whatever is present is ok, it is also about specifying what should be installed.

I don't think this is the case here.

"list uncovered GroupVersionResources" goes after API groups not covered in this file to list them. It does not perform any checks besides producing logs for those uncovered.

Ack. Reading the code a second time resourceMap gets populated from what's installed on a cluster minutes what's provided by getCrdTypes. Taking my comment back. Thanks for the pointers.

@pacevedom pacevedom force-pushed the ushift-sig-cli branch 2 times, most recently from 0730bb9 to e47e136 Compare October 11, 2022 14:56
TLSClientConfig: &tls.Config{
RootCAs: rootCAs,
RootCAs: rootCAs,
Certificates: certs,
Copy link
Member

Choose a reason for hiding this comment

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

@pacevedom does this change automatically implies OAuth tokens will no longer be used? Is there any way to detect whether OAuth tokens are used and generate list of certs only when they are not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for having a look, this was a leftover from before all the changes to the oc project impersionation were complete. Now its not needed so I remove it.

@pacevedom
Copy link
Contributor Author

/retest-required

2 similar comments
@pmtk
Copy link
Member

pmtk commented Oct 19, 2022

/retest-required

@ggiguash
Copy link

/retest-required

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 24, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 26, 2022
@ingvagabund
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2022
@mfojtik
Copy link
Contributor

mfojtik commented Oct 26, 2022

/lgtm
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 26, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ingvagabund, mfojtik, pacevedom

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 26, 2022
@pmtk
Copy link
Member

pmtk commented Oct 26, 2022

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 26, 2022

@pacevedom: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-openstack-ovn baf4c04 link false /test e2e-openstack-ovn
ci/prow/e2e-gcp-ovn-rt-upgrade baf4c04 link false /test e2e-gcp-ovn-rt-upgrade
ci/prow/e2e-agnostic-ovn-cmd baf4c04 link false /test e2e-agnostic-ovn-cmd
ci/prow/e2e-aws-ovn-serial baf4c04 link true /test e2e-aws-ovn-serial
ci/prow/e2e-metal-ipi-ovn-ipv6 baf4c04 link false /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-aws-ovn-single-node-upgrade baf4c04 link false /test e2e-aws-ovn-single-node-upgrade
ci/prow/e2e-gcp-csi baf4c04 link false /test e2e-gcp-csi
ci/prow/e2e-metal-ipi-sdn baf4c04 link false /test e2e-metal-ipi-sdn
ci/prow/e2e-aws-ovn-single-node-serial baf4c04 link false /test e2e-aws-ovn-single-node-serial
ci/prow/e2e-aws-ovn-cgroupsv2 baf4c04 link false /test e2e-aws-ovn-cgroupsv2
ci/prow/e2e-aws-csi baf4c04 link false /test e2e-aws-csi
ci/prow/e2e-aws-ovn-single-node baf4c04 link false /test e2e-aws-ovn-single-node
ci/prow/e2e-gcp-ovn baf4c04 link true /test e2e-gcp-ovn
ci/prow/e2e-gcp-ovn-upgrade baf4c04 link true /test e2e-gcp-ovn-upgrade

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@ingvagabund
Copy link
Member

Merged through #27498
/close

@openshift-ci openshift-ci bot closed this Oct 27, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 27, 2022

@ingvagabund: Closed this PR.

Details

In response to this:

Merged through #27498
/close

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.

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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants