Merge lp:~natefinch/juju-ci-tools/logrot into lp:juju-ci-tools
| Status: | Merged |
|---|---|
| Merged at revision: | 976 |
| Proposed branch: | lp:~natefinch/juju-ci-tools/logrot |
| Merge into: | lp:juju-ci-tools |
| Diff against target: |
1215 lines (+661/-135) 8 files modified
assess_log_rotation.py (+228/-0) assess_recovery.py (+4/-21) check_blockers.py (+4/-6) jujupy.py (+98/-5) test_assess_log_rotation.py (+154/-0) test_assess_recovery.py (+0/-60) test_deploy_stack.py (+17/-17) test_jujupy.py (+156/-26) |
| To merge this branch: | bzr merge lp:~natefinch/juju-ci-tools/logrot |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Aaron Bentley (community) | 2015-05-21 | Approve on 2015-06-03 | |
|
Review via email:
|
|||
Description of the Change
Implements action do and fetch in jujupy, and uses them in tests for log rotation. Requires new charm in the repository, which will be proposed shortly.
| Nate Finch (natefinch) wrote : | # |
The test intentionally uses a charm, because it represents a real world situation where the charm is the thing outputting a lot of logging. I don't know that I could reasonably create a juju run command that would do the same thing. This seemed like the most easy to understand way to get the job done. I could use juju shh to get the size of the logs, but since I already had the charm and actions, it seemed easy enough to just make that another action.
| Aaron Bentley (abentley) wrote : | # |
> The test intentionally uses a charm, because it represents a real world
> situation where the charm is the thing outputting a lot of logging. I don't
> know that I could reasonably create a juju run command that would do the same
> thing.
You can log in a hook context and juju run has a hook context, though, right?
I'll accept a version that is not self-contained, I just wondered whether it was possible.
| Nate Finch (natefinch) wrote : | # |
I think I addressed all your concerns. I ended up refactoring some of the helper functions in assess_recovery, since they were needed for my test as well.
| Aaron Bentley (abentley) wrote : | # |
Thanks.
Please don't add things to deploy_stack unless they are used by deploy_stack (i.e. deploy_job) itself. (The history is that deploy_stack was the first script, so some of its functionality has been reused in other scripts.)
Please don't add anything at all to jujuconfig. That is essentially an import from https:/
I see that you have not addressed the inline comments about KeyError and tuple formattting. Please go back and make sure you've addressed all the inline comments.
| Nate Finch (natefinch) wrote : | # |
Sorry about missing your inline comments... I haven't done a review on launchpad in about a year, so forgot that I had to scroll down to look for more comments.
I have a patch coming that will address all these issues.
- 961. By Nate Finch on 2015-05-23
-
more review changes
| Aaron Bentley (abentley) wrote : | # |
I think that you haven't run "make lint", because I see some lines longer than 79 characters. Please run "make lint" and fix any issues you find.
Please document all functions in assess_
Please test parse_args.
See also inline comments.
| Aaron Bentley (abentley) wrote : | # |
Also, I think you missed this:
Juju 1.22 is still under development. Please ensure that these actions work with 1.22 by specifying the appropriate feature flag when the version is 1.22. See EnvJujuClient24 for an example.
- 962. By Nate Finch on 2015-06-01
-
more code review changes
- 963. By Nate Finch on 2015-06-02
-
merge
- 964. By Nate Finch on 2015-06-02
-
set longer timeout for fill log actions, and fix -e testing problem
| Nate Finch (natefinch) wrote : | # |
Ok, for real now, I think I addressed everything.
- 965. By Nate Finch on 2015-06-02
-
remove unneeded wait
| Aaron Bentley (abentley) wrote : | # |
This is almost landable, but there are still a few issues.
| Aaron Bentley (abentley) wrote : | # |
Also, TestEnvJujuClient22 needs client_class set to EnvJujuClient22.
- 966. By Nate Finch on 2015-06-03
-
more code review changes
| Nate Finch (natefinch) wrote : | # |
Ok, updated once again. Addressed your concerns.
- 967. By Nate Finch on 2015-06-03
-
one more fix to TestEnvJujuClient22

Environment is deprecated. It should not be used for new scripts, and it should not be extended.
If you're going to remove '-e', you need to specify the environment somehow. Since "action fetch" and "action do" both support -e, I don't think you actually want to remove it. You just want to make the command handling smarter, so that it puts the -e after "do" or "fetch".
Please allow the juju under test to be specified at the commandline.
Please use temp_bootstrap_ env(). At minimum, that will ensure that 'test-mode' is always True, but it will also allow us to support configuration variations such as changing the tools-url.
It would be nice if the test was self-contained. It is important that unit-fill-logs-0 and fill-machine be actions, or could they be run via "juju run" or "juju ssh"? That would allow the test script to use a generic charm instead.
Please add unit tests for log_rotation.py.
Please rename it to something that indicates it is a test. I suggest "assess_ log_rotation" . ("test" itself indicates that it is a unit test).
Juju 1.22 is still under development. Please ensure that these actions work with 1.22 by specifying the appropriate feature flag when the version is 1.22. See EnvJujuClient24 for an example.