-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Replace minikube for e2e tests #2863
Conversation
@antoineco this approach can help us to run the tests in different cloud providers like gce |
0e3e171
to
80ee721
Compare
With this change, we can also skip minikube locally running |
Codecov Report
@@ Coverage Diff @@
## master #2863 +/- ##
==========================================
+ Coverage 47.71% 47.84% +0.12%
==========================================
Files 75 75
Lines 5434 5434
==========================================
+ Hits 2593 2600 +7
+ Misses 2510 2504 -6
+ Partials 331 330 -1
Continue to review full report at Codecov.
|
hack/boilerplate/boilerplate.py
Outdated
"vendor", | ||
"test/e2e/framework/framework.go", | ||
"test/e2e/generated/bindata.go", | ||
"hack/boilerplate/test", |
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.
Bindata files are gone.
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.
done
@@ -26,7 +26,9 @@ GOHOSTOS ?= $(shell go env GOHOSTOS) | |||
# Allow limiting the scope of the e2e tests. By default run everything | |||
FOCUS ?= .* | |||
# number of parallel test | |||
E2E_NODES ?= 3 | |||
E2E_NODES ?= 4 |
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 evil, it allows for empty strings. :=
is safer.
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.
most of the variables could be replaced by env variables, using :=
avoids that. Also, the scripts we call check for the required variables
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.
:=
should handle env vars as well. What version of make do you have installed?
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.
$ make -v
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
build/e2e-tests.sh
Outdated
@@ -34,6 +34,10 @@ if [ -z "${NODE_IP}" ]; then | |||
echo "NODE_IP must be set" | |||
exit 1 | |||
fi | |||
if [ -z "${SLOW_E2E_THRESHOLD}" ]; then |
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.
Suggestion:
declare -a mandatory
mandatory=(
NODE_IP
SLOW_E2E_THRESHOLD
...
)
for m in ${mandatory[@]}; do
if [ -z "${!m}" ]; then
echo "$m must be set"
declare missing
fi
done
if [ -n $missing ]; then
exit 1
fi
Would show all missing variables at once.
015bca3
to
1fd6ea0
Compare
build/go-in-docker.sh
Outdated
@@ -63,6 +63,7 @@ PWD=${PWD} | |||
BUSTED_ARGS=${BUSTED_ARGS:-""} | |||
REPO_INFO=${REPO_INFO:-local} | |||
NODE_IP=${NODE_IP:-127.0.0.1} | |||
SLOW_E2E_THRESHOLD=${SLOW_E2E_THRESHOLD:-50} |
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.
any reason why is this 50 here but 40 in the Makefile?
@aledbf could you describe with a few words why is this new tool better than minikube in our case? (I'm not experienced in either of them) |
I can comment here: I have been using Docker for Mac for a while so I appreciate having batteries included (local dev script) but swappable (I can run e2e in my own setup easily without seeing failures when minikube is absent). Also minikube is tough to run in unprivileged environments (most CI systems I use don't allow sudo). |
Also, this approach provides a more real cluster, one master, and two workers use just docker and don't require a VM, which means no Virtualbox or QEMU. |
Not sure (yet) if it's better or not but for sure it's simpler. |
build/build.sh
Outdated
fi | ||
done | ||
|
||
if $missing ; then |
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.
Bash doesn't know about booleans, does it? This may always match.
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.
done
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, antoineco 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 |
What this PR does / why we need it:
Replaces minikube with https://github.com/kubernetes-sigs/kubeadm-dind-cluster to build and run e2e tests.
Also, we update the slow threshold from 5 seconds to 40. This value is more real and can help to detect slow tests.