-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
The PR already has a merge conflict, please rebase it |
@@ -0,0 +1,197 @@ | |||
import concurrent.futures |
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 lookslike a forked version of https://github.com/kubernetes-client/python/blob/master/kubernetes/utils/create_from_yaml.py I would like to prevent using an internal fork this will only result in pain. Please use the create_from_yaml
function and add an extra method that wait until thee deployments are ready. You can also try to provide an upstream patch (e.g. create an issue and ask if this feature is wanted).
# Clean up | ||
res = subprocess.run(["illuminatio", "clean"], capture_output=True) | ||
# delete test resources | ||
res = subprocess.run(["kubectl", "delete", "-f", resource_manifest], |
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.
You can leave this command if you just add the according labels to the manifests (then illuminatio clean
will remove them for you)
@pytest.mark.e2e | ||
def test_deny_all_traffic_to_an_application(): | ||
resource_manifest = "e2e-manifests/01-deny-all-traffic-to-an-application.yml" | ||
results_yaml_file = "result.yml" |
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.
Store a file to disk only to reread it seems to me not the best (and performant) idea.
tests/test_e2e.py
Outdated
yaml_document = yaml.safe_load_all(f) | ||
for results_dict in yaml_document: | ||
validate_illuminatio_was_successful(results_dict) | ||
expected_dict = {'cases': {'default:app=bookstore': { |
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.
Can we move this outside of the python code e.g. in a results.yaml
that would make the code more readable.
Like already mentioned here: #34 (review) I would prefer multiple smaller PR's instead of one huge PR |
You have seen the deprecation warning : tests/test_e2e.py::test_deny_all_traffic_to_an_application
/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/yaml/constructor.py:126: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
if not isinstance(key, collections.Hashable): |
And could you take a look at this warning: /home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/_pytest/mark/structures.py:324
/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.e2e - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
PytestUnknownMarkWarning, Thanks (or at least create an issue for it). |
Are you still working on this ? |
No, feel free to takeover if you like to |
Closing this in favor of #82 and upcoming PR(s) |
Implements the framework for e2e tests with the first two e2e tests from the e2e-manifests.
Blockers:
Replace
kubectl delete -f
with python code:kubernetes-client/python#940
Remove forked code and contribute changes upstream:
kubernetes-client/python#941