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

Issue 100460044: New test suite: BaseSuite (Closed)

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

Description

New test suite: BaseSuite A new base test suite is introduced. It is to replace LoggingSuite as the preferred suite which all test suites should encapsulate. BaseSuite itseld encapsulates LoggingSuite, plus provides: - isolation of user home via creation of temp home and setting of $HOME - flag to ensure tests will error if outgoing network access is attempted Much of the implementation was moved across from testing/environs.go. There were a number of slightly different methods to create a fake Juju home setup - these have been consolidated and simplified. The flag to turn off outgoing network access when running tests is off until the tests are fixed. Not all tests have been updated to use the new suite; only those affected by the refactoring have been fixed for now. https://code.launchpad.net/~wallyworld/juju-core/network-test-isolation/+merge/219633 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 11

Patch Set 2 : New test suite: BaseSuite #

Total comments: 7

Patch Set 3 : New test suite: BaseSuite #

Unified diffs Side-by-side diffs Delta from patch set Stats (+617 lines, -628 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/envcmd/environmentcommand_test.go View 1 4 chunks +11 lines, -13 lines 0 comments Download
M cmd/filevar_test.go View 1 3 chunks +2 lines, -1 line 0 comments Download
M cmd/juju/authorizedkeys_test.go View 1 2 chunks +1 line, -13 lines 0 comments Download
M cmd/juju/bootstrap_test.go View 1 15 chunks +23 lines, -31 lines 0 comments Download
M cmd/juju/cmd_test.go View 1 2 chunks +1 line, -3 lines 0 comments Download
M cmd/juju/debuglog_test.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/helptool_test.go View 1 1 chunk +1 line, -9 lines 0 comments Download
M cmd/juju/init_test.go View 1 5 chunks +3 lines, -4 lines 0 comments Download
M cmd/juju/main_test.go View 1 3 chunks +0 lines, -3 lines 0 comments Download
M cmd/juju/plugin_test.go View 1 chunk +3 lines, -7 lines 0 comments Download
M cmd/juju/publish_test.go View 4 chunks +6 lines, -9 lines 0 comments Download
M cmd/juju/run_test.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/juju/switch_test.go View 1 5 chunks +17 lines, -19 lines 0 comments Download
M cmd/juju/synctools_test.go View 1 3 chunks +4 lines, -7 lines 0 comments Download
M cmd/jujud/machine_test.go View 1 chunk +1 line, -3 lines 0 comments Download
M cmd/plugins/juju-metadata/imagemetadata_test.go View 1 4 chunks +7 lines, -18 lines 0 comments Download
M cmd/plugins/juju-metadata/metadataplugin_test.go View 1 2 chunks +1 line, -9 lines 0 comments Download
M cmd/plugins/juju-metadata/toolsmetadata_test.go View 1 2 chunks +2 lines, -6 lines 0 comments Download
M cmd/plugins/juju-metadata/validateimagemetadata_test.go View 1 2 chunks +3 lines, -10 lines 0 comments Download
M cmd/plugins/juju-metadata/validatetoolsmetadata_test.go View 1 2 chunks +3 lines, -10 lines 0 comments Download
M container/lxc/testing/test.go View 1 2 chunks +3 lines, -3 lines 0 comments Download
M doc/how-to-write-tests.txt View 1 3 chunks +26 lines, -19 lines 0 comments Download
M environs/bootstrap/bootstrap_test.go View 2 chunks +3 lines, -7 lines 0 comments Download
M environs/config/config_test.go View 1 14 chunks +35 lines, -50 lines 0 comments Download
M environs/config_test.go View 1 11 chunks +8 lines, -15 lines 0 comments Download
M environs/emptystorage_test.go View 1 4 chunks +8 lines, -8 lines 0 comments Download
M environs/imagemetadata/urls_test.go View 1 chunk +3 lines, -6 lines 0 comments Download
M environs/open_test.go View 1 13 chunks +19 lines, -20 lines 0 comments Download
M environs/storage/storage_test.go View 1 3 chunks +4 lines, -3 lines 0 comments Download
M environs/sync/sync_test.go View 1 6 chunks +9 lines, -10 lines 0 comments Download
M environs/tools/urls_test.go View 1 chunk +3 lines, -6 lines 0 comments Download
M juju/apiconn_test.go View 1 18 chunks +19 lines, -26 lines 0 comments Download
M juju/conn_test.go View 1 4 chunks +9 lines, -9 lines 0 comments Download
M juju/testing/conn.go View 1 4 chunks +5 lines, -6 lines 0 comments Download
M provider/common/bootstrap_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M provider/common/supportedarchitectures_test.go View 1 chunk +1 line, -1 line 0 comments Download
M provider/joyent/config_test.go View 2 chunks +3 lines, -3 lines 0 comments Download
M provider/joyent/joyent_test.go View 2 chunks +5 lines, -5 lines 0 comments Download
M provider/local/environprovider_test.go View 1 chunk +2 lines, -5 lines 0 comments Download
M provider/manual/config_test.go View 1 chunk +1 line, -1 line 0 comments Download
M provider/manual/environ_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M provider/manual/provider_test.go View 1 chunk +2 lines, -2 lines 0 comments Download
M provider/openstack/config_test.go View 3 chunks +4 lines, -8 lines 0 comments Download
A testing/base.go View 1 1 chunk +127 lines, -0 lines 0 comments Download
A testing/base_test.go View 1 1 chunk +40 lines, -0 lines 0 comments Download
M testing/environ.go View 1 2 chunks +43 lines, -154 lines 0 comments Download
D testing/environ_test.go View 1 2 1 chunk +54 lines, -0 lines 0 comments Download
D testing/environ_test.go View 2 1 chunk +0 lines, -56 lines 0 comments Download
M upgrades/dotprofile_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M upgrades/lockdirectory_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M utils/export_test.go View 1 1 chunk +2 lines, -0 lines 0 comments Download
M utils/http.go View 1 2 4 chunks +25 lines, -0 lines 0 comments Download
M utils/http_test.go View 1 2 3 chunks +49 lines, -6 lines 0 comments Download
M utils/ssh/authorisedkeys_test.go View 1 3 chunks +2 lines, -9 lines 0 comments Download
M utils/ssh/clientkeys_test.go View 1 1 chunk +2 lines, -5 lines 0 comments Download

Messages

Total messages: 9
wallyworld
Please take a look.
9 years, 11 months ago (2014-05-15 05:25:22 UTC) #1
axw
A couple of little things to fix, but otherwise looking good. I'm a little worried ...
9 years, 11 months ago (2014-05-15 07:52:13 UTC) #2
fwereade
pre-comment: most of our tests should not have a $HOME, or a $JUJU_HOME, at all. ...
9 years, 11 months ago (2014-05-15 09:48:44 UTC) #3
fwereade
On 2014/05/15 09:48:44, fwereade wrote: > pre-comment: most of our tests should not have a ...
9 years, 11 months ago (2014-05-15 12:49:31 UTC) #4
wallyworld
Please take a look. https://codereview.appspot.com/100460044/diff/1/cmd/plugins/juju-metadata/imagemetadata_test.go File cmd/plugins/juju-metadata/imagemetadata_test.go (left): https://codereview.appspot.com/100460044/diff/1/cmd/plugins/juju-metadata/imagemetadata_test.go#oldcode56 cmd/plugins/juju-metadata/imagemetadata_test.go:56: for _, envstring := range ...
9 years, 11 months ago (2014-05-16 01:36:10 UTC) #5
axw
LGTM with a few small changes https://codereview.appspot.com/100460044/diff/20001/testing/environ_test.go File testing/environ_test.go (right): https://codereview.appspot.com/100460044/diff/20001/testing/environ_test.go#newcode55 testing/environ_test.go:55: // Copyright 2013 ...
9 years, 11 months ago (2014-05-16 02:31:32 UTC) #6
wallyworld
Please take a look. https://codereview.appspot.com/100460044/diff/20001/testing/environ_test.go File testing/environ_test.go (right): https://codereview.appspot.com/100460044/diff/20001/testing/environ_test.go#newcode55 testing/environ_test.go:55: // Copyright 2013 Canonical Ltd. ...
9 years, 11 months ago (2014-05-16 03:03:54 UTC) #7
axw
https://codereview.appspot.com/100460044/diff/20001/utils/http_test.go File utils/http_test.go (right): https://codereview.appspot.com/100460044/diff/20001/utils/http_test.go#newcode106 utils/http_test.go:106: func (s *dialSuite) assertDial(c *gc.C, addr string, allowDial bool) ...
9 years, 11 months ago (2014-05-16 03:37:36 UTC) #8
wallyworld
9 years, 11 months ago (2014-05-16 04:06:10 UTC) #9
On 2014/05/16 03:37:36, axw wrote:
> https://codereview.appspot.com/100460044/diff/20001/utils/http_test.go
> File utils/http_test.go (right):
> 
>
https://codereview.appspot.com/100460044/diff/20001/utils/http_test.go#newcod...
> utils/http_test.go:106: func (s *dialSuite) assertDial(c *gc.C, addr string,
> allowDial bool) {
> On 2014/05/16 03:03:54, wallyworld wrote:
> > On 2014/05/16 02:31:32, axw wrote:
> > > no point in having allowDial is there? it should never be false, since you
> > > should get an outer error before the net.Dial attempt
> > > I'd drop the parameter and just c.Assert(dialed, jc.IsFalse)
> > 
> > allowDial can be either true or false depending on whether outgoing access
> > should be allowed. See the tests below.
> 
> I looked at them. There's only two, and they both pass in true. It wouldn't
make
> sense to pass in false, because it shouldn't be possible. If allowDial ==
false,
> then you should get an error instead.

Ignore me, I had deleted some other tests and didn't refactor right.
Sign in to reply to this message.

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