Commit Graph

50 Commits

Author SHA1 Message Date
Liam Young
b6fb4ecfa5 Merge pull request #8 from thedac/network-utils
Bring over network specific utilities
2018-04-11 07:27:31 +01:00
David Ames
bb884f4042 Merge pull request #9 from gnuoy/functest-utils-vault
Add vault specific setup, tests etc
2018-04-10 19:37:02 -07:00
David Ames
612eefe939 Docstrings and renames
Removed unused functions
Docstrings for all functions

Renamed test_utils to _local_utils to indicate use only by zaza
2018-04-10 17:04:57 -07:00
David Ames
22e7ffc1e1 Bring over network specific utilities
Bring over only those utilities required to run network_setup.py from
openstack-mojo-specs. These utilities have been generalized and python3
configured. Use libjuju whenever possible and pre-deprecate anything
else.

Add addition functions to the model.
2018-03-30 16:41:17 -07:00
David Ames
99710b5e83 Merge pull request #6 from gnuoy/functest-libjuju-model
Functest libjuju model
2018-03-29 10:01:49 -07:00
Liam Young
cb11ddd1e9 Fix skip decorator 2018-03-29 06:07:12 +00:00
Liam Young
8104b0e7fd Pull in new model file 2018-03-29 05:54:13 +00:00
Liam Young
fa43b720fb Fix tests given model updates 2018-03-29 05:40:54 +00:00
Liam Young
79f396eef7 Lint fixes 2018-03-29 05:40:54 +00:00
Liam Young
8c8bd82c7e Add temp model helpers 2018-03-29 05:39:57 +00:00
Liam Young
a1f80dced7 Add vault tests 2018-03-29 05:39:57 +00:00
Liam Young
117ae4127d Add function to scp file to all units 2018-03-29 05:35:49 +00:00
Liam Young
59a9b7f0cb Add helper utils for interacting with juju environment 2018-03-29 05:35:49 +00:00
David Ames
5c4c10af6b Merge pull request #4 from gnuoy/functest-fixes
Functest fixes
2018-03-28 10:02:46 -07:00
Liam Young
9bdd4763cc Close event loop in func_test_runner.main 2018-03-28 12:00:53 +00:00
Liam Young
f22b05f827 Fix unit tests 2018-03-28 11:56:29 +00:00
Liam Young
cb5d9caf66 Misc fixes to functional testing code
* Add calls to asyncio.get_event_loop().close() to close loop. libjuju does
  not do this for you and needs to be done just before exiting.
* Require model to be explicitly set when running command line tools. This is
  part of the drive to ensure that eventually multiple runs can be performed
  concurrently.
* Add set_juju_model/get_juju_model functions to manage which model is in
  focus
2018-03-28 11:48:53 +00:00
David Ames
7b154bb463 Merge pull request #1 from gnuoy/functest-utils
Add helps for charm functional tests
2018-03-27 07:48:03 -07:00
Liam Young
a47936361b Bump upper bound for flake8 to fix async lint errors 2018-03-27 13:21:28 +00:00
Liam Young
3d190f68f3 Fix generate_model_name 2018-03-27 12:45:59 +00:00
Liam Young
98f691b24e Fix setup.py after rename of charm_testing 2018-03-27 12:37:36 +00:00
Liam Young
353559528b s/charm_testing/charm_lifecycle/ and unit tests 2018-03-27 12:35:38 +00:00
Liam Young
5d61c46a81 Fix README typos 2018-03-26 13:34:02 +00:00
Liam Young
588fe78357 Remove old dir 2018-03-26 08:33:37 +00:00
Liam Young
3951d6f389 Fix lint 2018-03-26 08:32:38 +00:00
Liam Young
39d58c38be Remove old functests dir 2018-03-26 08:32:38 +00:00
Liam Young
86b99c1134 Refactor code to seperate phases out 2018-03-26 08:32:38 +00:00
Liam Young
38c3710a88 Add type info to doc strings 2018-03-26 08:32:38 +00:00
Liam Young
d61115a1e5 More docstraing fixes 2018-03-26 08:32:38 +00:00
Liam Young
cde3238afa Add docstrings 2018-03-26 08:32:38 +00:00
Liam Young
12c7363b34 Remove new unit_ips from mp, will add in as a seperate mp 2018-03-26 08:31:26 +00:00
Liam Young
a69f65f3fc Removing vault specific tests to cleanup mp 2018-03-26 08:31:26 +00:00
Liam Young
458a76f05a Add helps for charm functional tests
The idea of this change is to put together helpers for including
functional tests for charms in a central location. The charm
declares the tests and bundles to be run to complete a
functional tests but the tests themselves live here in zaza.

To use this code the charm should have the following:

1) zaza in the test-requirements.txt
2) tox.ini should include a target like:
```
[testenv:func35]
  basepython = python3
  commands =
    functest-bundle-deploy
```

3) Bundles which are to be used for the tests:
```
ls -1 tests/bundles/*
tests/bundles/xenial.yaml
```

4) A tests/tests.yaml file that describes the bundles to be run and
   the tests
```
charm_name: vault
tests:
  - zaza.charms_tests.vault.VaultTest
gate_bundles:
  - xenial
dev_bundles:
  - bionic
```

Tests can be run without running a deployment using functest-run-tests
with the list of test classes to be run:

```
functest-run-tests -t zaza.charms_tests.vault.VaultTest
```

Known Issues:

 - The deploy_bundle and add_model methods should be using libjuju
 - DEV_BUNDLES is currently ignored
 - VaultUtils and VaultTest should probably be in separate files.
 - When skipIfNotHA skips a test unittest does not pick up it has
   been skipped
 - A new model is created for each bundle even if an existing empty
   model exists
 - No model cleanup is performed.
2018-03-26 08:31:26 +00:00
Liam Young
7b7f616fe9 Add type info to doc strings 2018-03-26 08:28:10 +00:00
Liam Young
a7bba97b95 More docstraing fixes 2018-03-26 08:28:10 +00:00
Liam Young
c7e30d2516 Add docstrings 2018-03-26 08:28:10 +00:00
Liam Young
5e613051bc Remove new unit_ips from mp, will add in as a seperate mp 2018-03-26 08:28:10 +00:00
Liam Young
b36c9bde25 Removing vault specific tests to cleanup mp 2018-03-26 08:28:10 +00:00
Liam Young
502b96c772 Add helps for charm functional tests
The idea of this change is to put together helpers for including
functional tests for charms in a central location. The charm
declares the tests and bundles to be run to complete a
functional tests but the tests themselves live here in zaza.

To use this code the charm should have the following:

1) zaza in the test-requirements.txt
2) tox.ini should include a target like:
```
[testenv:func35]
  basepython = python3
  commands =
    functest-bundle-deploy
```

3) Bundles which are to be used for the tests:
```
ls -1 tests/bundles/*
tests/bundles/xenial.yaml
```

4) A tests/tests.yaml file that describes the bundles to be run and
   the tests
```
charm_name: vault
tests:
  - zaza.charms_tests.vault.VaultTest
gate_bundles:
  - xenial
dev_bundles:
  - bionic
```

Tests can be run without running a deployment using functest-run-tests
with the list of test classes to be run:

```
functest-run-tests -t zaza.charms_tests.vault.VaultTest
```

Known Issues:

 - The deploy_bundle and add_model methods should be using libjuju
 - DEV_BUNDLES is currently ignored
 - VaultUtils and VaultTest should probably be in separate files.
 - When skipIfNotHA skips a test unittest does not pick up it has
   been skipped
 - A new model is created for each bundle even if an existing empty
   model exists
 - No model cleanup is performed.
2018-03-26 08:28:10 +00:00
David Ames
5dbd8f10f0 Merge pull request #2 from openstack-charmers/add-travis
Add travis ci
2018-03-22 15:57:49 -07:00
Ryan Beisner
246cfd07b6 Update travis definition 2018-03-22 15:25:42 -05:00
Ryan Beisner
62c28c675b Move pep8 back to 3.6 due to async usage 2018-03-22 15:23:37 -05:00
Ryan Beisner
d6c07d1d72 Try to get travis to use xenial 2018-03-22 15:16:39 -05:00
Ryan Beisner
ce93194a1f Fix additional lint 2018-03-22 15:13:53 -05:00
Ryan Beisner
5bb735bb28 Fix existing lint 2018-03-22 15:10:58 -05:00
Ryan Beisner
58579384aa Allow pep8 tox target to use any py3 version 2018-03-22 14:29:45 -05:00
Ryan Beisner
ba2732024d Add travis ci 2018-03-22 14:26:40 -05:00
Chris MacNaughton
ddbbce3712 remove extra comments 2017-12-04 17:38:52 +01:00
Chris MacNaughton
895fbbad57 add current-apps script 2017-12-04 17:38:16 +01:00
Chris MacNaughton
c3e5adcb4d initial commit framing out stuff 2017-12-04 17:01:33 +01:00