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

Issue 6862053: state: more expressive testing proposal

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 5 months ago by fwereade
Modified:
11 years, 4 months ago
Reviewers:
mp+138465, niemeyer
Visibility:
Public.

Description

state: more expressive testing proposal This shouldn't go in on its own -- I should fix up the rest of the state tests before I merge it (and I don't want to fix machine_test until we've dropped the orgiginal WatchPrincipalUnits implementation) but I think that AssignSuite was a good enough test bed to evaluate the sanity of this approach. In particular, I found that even a few lines saved here and there made it much easier to follow the tests, and to notice both redundant tests and missing ones; and that in some cases a *lot* of lines were saved. I'm not sure AssignSuite uses all the new ConnSuite features yet (they were originally written against machine_test, but then I got demoralised) but I'm pretty sure that they will be useful; if not, of course, I'll trash them. https://code.launchpad.net/~fwereade/juju-core/strawman-state-test-simplification/+merge/138465 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+308 lines, -361 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M state/assign_test.go View 10 chunks +203 lines, -353 lines 0 comments Download
M state/conn_test.go View 4 chunks +92 lines, -0 lines 13 comments Download
M state/life_test.go View 1 chunk +1 line, -1 line 0 comments Download
M state/unit.go View 5 chunks +10 lines, -7 lines 0 comments Download

Messages

Total messages: 10
fwereade
Please take a look.
11 years, 5 months ago (2012-12-06 14:21:30 UTC) #1
niemeyer
https://codereview.appspot.com/6862053/diff/1/state/conn_test.go File state/conn_test.go (right): https://codereview.appspot.com/6862053/diff/1/state/conn_test.go#newcode99 state/conn_test.go:99: func (cs *ConnSuite) AddService(c *C, charmName string) *state.Service { ...
11 years, 5 months ago (2012-12-06 14:43:17 UTC) #2
fwereade
Good comments, thanks. https://codereview.appspot.com/6862053/diff/1/state/conn_test.go File state/conn_test.go (right): https://codereview.appspot.com/6862053/diff/1/state/conn_test.go#newcode99 state/conn_test.go:99: func (cs *ConnSuite) AddService(c *C, charmName ...
11 years, 5 months ago (2012-12-06 15:02:36 UTC) #3
fwereade
https://codereview.appspot.com/6862053/diff/1/state/conn_test.go File state/conn_test.go (right): https://codereview.appspot.com/6862053/diff/1/state/conn_test.go#newcode99 state/conn_test.go:99: func (cs *ConnSuite) AddService(c *C, charmName string) *state.Service { ...
11 years, 5 months ago (2012-12-06 15:38:02 UTC) #4
niemeyer
https://codereview.appspot.com/6862053/diff/1/state/conn_test.go File state/conn_test.go (right): https://codereview.appspot.com/6862053/diff/1/state/conn_test.go#newcode99 state/conn_test.go:99: func (cs *ConnSuite) AddService(c *C, charmName string) *state.Service { ...
11 years, 5 months ago (2012-12-06 16:04:25 UTC) #5
fwereade
quick comments; mileage may vary https://codereview.appspot.com/6862053/diff/1/state/conn_test.go File state/conn_test.go (right): https://codereview.appspot.com/6862053/diff/1/state/conn_test.go#newcode99 state/conn_test.go:99: func (cs *ConnSuite) AddService(c ...
11 years, 5 months ago (2012-12-06 18:08:19 UTC) #6
niemeyer
https://codereview.appspot.com/6862053/diff/1/state/conn_test.go File state/conn_test.go (right): https://codereview.appspot.com/6862053/diff/1/state/conn_test.go#newcode99 state/conn_test.go:99: func (cs *ConnSuite) AddService(c *C, charmName string) *state.Service { ...
11 years, 5 months ago (2012-12-06 19:32:18 UTC) #7
niemeyer
Is there a pending conversation to move this forward?
11 years, 4 months ago (2012-12-12 18:07:02 UTC) #8
fwereade
No -I'm comfortable with your suggestions and will be picking it up again and working ...
11 years, 4 months ago (2012-12-13 10:43:21 UTC) #9
niemeyer
11 years, 4 months ago (2012-12-13 14:38:54 UTC) #10
Sounds good, thanks. I'll mark it as WIP then.
Sign in to reply to this message.

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