Skip to content
This repository has been archived by the owner on Jul 17, 2018. It is now read-only.

ARIA-99 Straightforward end-to-end tests for parser and built-in workflow #67

Merged
merged 1 commit into from
Feb 8, 2017

Conversation

tliron
Copy link
Contributor

@tliron tliron commented Feb 3, 2017

No description provided.


node_types:

openstack.Instance:
Copy link

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)

Copy link
Contributor Author

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.

Copy link

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:
Copy link

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

Copy link
Contributor Author

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.

Copy link

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
Copy link

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?

Copy link
Contributor Author

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'
Copy link

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

Copy link
Contributor Author

@tliron tliron Feb 7, 2017

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.

def _workflow(workflow_name):
context, _ = consume_node_cellar()

if workflow_name in BUILTIN_WORKFLOWS:
Copy link

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

Copy link
Contributor Author

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,58 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
Copy link

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.

Copy link
Contributor Author

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"?

Copy link

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.



def test_custom():
_workflow('maintenance_on')
Copy link

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.

Copy link
Contributor Author

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):
Copy link

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 :)

Copy link
Contributor Author

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.

@@ -0,0 +1,40 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
Copy link

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?

@@ -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.
Copy link

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.

@asfgit asfgit force-pushed the ARIA-99-e2e-tests branch 2 times, most recently from 9061273 to 344e3ca Compare February 8, 2017 03:17
@asfbot
Copy link

asfbot commented Feb 8, 2017

Can one of the admins verify this patch?

@asfgit asfgit merged commit d35d09a into master Feb 8, 2017
@asfgit asfgit deleted the ARIA-99-e2e-tests branch February 9, 2017 08:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants