Rename state methods and other artefacts from service to application #5509

Merged
merged 103 commits into from Jun 2, 2016

Conversation

Projects
None yet
10 participants
Owner

wallyworld commented Jun 1, 2016

Branch 3 in the service to application rename adventure.
Here we rename state methods and other artefacts, plus some testing factory methods.
As a driveby, delete some old uniter upgrade steps.

(Review request: http://reviews.vapour.ws/r/4955/)

babbageclunk and others added some commits May 13, 2016

WIP: keep database between tests
Instead of deleting the state database between tests, keep it but clear
out the collections between tests.

Doesn't work at the moment - when trying to repopulate the model after
clearing all of the collections PopulateEmptyModel hangs at
st.runTransaction.
Do BaseSuite teardown last
Otherwise the mongo session is not available and the test run hangs.
Update the SetAdminMongoPassword tests for 3.2
The localhost exception no longer allows creation of the schema, so when
auth is enabled we always need to create an admin user before
initialising the state.

https://docs.mongodb.com/manual/core/security-users/#localhost-exception
Revert "WIP: keep database between tests"
This reverts commit aa4d79e.

It turns out that calling Initialize when the collections and indexes
already exist is fine. So rather than splitting out PopulateEmptyModel,
just call Initialize in setup and rely on it to do just the populate
part when the MgoSuite has cleared out the database.
Remove EnableJournal usage
Mongo is now always run in journalling mode for tests - in 3.2 it's
faster than without.
Ensure volumes are created in a consistent order
Otherwise the IDs of the volumes are nondeterministic - this was
causing *occasional* failures in the volume state tests.
Sort log entries by time then by ID
Otherwise logs created with the same timestamp would come back in
arbitrary order - this caused occasional test failures that are very
frustrating.
cmd/modelcmd: qualified names in GetCurrentModel
Change modelcmd.GetCurrentModel to qualify the returned
model name with the controller name, except in the case
of $JUJU_MODEL being set. Then, if there's a current
controller but no current model, we return "<controller>:"
to print out a more useful error message.

Fixes https://bugs.launchpad.net/juju-core/+bug/1505504
Removed rogue call to gc.TestingT
This was causing the mongo tests to run twice.
Catch "collection truncated" errors from Mongo 3.2
Running the mongo/oplog_test.go tests that truncate the oplog capped
collection against Mongo 3.2 sometimes produces the following error
instead of mgo.ErrCursor:

&mgo.QueryError{Code:17406, Message:"getMore executor error: OperationFailed: Operation aborted because: collection truncated", Assertion:false}
Stop passing enableTestCommands=1 to mongo
It's always passed by testing/mgo now.
apiserver/uniter: re-enable race tests
Fixes LP 1518809

Re-enable race tests for this package, the underlying issues has been
solved.
apiserver/provisioner: re-enable race test
Fixes LP 1517632

The tests pass under the race detector and the bug listed in the skip
message is incorrect so re-enable the test.
provider/azure: fix races
A recent change introduced concurrent API calls,
which in turn introduced a race in the tests. In
the tests we will now serialise all Azure API
calls and isolate concurrent calls during request
recording.

Fixes https://bugs.launchpad.net/juju-core/+bug/1585836
cmd/juju/commands: Fix SSH proxy command
In recent work, juju ssh was changed so that the "ubuntu" user was no
longer assumed when an arbitrary machine address was supplied. This
broke the ProxyCommand option when --proxy is passed, breaking SSH
access to containers (for MAAS and when the "address-allocation"
feature flag is enabled).

Fixes LP #1585388.
Merge pull request #5472 from mjs/1585388-container-ssh
cmd/juju/commands: Fix SSH proxy command

In recent work, juju ssh was changed so that the "ubuntu" user was no longer assumed when an arbitrary machine address was supplied. This broke the ProxyCommand option when --proxy is passed, breaking SSH access to containers (for MAAS and when the "address-allocation" feature flag is enabled).

Fixes LP #1585388.

(Review request: http://reviews.vapour.ws/r/4916/)
cmd/juju/cloud: add "remove-cloud" command
Add a command for removing personal clouds
from ~/.local/share/juju/clouds.yaml.
Merge pull request #5468 from davecheney/fixedbugs/1518820
environs/bootstrap: re-enable race test

Fixes LP 1518820

(Review request: http://reviews.vapour.ws/r/4912/)
Add cloud/region to controller details
Add the name of the cloud and region (if applicable)
to the controller details. This is included in the
output of list-controllers and show-controller, and
is stored in controllers.yaml.

In a follow-up, we will store cloud and credential
information in the controller (i.e. in mongo), which
will enable us to display the same information for
"registered" controllers. For now, registered
controllers lack that information.
Merge pull request #5437 from fwereade/untangle-agent-tests
rearrange agent tests; drop worker/testing; rename agent util packages

This looks fearsome, but it doesn't change behaviour at all, and even in the tests it only modifies the operation of MachineTest.TestDyingModelCleanedUp (which is clearly flaky and has been since the undertaker changed to nuke models immediately; not sure how it was passing in CI at all). All the rest is just:

  * moved cmd/jujud/agent/testing to cmd/jujud/agent/agenttest
  * moved cmd/jujud/agent/util to cmd/jujud/agent/engine
  * moved engine-relevant bits from worker/testing to cmd/jujud/agent/engine/enginetest
  * deleted the rest of worker/testing
  * extracted cmd/jujud/agent test suites into their own files
  * consolidated the not-clearly-differentiated bits of cmd/jujud/agent test infrastructure into util_test.go

(Review request: http://reviews.vapour.ws/r/4873/)
Merge pull request #5477 from anastasiamac/invalid-credentials-1514874
Fixes lp# 1514874: failures of valid credentials.

Failure to authorise is not the same as failure to authenticate.
Changed some BadCreds instances to ErrPerm and updated relevant tests.

(Review request: http://reviews.vapour.ws/r/4921/)
Correct patching of pickAddress
While investigating this test failing intermittently against mongo 3.2
it turned out that the patching done in the test wasn't doing
anything. Change this so that the code actually calls the patched function.
Merge pull request #5481 from dooferlad/master-fix-bridge-everything
Don't bridge inactive interfaces or already bridged interfaces.

Port of #5479

(Review request: http://reviews.vapour.ws/r/4926/)
Merge pull request #5482 from dooferlad/master-fix-routes
DHCP release/renew on new bridges

Port of #5459

$$fixes-1577945$$

(Review request: http://reviews.vapour.ws/r/4927/)
Merge pull request #5465 from davecheney/fixedbugs/1518809
apiserver/uniter: re-enable race tests

Fixes LP 1518809

Re-enable race tests for this package, the underlying issues has been
solved.

(Review request: http://reviews.vapour.ws/r/4909/)
Merge pull request #5466 from davecheney/fixedbugs/1517632
apiserver/provisioner: re-enable race test

Fixes LP 1517632

The tests pass under the race detector and the bug listed in the skip
message is incorrect so re-enable the test.

(Review request: http://reviews.vapour.ws/r/4910/)
Merge pull request #5485 from davecheney/worker-leadership-reenable-race
worker/leadership: reenable race tests

Fixes 1518806

(Review request: http://reviews.vapour.ws/r/4930/)
Merge pull request #5486 from davecheney/fixedbugs/1518807
apiserver/client: re-enable race test

Fixes LP 1518807

(Review request: http://reviews.vapour.ws/r/4931/)
Merge pull request #5467 from axw/lp1585836-azure-race
provider/azure: fix races

A recent change introduced concurrent API calls,
which in turn introduced a race in the tests. In
the tests we will now serialise all Azure API
calls and isolate concurrent calls during request
recording.

Fixes https://bugs.launchpad.net/juju-core/+bug/1585836

(Review request: http://reviews.vapour.ws/r/4911/)
Merge pull request #5488 from davecheney/fixedbugs/1519183
featuretests: re-enable race tests

Fixes LP 1519183

(Review request: http://reviews.vapour.ws/r/4933/)
Merge pull request #5478 from axw/list-controllers-cloud
Add cloud/region to controller details

Add the name of the cloud and region (if applicable)
to the controller details. This is included in the
output of list-controllers and show-controller, and
is stored in controllers.yaml. The existing "SERVER"
field in list-controllers tabular format is removed.

In a follow-up, we will store cloud and credential
information in the controller (i.e. in mongo), which
will enable us to display the same information for
"registered" controllers. For now, registered
controllers lack that information.

**QA**

1. Bootstrap (e.g. AWS)
2. Inspect output of "juju list-controllers", with
   and without --format=yaml.
3. Inspect output of "juju show-controller <controller>"
4. Repeat with "localhost" (lxd), or some other cloud
   without regions.

(Review request: http://reviews.vapour.ws/r/4922/)
Merge pull request #5489 from davecheney/fixedbugs/1519141
provider/ec2: re-enable race test

Fixed LP 1519141

(Review request: http://reviews.vapour.ws/r/4934/)

anastasiamac and others added some commits Jun 1, 2016

Merge pull request #5508 from anastasiamac/too-many-logins-master
Fixes LP#1514874 (master): login failures with valid credentials.

When we create agent configuration for juju entities, we do not specify password since we want to generate a new one. However, we do have access to the old password sent over wire.

Prior to this PR, we would try to login 3 times:
1. with no password and, as expected, we would fail with authentication issues;
2. with old password and will connect;
3. with newly generated/updated password.

This PR ensures that we do not try to login with no password.

(Review request: http://reviews.vapour.ws/r/4954/)
Owner

wallyworld commented Jun 1, 2016

$$merge$$

Contributor

jujubot commented Jun 1, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Merge pull request #5510 from frobware/master-store-bridge-script-in-…
…var-tmp

provider/maas: put bridge script in /var/tmp



(Review request: http://reviews.vapour.ws/r/4957/)
Contributor

jujubot commented Jun 1, 2016

Build failed: Generating tarball failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7938

Owner

wallyworld commented Jun 1, 2016

$$merge$$

Contributor

jujubot commented Jun 1, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 1, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7939

Owner

wallyworld commented Jun 1, 2016

$$merge$$

Contributor

jujubot commented Jun 1, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 1, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7940

Owner

wallyworld commented Jun 1, 2016

$$merge$$

Contributor

jujubot commented Jun 1, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 1, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7941

Owner

wallyworld commented Jun 1, 2016

$$merge$$

Contributor

jujubot commented Jun 1, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 1, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7942

Owner

wallyworld commented Jun 1, 2016

$$merge$$

Contributor

jujubot commented Jun 1, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 1, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7943

Merge pull request #5499 from babbageclunk/state-tests
Don't drop and recreate Mongo DB between tests

Part of fixing LP1573294 - https://bugs.launchpad.net/juju-core/+bug/1573294

Before these changes the state tests take ~4m50s on my machine with Mongo 2.4, and too long to run with 3.2.
After the changes they run in ~4m20s on 2.4 and ~6m55s on 3.2. Running the suite under Mongo3.2 is worse unfortunately, but not too much worse.

Updates the juju/testing dependency to the version that avoids dropping and recreating databases and collections (the operations that take much longer now in 3.2).

Running the tests after this change revealed a couple of places in the test suite where tests relied on under-constrained ordering, and reusing existing collections caused query results to come back in a different order which broke the tests. I fixed those by adding/tightening up the sorting in the code being tested (I saw other places in the code that did that to simplify testing, so it seemed reasonable).

(Review request: http://reviews.vapour.ws/r/4944/)
Owner

wallyworld commented Jun 1, 2016

$$merge$$

Contributor

jujubot commented Jun 1, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 1, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7947

Owner

wallyworld commented Jun 1, 2016

$$merge$$

Contributor

jujubot commented Jun 1, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 1, 2016

Build failed: Generating tarball failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7948

Owner

wallyworld commented Jun 1, 2016

$$merge$$

Contributor

jujubot commented Jun 1, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 1, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7949

Owner

wallyworld commented Jun 1, 2016

$$merge$$

Contributor

jujubot commented Jun 1, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 1, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7950

Owner

wallyworld commented Jun 2, 2016

$$merge$$

Contributor

jujubot commented Jun 2, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 2, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7951

Owner

wallyworld commented Jun 2, 2016

$$merge$$

Contributor

jujubot commented Jun 2, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 2, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7952

Owner

wallyworld commented Jun 2, 2016

$$merge$$

Contributor

jujubot commented Jun 2, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 2, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7953

Owner

wallyworld commented Jun 2, 2016

$$merge$$

Contributor

jujubot commented Jun 2, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 2, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7954

Owner

wallyworld commented Jun 2, 2016

$$merge$$

Contributor

jujubot commented Jun 2, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Jun 2, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/7955

Owner

wallyworld commented Jun 2, 2016

$$merge$$

Contributor

jujubot commented Jun 2, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 9850ae8 into juju:service-to-application Jun 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment