-
Notifications
You must be signed in to change notification settings - Fork 41
Initial implementation of smoke tests #124
base: master
Are you sure you want to change the base?
Conversation
d63d350
to
00a6c1b
Compare
This test works well when we run Unfortunately at the moment CI services like semaphoreCI or circleCI are based on Ubuntu 14.04, where neither vagrant nor VirtualBox is installed. So I wanted to somehow install vagrant & virtualbox from test-smoke.sh. It didn't work well, as there's no kernel tree inside chroot environment, which prevents vbox kernel modules from getting built. Anyway it's not a good idea at all to build kernel modules every time. Next attempt was to make use of vagrant-libvirt, instead of virtualbox. Then we don't need to build vbox kernel modules at all. For that, I needed to support libvirt in Vagrantfile of kube-spawn. (See https://github.com/dongsupark/kube-spawn/tree/dongsu/smoke-test ) So I would rather keep this PR based on virtualbox instead of libvirt. Maybe later when semaphoreCI supported Ubuntu 16.04, we will be able to make test-smoke.sh run integrated with semaphoreCI. EDIT: Another issue is that |
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.
Could you also create a deployment, a service for the deployment and test if the service is up and running?
scripts/test-smoke.sh
Outdated
set -o pipefail | ||
|
||
CDIR=$(cd "$(dirname "$0")" && pwd) | ||
cd "$CDIR" |
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.
Better with pushd
:
pushd "$CDIR"
trap 'popd' EXIT
scripts/test-smoke.sh
Outdated
|
||
echo "Test result: ${RES}" | ||
|
||
vagrant halt fedora |
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.
Could also go into trap.
00a6c1b
to
be7a338
Compare
Updated.
|
As far as I can see, it doesn't test if the pods/services are actually running and reachable over the network endpoints. IMHO we should test this. |
be7a338
to
5a145d7
Compare
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.
small stylistic nit
Vagrantfile
Outdated
@@ -5,7 +5,7 @@ ENV["TERM"] = "xterm-256color" | |||
ENV["LC_ALL"] = "en_US.UTF-8" | |||
|
|||
Vagrant.configure("2") do |config| | |||
config.vm.box = "jhcook/fedora26" # defaults to fedora | |||
config.vm.box = "fedora/26-cloud-base" # defaults to fedora |
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.
Rebase needed?
scripts/test-smoke.sh
Outdated
trap 'popd' EXIT | ||
|
||
if ! vagrant version > /dev/null 2>&1; then | ||
echo "Please install vagrant first" |
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.
Indentaions in this script are inconsistent. Sometimes you are using two spaces, sometimes tabs. Please choose the one pattern - I prefer tabs, but whatever you prefer WFM.
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.
@nhlfr Fixed the coding style, and removed "make vendor" from the build command.
It's working, but I'm not sure I'm satisfied with this PR yet.
Another side issue with semaphoreCI still remains: SemaphoreCI limits size of downloaded files for each build instance. ~500MB. As kube-spawn downloads more than that in the end, this script cannot be used for such CI services.
5a145d7
to
9807238
Compare
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.
It seems that only @schu's suggestion about checking network connectivity to pods/services needs to be implemented and after that we can merge this PR.
@nhlfr Also I would need to change commands according to the new design of v0.2. |
The script `test-smoke.sh` launches a Vagrant VM based on Fedora 26, to run smoke tests inside the VM for each build.
9807238
to
ffb8567
Compare
A simple implementation of smoke tests based on Vagrant. It initializes a simple K8s cluster with 2 nodes, deploys an nginx pod, a service for the deployment, and checks if it's running. Fixes #56
Rebased. |
A simple implementation of smoke tests based on Vagrant.
Fixes #56