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

Issue 7225082: Test helper for building fake environment configs. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by jtv.canonical
Modified:
10 years, 9 months ago
Reviewers:
dimitern, TheMue, mp+146059, rog
Visibility:
Public.

Description

Test helper for building fake environment configs. The config tests in both the ec2 and openstack environment provider repeat the same code to set up and verify environment configs. With MAAS we're about to add another use. And so in this branch I extract a part of this code that is not specific to a given provider. An alternative would have been to cargo-cult yet another copy of this code and write similar data-driven tests, but with this much code inbetween and this little documentation, it's not clear what the meaning of those tests would be or what coverage is. https://code.launchpad.net/~jtv/juju-core/config-test-helper/+merge/146059 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Test helper for building fake environment configs. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -47 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/ec2/config_test.go View 2 chunks +7 lines, -26 lines 0 comments Download
M environs/openstack/config_test.go View 2 chunks +7 lines, -21 lines 0 comments Download
A environs/testing/config.go View 1 chunk +48 lines, -0 lines 1 comment Download

Messages

Total messages: 5
jtv.canonical
Please take a look.
11 years, 3 months ago (2013-02-01 11:54:17 UTC) #1
dimitern
Very nice, LGTM! I'd like to see more of the common code refactored across providers ...
11 years, 3 months ago (2013-02-01 12:04:17 UTC) #2
TheMue
LGTM, will help me with the local provider too.
11 years, 3 months ago (2013-02-01 12:19:21 UTC) #3
rog
i'm not sure about this. i think that most of the code that's factored out ...
11 years, 3 months ago (2013-02-01 17:52:19 UTC) #4
jtv.canonical
11 years, 3 months ago (2013-02-04 03:55:10 UTC) #5
As John also pointed out, I think you're removing test coverage — although of
course given the poor commenting of the original code it's hard to say what the
intent was.

It looks to me as if the roundtrip should have been a separate test and could
have been run just once.  I'll try writing it up that way.  We must get the
duplication under control in any event, because we're talking about 4 instances
of the same testing support now.

Having yet another testing package is unfortunate, but it seems to be the Go
way.  The jujutest package seems to be specifically for testing against a real
server.
Sign in to reply to this message.

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