Merge lp:~frankban/juju-quickstart/ftest-fixes into lp:juju-quickstart
Proposed by
Francesco Banconi
Status: | Merged |
---|---|
Merged at revision: | 118 |
Proposed branch: | lp:~frankban/juju-quickstart/ftest-fixes |
Merge into: | lp:juju-quickstart |
Diff against target: |
116 lines (+46/-11) 2 files modified
HACKING.rst (+2/-1) quickstart/tests/functional/test_functional.py (+44/-10) |
To merge this branch: | bzr merge lp:~frankban/juju-quickstart/ftest-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+248755@code.launchpad.net |
Description of the change
Make ftests fail if Juju env is not ready.
The functional tests are no longer silently skipped
if the default Juju environment cannot be found.
Also fail if the environment is running, as this
would cause it to be destroyed at the end of the
suite.
QA:
- bootstrap your default environment;
- run `make ftest`/`make fcheck` and ensure
the functional tests fail
(environment already bootstrapped);
- destroy your environment;
- run `make fcheck` again and ensure all the
suites complete successfully.
To post a comment you must log in.
Reviewers: mp+248755_ code.launchpad. net,
Message:
Please take a look.
Description:
Make ftests fail if Juju env is not ready.
The functional tests are no longer silently skipped
if the default Juju environment cannot be found.
Also fail if the environment is running, as this
would cause it to be destroyed at the end of the
suite.
QA:
- bootstrap your default environment;
- run `make ftest`/`make fcheck` and ensure
the functional tests fail
(environment already bootstrapped);
- destroy your environment;
- run `make fcheck` again and ensure all the
suites complete successfully.
https:/ /code.launchpad .net/~frankban/ juju-quickstart /ftest- fixes/+ merge/248755
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/195690043/
Affected files (+48, -11 lines): tests/functiona l/test_ functional. py
M HACKING.rst
A [revision details]
M quickstart/
Index: HACKING.rst nts.yaml` ` file;
=== modified file 'HACKING.rst'
--- HACKING.rst 2015-01-30 18:06:46 +0000
+++ HACKING.rst 2015-02-05 13:35:53 +0000
@@ -85,6 +85,7 @@
bootstrapped in the process;
- a Juju home correctly set up with at least one environment defined in the
``environme
+- the selected Juju environment not to be in use;
- SSH keys already generated for the user running the tests;
- a working Internet connection.
@@ -94,7 +95,7 @@
make fcheck JUJU_ENV=myenv
The environment used by the functional suite is destroyed after the tests
-complete. For this reason, **ensure the selected environment is not in
use**.
+complete. The tests fail the selected environment is already in use.
To run the test using a customized build of Juju, pass the ``JUJU``
environment
variable to ``make``, e.g.::
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision:
<email address hidden>
Index: quickstart/ tests/functiona l/test_ functional. py tests/functiona l/test_ functional. py' tests/functiona l/test_ functional. py 2015-02-03 14:13:09 +0000 tests/functiona l/test_ functional. py 2015-02-05 12:19:48 +0000 T_FTESTS'
=== modified file 'quickstart/
--- quickstart/
+++ quickstart/
@@ -36,27 +36,55 @@
FTEST_ENV_VAR = 'JUJU_QUICKSTAR
-def skip_if_ disbled( func): possible. """ fail_if_ environment_ not_ready( func): FTEST_ENV_ VAR) != '1': FTEST_ENV_ VAR)) default_ env_name( ) skip('cannot find a configured Juju environment')
- """Decorate a test method so that it is only run when
required/
+def skip_or_
+ """Decorate a test method so that it is only run when asked.
+
+ Also fail if the Juju environment is already running, or if the default
+ environment cannot be found.
+ """
# Check that functional tests are enabled.
if os.getenv(
return unittest.skip(
'to run functional tests, set {} to "1"'.format(
- # Check that a Juju environment can be found.
- env_name = envs.get_
- if env_name is None:
- return unittest.
@fun...