-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Improve functional tests #816
Conversation
tomdee
commented
Sep 18, 2017
- Move to using bash_unit
- Test pings in both directions
- Test kubernetes subnet manager
- Test multiple versions of etcd and k8s during a release
51ac2c6
to
24a3268
Compare
Makefile
Outdated
release-tests: bash_unit | ||
# Run the functional tests with different etcd versions. Currently these are the latest point releases. | ||
# This list should be updated during the release process. | ||
ETCD_IMG="quay.io/coreos/etcd:v3.2.7" ./bash_unit dist/functional-test.sh |
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.
what if we do a latest
tag here instead?
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.
good idea
dist/functional-test-k8s.sh
Outdated
} | ||
|
||
test_vxlan() { | ||
start_flannel vxlan && sleep 2 |
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.
how about instead of all these sleep 2
, we put the pings
in a loop so it retries for 5-10 times to see if pings work, so the tests don't become flakey
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.
the sleep is actually there to make sure the subnet.env file is written. I'll update the PR to get rid of the sleeps
|
||
pings() { | ||
# ping in both directions | ||
assert "docker exec -it --privileged flannel-e2e-test-flannel1 /bin/ping -c 5 $ping_dest2" "Host 1 cannot ping host 2" |
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.
or we could put this in some sort of retry block, maybe
|
||
test_manifest() { | ||
# This just tests that the API server accepts the manifest, not that it actually acts on it correctly. | ||
assert "cat ../Documentation/kube-flannel.yml | docker run -i --rm --net=host gcr.io/google_containers/hyperkube-amd64:v$K8S_VERSION /hyperkube kubectl create -f -" |
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.
btw, there's a cool project garethr/kubeval
that can validate the k8s manifests. Not suggesting we should or shouldn't use it, but just throwing it out there
dist/functional-test.sh
Outdated
# sleep 10000 | ||
#fi | ||
test_vxlan_ping() { | ||
write_config_etcd vxlan && sleep 1 |
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.
curious, why is this sleep 1
vs 2 in the other 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.
i'd still advocate for some sort of ping retry instead of sleep
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.
looks pretty good. I just have a few comments/suggestions, nothing critical or blocking the merge tho
- Move to using bash_unit - Test pings in both directions - Test kubernetes subnet manager - Test multiple versions of etcd and k8s during a release
Improve functional tests