Skip to content
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

Allow adding test application even when smoke tests are disabled #50

Merged

Conversation

mayorova
Copy link
Contributor

Currently the test application with the default plan is only created when the smoke tests are enabled.
However, I need to be able to create an application with smoke tests disabled.
This is because I need to redeploy the APIcast gateway first, and run the tests after that.

In this PR this can be enabled by passing threescale_cicd_create_test_application: true var to the playbook.
Does it make sense @nmasse-itix ? Any feedback?

@nmasse-itix
Copy link
Owner

nmasse-itix commented Mar 27, 2019

Thanks a lot for your contribution @mayorova. 😊I have just a small change to suggest.

Aside this, could you also add the corresponding doc in the README.md ?

Does it make sense @nmasse-itix ? Any feedback?

@lbroudoux also asked for it, so your contribution will be appreciated ! 👍

tasks/main.yml Outdated
@@ -43,7 +43,8 @@

# Create or update the default application if smoke tests are needed
- include_tasks: steps/default_application.yml
when: 'threescale_cicd_openapi_smoketest_operation|length > 0 and threescale_cicd_application_plans is defined'
when: ('threescale_cicd_openapi_smoketest_operation|length > 0 and threescale_cicd_application_plans is defined')
or 'threescale_cicd_create_test_application|bool'
Copy link
Owner

Choose a reason for hiding this comment

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

Hi Daria,

Can we rewrite the test as:

(threescale_cicd_openapi_smoketest_operation|length > 0 or threescale_cicd_create_test_application|bool) and threescale_cicd_application_plans is defined

The reason is we don't want to create an application if there is no application plan defined.

Also, if you need quotes around the when condition, make sure it catches the whole string:

when: '(a and b) or c'

instead of:

when: ('a and b') or 'c'

Otherwise, your when condition is always true.

You can try it by yourself with this little playground:
https://github.com/nmasse-itix/Ansible-Examples/blob/master/when-quotes.yaml

@mayorova mayorova force-pushed the allow-creating-app-without-smoketest branch from 723a2b9 to 51873d1 Compare March 27, 2019 13:18
@mayorova mayorova force-pushed the allow-creating-app-without-smoketest branch from 51873d1 to e0dd643 Compare March 27, 2019 13:20
@mayorova
Copy link
Contributor Author

Thanks a lot for the comments @nmasse-itix ! I've applied the changes.

@nmasse-itix nmasse-itix merged commit 11459dd into nmasse-itix:master Mar 27, 2019
@nmasse-itix
Copy link
Owner

Approved. Thanks a lot @mayorova for this contribution. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants