-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add functional test #94
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
Conversation
@@ -193,7 +193,7 @@ def sanitize_for_serialization(self, obj): | |||
for sub_obj in obj] | |||
elif isinstance(obj, tuple): | |||
return tuple(self.sanitize_for_serialization(sub_obj) | |||
for sub_obj in obj) | |||
for sub_obj in obj) |
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.
scripts/update-pep8.sh does not update this file. If this is the right style we should have, we need to be able to automate it there.
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.
Reverted
@@ -0,0 +1,204 @@ | |||
# -*- coding: utf-8 -*- |
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 test folder will be removed and re-generated by scripts/update-client.sh. You need to either change the script there to keep this file or move this file to another folder. maybe put it in kubernetes/e2e_test folder or something like that? Also would be nice if we can have an script in scripts/ folder to deploy a minikube and run this against it.
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.
Moved the file to e2e_test
@@ -0,0 +1,112 @@ | |||
#!/bin/bash |
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.
add copyright header here.
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
echo "K8S_VERSION : ${K8S_VERSION}" | ||
|
||
echo "Starting docker service" | ||
sudo systemctl enable docker.service |
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 this supported on osx? if not, we should check at the start of script and fail for osx with a relevant message. it may not be hard to just support osx too.
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.
This is mainly meant for travis. we can look into supporting other platforms. As mentioned, you really don't need this script, as long as you have localhost:8080 proxied to a working k8s instance for the tests to run.
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.
Ignore all osx comments then now that I understand this is meant for travis.
|
||
# Run the docker containers for kubernetes | ||
echo "Starting Kubernetes containers" | ||
sudo docker run \ |
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 probably sudo is not necessary on osx.
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.
This is working on travis. can tweak for OSX later
--allow-privileged=true --v=2 | ||
|
||
|
||
echo "Download Kubernetes CLI" |
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.
we can first check if kubectl is available. if you want to always download an stable version, would suggest to download it in a temp folder and remove it at the end.
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.
Ack. I can do this in a followup PR as this is mainly for the travis environment right now where we know kubectl is not available
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.
this is for travis, no need to do so.
@@ -0,0 +1,112 @@ | |||
#!/bin/bash | |||
|
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/where do we use this file? If it is a manual run, it would be nice if we have an example here.
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's used when you run "tox -e py27-functional" so will run on travis
commands = {toxinidir}/scripts/kube-init.sh nosetests [] | ||
|
||
[testenv:coverage] | ||
commands = nosetests --with-coverage --cover-package=kubernetes.config,kubernetes.watch --cover-tests |
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 don't see code coverage comment from codecov-io. If we do the code coverage right, we should get such a comment. The comment look like this: #89 (comment)
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.
Ack. i'll check on this
@dims I had some comment. Let me know if they make sense. I was looking into have some kind of e2e test from the beginning. This is great. Thanks. |
2ac21d8
to
9a227d9
Compare
Current coverage is 94.52% (diff: 100%)@@ master #94 diff @@
==========================================
Files 9 9
Lines 658 658
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 623 622 -1
- Misses 35 36 +1
Partials 0 0
|
d3ae269
to
751dc40
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.
One final comment, look good otherwise.
@@ -0,0 +1,204 @@ | |||
# -*- coding: utf-8 -*- |
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.
would you please add copyright header to kubernetes/e2e_test/init.py file too. annoying but I think it is required on all files.
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 (added header to kubernetes/e2e_test/init.py
9a43721
to
00b2544
Compare
ok @mbohlool - this is ready as well |
@dims LGTM. please fix the conflict. thanks. |
Port a bunch of tests from python-k8sclient repository. There is a script that starts a real instance of kubernetes and the tests are executed against it. Note, if you just have k8s accessible in your localhost:8080, the tests still run. so you don't really need to run "py27-functional" which runs the kube-init.sh Also, 2 API calls fail currently, i've added a TODO so we can dig into them and fix them
00b2544
to
010af62
Compare
@mbohlool Done! |
…onfigs feat: merging kubeconfig files
Port a bunch of tests from python-k8sclient repository. There is a script that starts a real instance of kubernetes and the tests are executed against it.
Note, if you just have k8s accessible in your localhost:8080, the tests still run. so you don't really need to run "py27-functional" which runs the kube-init.sh
Also, 2 API calls fail currently, i've added a TODO so we can dig into them and fix them