31 Commits

Author SHA1 Message Date
Pavlo Shchelokovskyy
a096144db7 Run pep8 check in run_tests.sh as in tox
Until now the flake8 tests run by tox and run_tests.sh were a bit
different - run_tests.sh was not checking heat-* python scripts in bin
folder and was checking the docs folder that is ignored in tox' pep8
check.

This patch brings pep8 style checking done by run_tests.sh in line with
what is done by tox (and thus the gate).

Change-Id: Ie3f2c25210075df6b941854737f0d926d141601b
2014-03-29 23:47:20 +02:00
Vic Howard
ea968bd43a run_tests.sh default doc omits pep8
Modified run_tests.sh comments to show that
  both pep8 and unit tests are run by default

   Closes-Bug: #1280866

Change-Id: I53525011bd7e4bc2080f8aa1d7294350aa0839b8
2014-02-18 00:23:15 -05:00
Chmouel Boudjnah
e6e9d38cd4 Don't run pep8 tests with -P
Sync the -P option from other project to don't run PEP8 when running it.

Change-Id: I45ab69985f24d5c1bc387e927dca0640d3a84174
Partial-Bug: #1273598
2014-01-28 16:07:40 +01:00
Pablo Andres Fuente
02286951bc run_test.sh -V --unit doesn't run using virtualenv
Before this change, when you called the script using the -V option, the tests
were run outside the virtualenv that the script creates.
To fix it, I modified the lines of the script that run the tests to run
inside the virtualenv using the $wrapper variable.

Change-Id: I5c202727e0b5214670d54e14c80a68cc8ebec400
Closes-Bug: #1251730
2013-12-02 10:55:51 -03:00
Steven Hardy
f6e38b4040 Use "python -m coverage" instead of coverage cli
As requested by the Debian package maintainer, this makes the
coverage report work more easily on Debian/Ubuntu

Change-Id: Ibed9e164c89543b679393ee18ccdb4a15bdea6d7
Closes-Bug: #1241330
2013-10-18 17:29:31 +01:00
guohliu
dc4d670e10 Add debug option to run_tests.sh
Change-Id: Ie21cb8b7a370d5e62c7ac75d37affd62f761765a
2013-08-13 02:35:50 +08:00
Zane Bitter
9ebf853c5d Clean up DB migrations when running unit tests
When doing development work, all kinds of issue can result when moving
between versions of the code that have added/removed DB migration scripts
if the compiled .pyc files are left behind. To save the need to do this
manually, remove all of the .pyc files when the unit tests are run.

Change-Id: Ia4bc889edeeed499e5fc2172d5f7c1b4e693a27b
2013-05-29 09:25:35 +02:00
Monty Taylor
1d79afc696 Migrate to flake8
Fixes bug 117244

Change-Id: Ide81366eb2240377160775830e2307aef6064f9e
2013-05-17 16:50:25 -07:00
Steven Hardy
887d230257 heat tests : run_tests.sh reinstate text coverage report
testr migration removed the text CLI summary report, so add
it back in now for easy visibility of coverage results

Change-Id: I419b1a9ea45f391a2cf623ad4431c93982ae5231
2013-05-01 19:03:08 +01:00
Clint Byrum
02def52cc2 Re-work run_tests.sh to call testr instead of nose
Running testr directly or running the tests in tox are the preferred
method at this point, but developers may still have automation around
run_tests.sh.

Change-Id: I5cd8a0e6bcee192440bdbc072dbd560615130def
2013-04-30 13:51:31 -07:00
Steven Dake
637740a4f1 Update infrastructure to more closely match other OpenStack projects
This patch imports nova's HACKING.rst guidelines altered for Heat.
This patch imports nova's run_pep8.sh with some minor alterations.
This patch imports nova's hacking.py extensions to pep8.

This patch places the run_pep8 logic in a separate file rather than
having it spread between tox.ini and run_tests.sh.  The HACKING.rst
requirements as well as general pep8 requirements are then enforced
with run_pep8.sh.

Avoid running once the N802 rule until dependency changelogs are
less then 50 characters.

Change-Id: If46c14668eae3cf11b8fbff46d766cc589d701aa
Fixes: Bug #1131275
2013-02-28 20:18:01 +00:00
Steven Hardy
409a2705b3 heat tests : fix run_tests.sh pep checks
run_tests.sh parses tox.ini, which has been changed removing the
pep8 version, so remove this test and specify the version in
test-requires.  This allows the pep tests to run via run_tests.sh
again, a subsequent patch can reinstate the version check based
on the test-requires version

fixes bug 1131251

Change-Id: Ib24f588cbe81ded768376c138d9d89f5bb311185
2013-02-21 15:58:38 +00:00
Pierre Freund
c9e6034c51 Typo error, "requied" -> "required" in run_tests.sh
Change-Id: I6ee8bdbd26cef373bb4be3bc18397819aa2a877b
2013-01-19 13:52:40 +08:00
Steven Hardy
06ed997784 run_tests.sh fixup venv/novenv logic
The section which prompts y/n for creating a new venv can never be
reached with any combination of CLI options (since always_venv=0 and
never_venv=0 can never happen simultaneously)

This actually makes the --no-virtual-env option pointless, so we may
as well remove it and explicitly set it as the default (it was anyway
previously but by virtue of the never_venv option being undefined)

Change-Id: I3c803533fda55a6814b7536b5c1328312acd3d57
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-12-20 15:37:29 +00:00
Steven Hardy
e098963e86 run_tests.sh cosmetic, make if/then style consistent
I introduced an inconsistent style with the pep8 check patch, so fixing this up here

Change-Id: I9a1a612172e493e0d2476c7f6613bbb9b9de2878
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-12-20 11:28:53 +00:00
Steven Hardy
ad24068745 run_tests.sh cosmetic cleanup indents
fix indents so it's consistent ts=4

Change-Id: I6fb2e7b3670bba00ad45d76d2dbb6b56c25281ff
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-12-20 11:26:34 +00:00
Steven Hardy
760a187640 update tox.ini to pep8 latest (1.3.4)
Most of the core projects are currently 1.3.3, but since 1.3.4 is
the current latest it seemed best to align with the latest.A
Also add a check to run_tests.sh to ensure peoples local tests align
with the new gate version

fixes bug 1092057

Change-Id: I16dc7e51536781f7a14b7954c24b1aa078b37fa8
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-12-20 10:53:40 +00:00
Steve Baker
f77c09c2a5 Rename heat client to heat-cfn.
This is to allow python-heatclient to eventually become the default heat
client.

Documentation in heat.wiki will be updated to refer to heat-cfn when this
change is pushed.

Change-Id: I2209c36adf41fa5d0df0caf9200f7fedbdd51805
2012-11-05 12:23:17 +13:00
Zane Bitter
9e237f5a66 Add the beginnings of an OpenStack ReST API
So far only access to stacks (not resources and events) is implemented.

Change-Id: I9655e9441087ef60c06e67e2d6ae68ec4a3b2d11
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-09-27 21:37:37 +02:00
Zane Bitter
fd2c75938a Return exit code rom run_tests.sh
Change-Id: Iddec2eb8e552f88bd04657536df094355b96b804
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-09-18 13:32:42 +02:00
Zane Bitter
2f9a1310e3 Rename heat-api to heat-api-cfn
The previous heat-api is, in fact, a CloudFormation-compatible API. Rename
it to heat-api-cfn, analogous to how the EC2 API in Nova is named
nova-api-ec2.

Change-Id: I9759f10cee6a60cdc9cb917966eb9fb95a618f85
Signed-off-by: Zane Bitter <zbitter@redhat.com>
2012-09-06 16:11:24 +02:00
Steven Hardy
1ce586c96c heat : run_tests.sh allow easier test selection
Allow each category of test (unit/funtional/pep) to be
more easily selected via CLI options, default with no args
remains unit+pep8

Change-Id: I85bbe0afe6170559a42f8c1619db24df16c6d9b0
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-08-31 18:27:48 +01:00
Jeff Peeler
43e558ff5e Add new arguments to run_tests
Execute unit tests and pep8 by default. Allow tests to be chosen in a more
additive fashion. Cleaned up unnecessary let statements and variable
defines.

Change-Id: I40676c5d0deda7bd3abc4bdadfd404f5909c166e
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
2012-08-29 16:44:56 -04:00
Jeff Peeler
8ba6c8ffe8 Split functional test into standalone and utility class
This allows functional tests to be written for each individual template.
See the test_Wordpress_Single_Instance for an example, but the basic
form to follow is:

import util

def test_template():
    func_utils = util.FuncUtils()

    func_utils.create_stack(template, 'F17')
    func_utils.check_cfntools()
    func_utils.wait_for_provisioning()
    func_utils.check_user_data(template)

    ssh = func_utils.get_ssh_client()

    # test stuff here

    func_utils.cleanup()

Functional test changes:
Changed jeos creation to use new tool.
Added distribution to heat stack creation.
Improved IP parsing from glance.
Improve SSH connection exception handling.
Changed cfntools SHA check to match installed copy instead of locally.
Fixed stack parsing to check correct file and handle user-data injection.

Clean up run_tests a little to make it clear default execution is on host.
Add a short option for unit test running only (may be important due to not
wanting to run functional tests locally).

Also added paramiko to test-requires.

Change-Id: Ib2ae1be32801cb0ee3d1937c4f82ab9f574b4591
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
2012-08-23 13:31:42 -04:00
Steven Hardy
9d0a22f92b heat : add heat-boto test client
Add initial version of the heat cli tool which uses boto
- revised following review comments to remove jeos/cfn paths
ref #92

Change-Id: I61b5815b250f3b01d33844ff46dd1612000d51fd
Signed-off-by: Steven Hardy <shardy@redhat.com>
2012-07-04 17:43:35 +01:00
Jeff Peeler
ee2076b2aa Add option to exclude pep8 examination to run_test.sh.
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
2012-05-08 14:41:21 -04:00
Jeff Peeler
d8b3a3387b Add test coverage option to run_tests.sh
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
2012-05-08 11:31:25 -04:00
Chris Alfonso
bdaed9b997 Added db setup and teardown with sqlite 2012-04-23 08:17:10 -04:00
Tomas Sedovic
6e9acd83ab Fix the test environment
Made sure that `run_tests.sh` works properly (it was failing on the heat/bin
directory) and that all tests pass and the generated logs are .gitignored.

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2012-04-18 11:29:48 +02:00
Jeff Peeler
2f8e95baec Add unit test framework nose and associated helper scripts
For usage documentation, refer to heat/tests/testing-overview.txt.
run_tests.sh is what runs the tests.

Fixes #44

Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
2012-04-13 17:10:30 -04:00
Angus Salkeld
6161c7aa85 Start separating the api and the implementation.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-03-20 12:58:54 +11:00