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

Issue 7204055: Error testing infrastructure for service doubles (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by wallyworld
Modified:
11 years, 2 months ago
Reviewers:
mp+144838
Visibility:
Public.

Description

Error testing infrastructure for service doubles This branch provides infrastructure to allow tests to specify that the service doubles should return an error at various points. The basic premise is that the test provides a hook which is run at the specfied point in time eg when a specific function runs. The hook is passed the service double and any function arguments. It can inspect the state of the service and the function args and can decide to return an error if it wants to. The diff conatins a practical example of this being used - 3 security groups are created and an error is raised when the second one is deleted. This work doesn't have to be used to raise an error - the hook can also be used to modify the sate of the service double and simply exit without error. https://code.launchpad.net/~wallyworld/goose/control-test-doubles/+merge/144838 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 10

Patch Set 2 : Error testing infrastructure for service doubles #

Patch Set 3 : Error testing infrastructure for service doubles #

Patch Set 4 : Error testing infrastructure for service doubles #

Patch Set 5 : Error testing infrastructure for service doubles #

Patch Set 6 : Error testing infrastructure for service doubles #

Patch Set 7 : Error testing infrastructure for service doubles #

Patch Set 8 : Error testing infrastructure for service doubles #

Patch Set 9 : Error testing infrastructure for service doubles #

Unified diffs Side-by-side diffs Delta from patch set Stats (+235 lines, -29 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M client/local_test.go View 1 2 chunks +2 lines, -2 lines 0 comments Download
M identity/live_test.go View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -3 lines 0 comments Download
M nova/local_test.go View 1 2 chunks +2 lines, -2 lines 0 comments Download
M swift/local_test.go View 1 3 chunks +3 lines, -3 lines 0 comments Download
M testservices/novaservice/service.go View 2 chunks +4 lines, -0 lines 0 comments Download
M testservices/openstackservice/openstack.go View 1 2 chunks +11 lines, -11 lines 0 comments Download
M testservices/service.go View 1 2 chunks +71 lines, -0 lines 0 comments Download
A testservices/service_test.go View 1 1 chunk +105 lines, -0 lines 0 comments Download
M tools/secgroup-delete-all/main_test.go View 1 5 chunks +32 lines, -8 lines 0 comments Download

Messages

Total messages: 5
wallyworld
Please take a look.
11 years, 2 months ago (2013-01-25 02:06:56 UTC) #1
jameinel
overall LGTM. A couple small things that we can tweak, but I like the overall ...
11 years, 2 months ago (2013-01-28 06:13:58 UTC) #2
wallyworld
Please take a look. https://codereview.appspot.com/7204055/diff/1/testservices/service.go File testservices/service.go (right): https://codereview.appspot.com/7204055/diff/1/testservices/service.go#newcode65 testservices/service.go:65: // } On 2013/01/28 06:13:58, ...
11 years, 2 months ago (2013-01-29 00:46:34 UTC) #3
jameinel
LGTM
11 years, 2 months ago (2013-01-29 11:56:57 UTC) #4
wallyworld
11 years, 2 months ago (2013-01-29 13:15:37 UTC) #5
*** Submitted:

Error testing infrastructure for service doubles

This branch provides infrastructure to allow tests to specify that the service
doubles should return an error at various points.
The basic premise is that the test provides a hook which is run at the specfied
point in time eg when a specific function runs. 
The hook is passed the service double and any function arguments. It can inspect
the state of the service and the function args and
can decide to return an error if it wants to.

The diff conatins a practical example of this being used - 3 security groups are
created and an error is raised when the second one is deleted.

This work doesn't have to be used to raise an error - the hook can also be used
to modify the sate of the service double and simply exit without error.

R=jameinel
CC=
https://codereview.appspot.com/7204055
Sign in to reply to this message.

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