Merge lp://staging/~javier.collado/utah/returncodes into lp://staging/utah

Proposed by Javier Collado
Status: Merged
Approved by: Javier Collado
Approved revision: 838
Merged at revision: 830
Proposed branch: lp://staging/~javier.collado/utah/returncodes
Merge into: lp://staging/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://staging/~javier.collado/utah/returncodes
Reviewer Review Type Date Requested Status
UTAH Dev Pending
Review via email: mp+152447@code.staging.launchpad.net

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_ERROR (1) - UTAH exception caught
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.

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

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:
     SUCCESS = 0
     UTAH_EXCEPTION_ERROR = 1
...

    @staticmethod
    def client_error(rc):
        return 100 + rc

then there aren't hard-coded strings.

837. By Javier Collado

Refactored server return codes to use a class instead of a dictionary

Suggested by Andy

838. By Javier Collado

Refactored client return codes to use a class instead of a dictionary

Suggested by Andy

Revision history for this message
Javier Collado (javier.collado) wrote :

@Andy

I've updated the dictionaries to use classes instead. Thanks for the suggestion.

Revision history for this message
Andy Doan (doanac) wrote :

looks good to me.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches