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

Switch to ginkgo/gomega for e2e testing. #130

Merged
merged 7 commits into from Jun 9, 2020

Conversation

jmencak
Copy link
Contributor

@jmencak jmencak commented Apr 30, 2020

Switching to ginkgo/gomega for e2e tests.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 30, 2020
@jmencak
Copy link
Contributor Author

jmencak commented Apr 30, 2020

/cc @yanirq
This is still WiP, but I'd already appreciate comments whether I'm on the right track. Thanks!

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 30, 2020
@@ -70,7 +70,9 @@ $(GOBINDATA_BIN):
$(GO) build -o $(GOBINDATA_BIN) ./vendor/github.com/kevinburke/go-bindata/go-bindata

test-e2e: $(BINDATA)
KUBERNETES_CONFIG="$(KUBECONFIG)" $(GO) test -v -timeout 20m -tags e2e ./test/e2e/... -run .
for d in basic reboots; do \
Copy link
Contributor

Choose a reason for hiding this comment

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

may i recommend a script running the suits recursively and add color setting selectively?
see https://github.com/openshift-kni/performance-addon-operators/blob/master/hack/run-functests.sh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can see some value, however adding a hack directory with random scripts is something I managed to avoid so far. I'd also like to avoid pulling extra dependencies like github.com/onsi/ginkgo/ginkgo which are not necessarily needed. If they really are needed, they'd have to be vendored in as from some build environments you cannot fetch external dependencies. As for vendoring in, I tend to follow "vendor in only things that are essential". Can you elaborate whether that dependency is essential?

As for running tests recursively, I wanted to enforce the ordering: basic tests first, advanced (requiring reboots) next. Also having the flexibility to enable/disable tests seemed handy.

test/e2e/basic/available.go Outdated Show resolved Hide resolved
test/e2e/basic/available.go Outdated Show resolved Hide resolved
@jmencak jmencak changed the title WiP: Switch to ginkgo/gomega for e2e testing. Switch to ginkgo/gomega for e2e testing. May 4, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 4, 2020
Changes:
  - removed ginkgo/gomega and other dot imports
  - added a test case for kernel parameter removal
  - check for kernel parameter equality with optional exclusion
    of selected parameters
@jmencak
Copy link
Contributor Author

jmencak commented May 13, 2020

Getting very close to the final state I believe.
/cc @skordas

@skordas
Copy link

skordas commented May 14, 2020

I like it!
/lgtm

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

jmencak commented May 15, 2020

/hold
I need to squash first. Also Yanir will for sure have something to say about this. Changes expected.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 15, 2020
ginkgo.It(fmt.Sprintf("%s set", sysctlVar), func() {
ginkgo.By("getting a list of worker nodes")
nodes, err := util.GetNodesByRole(cs, "worker")
gomega.Expect(err).NotTo(gomega.HaveOccurred())
Copy link
Contributor

Choose a reason for hiding this comment

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

is there something we can do with this gomega prefix while keeping the dot imports guidelines ? its a built bulky.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you look upstream k8s or OpenShift tests, none of them use dot imports as dot imports are considered bad practice. Also, I'm concerned about a possible removal of dot imports in future golang 2.x: golang/go#29326

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 20, 2020
  - Replaced exec.Command by util.ExecAndLogCommand for better logging.
  - Added test scenario for adding kernel parameters in child profile.
@yanirq
Copy link
Contributor

yanirq commented May 23, 2020

/lgtm
The PR seems to be in a good shape now, we can improve/add tests in other PRs if needed.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmencak, skordas, yanirq

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

@jmencak
Copy link
Contributor Author

jmencak commented Jun 9, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 9, 2020
@openshift-merge-robot openshift-merge-robot merged commit e434ee9 into openshift:master Jun 9, 2020
@jmencak jmencak deleted the 4.6-e2e branch June 9, 2020 15:13
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.

None yet

5 participants