-
Notifications
You must be signed in to change notification settings - Fork 47
ARIA-99 Straightforward end-to-end tests for parser and built-in workflow #67
Conversation
aa5df64
to
f94bff0
Compare
|
||
node_types: | ||
|
||
openstack.Instance: |
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 a duplication of what we (will need to) have for the Openstack plugin (have yet to translate its plugin.yaml)
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.
All these files are just for testing the TOSCA grammar. That's why they are in /tests/. There is no intention for them to be anything other than 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.
right, if these only test the parser then it makes sense,
what I had in mind was that if we're talking true "complete" tests then in the future we'll want to run tests which use the actual plugin as well etc.
@@ -0,0 +1,93 @@ | |||
|
|||
policy_types: |
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.
Why is this here? This should not be a part of the 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.
To test policy type parsing.
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.
lol I understand, but the problem is this yaml import should be part of the extension code and not part of the tests. I realize it's not there right now but I think you might as well have thrown it over there instead right now, no?
Unless I'm missing something, and you think this duplication will remain even once we do have it as part of the extension..?
node_cellar: | ||
description: >- | ||
The repository for the Node Cellar application and its dependencies. | ||
url: https://github.com/cloudify-cosmo/nodecellar/archive |
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 it a good idea to have a direct reference to Cloudify 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 could just be a dummy URL.
template_name: node-cellar | ||
template_author: ARIA | ||
template_version: '1.0.0' | ||
aria_version: '1.0' |
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 technically never actually called ARIA's first version to be "1.0". actually, on JIRA the version we're supposedly working towards is "0.1.0". not that it really matters here, but thought I'd mention 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.
Again, this utterly does not matter. It's here to test metadata parsing, to show that we can parse built in fields as well as custom fields.
tests/orchestrator/test_complete.py
Outdated
def _workflow(workflow_name): | ||
context, _ = consume_node_cellar() | ||
|
||
if workflow_name in BUILTIN_WORKFLOWS: |
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 section shouldn't be part of the test
the logic needs to sit elsewhere but the CLI in which case the test can test it as well
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.
Since we're rehauling the CLI I am worried about code disappearing. For now I say let's keep this in the test. When we have the new CLI this particular section of code can be redone. I will add a TODO comment 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.
👍
tests/orchestrator/test_complete.py
Outdated
@@ -0,0 +1,58 @@ | |||
# Licensed to the Apache Software Foundation (ASF) under one or more |
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.
IMO e2e tests need to be separated from unit/functional tests, and sit under, say, "tests/e2e" or something similar.
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 disagree, but it's not too important. Do you want me to move them? I'd rather not use "e2e" because most people will not know what that means. How about "complete"?
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 mind the name much, didn't really mean for it to be "e2e". I think "system_tests" is a better name than "complete", but i'll leave it up to you - I mostly want them separated from the rest - that, I do think is important.
tests/orchestrator/test_complete.py
Outdated
|
||
|
||
def test_custom(): | ||
_workflow('maintenance_on') |
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'm not sure we should be testing custom workflows at this time, simply because we haven't quite implemented this feature "for real" yet. It's fine to keep it, I just don't see much benefit for it at the moment.
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.
Since we insist that all our code have tests, I added this.
from .utils import (get_uri, create_context, create_consumer) | ||
|
||
|
||
def consume_node_cellar(consumer_class_name='instance', cache=True): |
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.
sorry for nitpicking but if this module is designated to be a place for several templates to be used by various tests, I think simply "node_cellar" is a better name in this case :)
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 like function names to have verbs in them, because it makes reading code that calls them easier.
tests/parser/test_complete.py
Outdated
@@ -0,0 +1,40 @@ | |||
# Licensed to the Apache Software Foundation (ASF) under one or more |
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 think the module name should be changed, possibly to "test_consumers" or so?
88d6aa2
to
e3af53b
Compare
tests/complete/test_parser.py
Outdated
@@ -0,0 +1,40 @@ | |||
# Licensed to the Apache Software Foundation (ASF) under one or more | |||
# contributor license agreements. See the NOTICE file distributed with | |||
# this work for additional information regarding copyright ownership. |
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.
Actually, I'm not sure these tests should have moved out from where they were at.
"Complete" means end to end tests; While these are not unit tests per se, they are parser specific.
We already have many tests which aren't standard unit tests yet are treated as such. See execution plugin tests for example - those actually run the workflow engine.
On the other hand, the parser might indeed be used regardless of other components of ARIA by other projects, and so it might be ok to leave this here.
Again, I'll leave it for your consideration.
9061273
to
344e3ca
Compare
Can one of the admins verify this patch? |
e6695d5
to
d35d09a
Compare
No description provided.