Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(15648)

Issue 7137054: Use import instead of subprocess for charm proof.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by j.c.sackett
Modified:
11 years, 3 months ago
Reviewers:
curtis, mp+143790, abentley-home, hazmat
Visibility:
Public.

Description

Use import instead of subprocess for charm proof. To speed up proof, we use the newly created proof lib in charm-tools instead of a call out to "charm proof" via subprocess. * Replace config.CHARM_PROOF_BIN with config.CHARM_PROOF_PATH, a path to the library's parent dir. * Added patch_path and unpatch_path, which (within a try...finally block) safely manage modifying the path during the job's `run` method. * Removed exception handling that required subprocess management, as we know longer have that; this sadly leaves us with only the "Exception" clause around the call to proof_charm, since we can't capture the data from the subprocess stream. * Updates the checks for a functioning binary with checks that the lib path exists. * Updated the error messages and tests. As a note; the previous version of this set CHARM_PROOF_PATH to $charm-tool-dir/script/lib, and imported proof. As the name of the job is proof, and both methods are "run" this led to a really fun bug. We now import lib.proof as prooflib, and point the CHARM_PROOF_PATH to the parent directory of the proof lib. This works just fine. https://code.launchpad.net/~jcsackett/charmworld/use-libified-proof/+merge/143790 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Use import instead of subprocess for charm proof. #

Total comments: 6

Patch Set 3 : Use import instead of subprocess for charm proof. #

Total comments: 6

Patch Set 4 : Use import instead of subprocess for charm proof. #

Patch Set 5 : Use import instead of subprocess for charm proof. #

Patch Set 6 : Use import instead of subprocess for charm proof. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -58 lines) Patch
A [revision details] View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M charmworld/jobs/config.py View 1 2 1 chunk +1 line, -1 line 0 comments Download
M charmworld/jobs/proof.py View 1 2 3 4 5 1 chunk +50 lines, -48 lines 1 comment Download
M charmworld/jobs/tests/test_proof.py View 1 2 3 1 chunk +9 lines, -9 lines 0 comments Download

Messages

Total messages: 16
j.c.sackett
Please take a look.
11 years, 3 months ago (2013-01-17 22:19:24 UTC) #1
j.c.sackett
Please take a look.
11 years, 3 months ago (2013-01-17 22:20:09 UTC) #2
hazmat
some concerns about the runtime sys.path manipulation as well as the use of globals in ...
11 years, 3 months ago (2013-01-18 15:01:13 UTC) #3
curtis
lgtm. I have a suggestion that may make the operation more robust. https://codereview.appspot.com/7137054/diff/3001/charmworld/jobs/proof.py File charmworld/jobs/proof.py ...
11 years, 3 months ago (2013-01-18 15:01:24 UTC) #4
hazmat
one more concern. https://codereview.appspot.com/7137054/diff/3001/charmworld/jobs/proof.py File charmworld/jobs/proof.py (right): https://codereview.appspot.com/7137054/diff/3001/charmworld/jobs/proof.py#newcode23 charmworld/jobs/proof.py:23: proof.run(charm['branch_dir']) also this needs a try/except ...
11 years, 3 months ago (2013-01-18 15:02:20 UTC) #5
j.c.sackett
https://codereview.appspot.com/7137054/diff/3001/charmworld/jobs/proof.py File charmworld/jobs/proof.py (right): https://codereview.appspot.com/7137054/diff/3001/charmworld/jobs/proof.py#newcode21 charmworld/jobs/proof.py:21: sys.path.append(config.CHARM_PROOF_PATH) On 2013/01/18 15:01:13, hazmat wrote: > this should ...
11 years, 3 months ago (2013-01-18 15:24:13 UTC) #6
j.c.sackett
Please take a look.
11 years, 3 months ago (2013-01-18 22:35:20 UTC) #7
hazmat
https://codereview.appspot.com/7137054/diff/5002/charmworld/jobs/proof.py File charmworld/jobs/proof.py (right): https://codereview.appspot.com/7137054/diff/5002/charmworld/jobs/proof.py#newcode42 charmworld/jobs/proof.py:42: try: in general this sort of usage lock/unlock is ...
11 years, 3 months ago (2013-01-22 14:19:40 UTC) #8
abentley-home
https://codereview.appspot.com/7137054/diff/5002/charmworld/jobs/proof.py File charmworld/jobs/proof.py (right): https://codereview.appspot.com/7137054/diff/5002/charmworld/jobs/proof.py#newcode15 charmworld/jobs/proof.py:15: raise OSError('[Errno 2] No such file or directory') Please ...
11 years, 3 months ago (2013-01-22 15:08:40 UTC) #9
j.c.sackett
I've addressed all comments, and done quite a bit of experimenting today to see if ...
11 years, 3 months ago (2013-01-22 21:41:49 UTC) #10
j.c.sackett
Please take a look.
11 years, 3 months ago (2013-01-22 21:42:52 UTC) #11
j.c.sackett
Please take a look.
11 years, 3 months ago (2013-01-22 22:13:06 UTC) #12
abentley-home
On 2013/01/22 22:13:06, j.c.sackett wrote: > Please take a look. lgtm
11 years, 3 months ago (2013-01-22 22:14:46 UTC) #13
hazmat
On 2013/01/22 22:13:06, j.c.sackett wrote: > Please take a look. glad to see the context ...
11 years, 3 months ago (2013-01-23 13:29:44 UTC) #14
j.c.sackett
Please take a look.
11 years, 3 months ago (2013-01-23 15:42:23 UTC) #15
hazmat
11 years, 3 months ago (2013-01-24 14:59:03 UTC) #16
https://codereview.appspot.com/7137054/diff/18001/charmworld/jobs/proof.py
File charmworld/jobs/proof.py (right):

https://codereview.appspot.com/7137054/diff/18001/charmworld/jobs/proof.py#ne...
charmworld/jobs/proof.py:66: log.exception(
almost there. as noted in previous review comment. an error/exception in running
proof lint on a charm should result in us recording an error against the charm.
else a potentially badly broken charm, looks like its green wrt to lint.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b