Merge lp:~javier.collado/utah/returncodes into lp:utah
Status: | Merged |
---|---|
Approved by: | Javier Collado |
Approved revision: | 838 |
Merged at revision: | 830 |
Proposed branch: | lp:~javier.collado/utah/returncodes |
Merge into: | lp:utah |
Diff against target: |
391 lines (+75/-35) 11 files modified
debian/changelog (+3/-0) examples/run_install_test.py (+4/-3) examples/run_test_bamboo_feeder.py (+4/-3) examples/run_test_cobbler.py (+4/-3) examples/run_test_vm.py (+4/-3) examples/run_utah_tests.py (+5/-4) utah/client/common.py (+15/-8) utah/client/result.py (+1/-4) utah/client/runner.py (+4/-4) utah/client/tests/test_runner.py (+2/-2) utah/run.py (+29/-1) |
To merge this branch: | bzr merge lp:~javier.collado/utah/returncodes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UTAH Dev | Pending | ||
Review via email:
|
Description of the change
This branch intend is to clarify the client/server return codes and make it
possible to know from the server return code if a failure happened either at
the client or at the server.
The set of possible return codes is as follows:
- Client
PASS (0) - All test cases where executed and passed
FAIL (1) - All test cases where executed, but at least one of them failed
ERROR (2) - At least one error was detected that prevented a test case from
being executed.
- Server
SUCCESS (0) - No problems found
UTAH_EXCEPTION_
TIMEOUT_ERROR (2) - Unable to complete before config.jobtimeout seconds
GROUP_ERROR (3) - User isn't in UTAH group
FAIL (101) - All test cases where executed, but at least one of them failed
ERROR (102) - At least one error was detected that prevented a test case from
being executed.
Note that the convention followed in the server is that when the client returns
an error 100 is added to that code to make clear what errors came from the
server and what errors came from the client. This might be useful in jenkins
jobs in which the actions following the test run depend on the test execution
results.
To test this I've used different variations of the pass.run (and its testsuite)
to make sure that the codes above work as expected. Anyway, I haven't tested
some error codes in the server (1-3) as only the return code number might have
changed, but the code is almost the same as before the change.
Looks pretty good. It will be nice to consolidate run_* stuff to make changes like this easier :)
One thing I was wondering about: rather than using dictionaries for return codes would it be better to do something like:
class ReturnCode: EXCEPTION_ ERROR = 1
SUCCESS = 0
UTAH_
...
@staticmethod
def client_error(rc):
return 100 + rc
then there aren't hard-coded strings.