Removed old storage from tests. #4761

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

perrito666 commented Mar 16, 2016

No description provided.

@@ -333,12 +331,16 @@ func (s *toolsSuite) TestDownloadTopLevelPath(c *gc.C) {
s.testDownload(c, tools, "")
}
+/*
@wallyworld

wallyworld Mar 21, 2016

Owner

need to uncomment and fix test

@@ -183,7 +182,7 @@ var upgradeJujuTests = []struct {
currentVersion: "3.0.0-quantal-amd64",
agentVersion: "3.0.0",
args: []string{"--version", "3.2.0"},
- expectErr: "no tools available",
+ expectErr: "no matching tools available",
@wallyworld

wallyworld Mar 21, 2016

Owner

these are different errors - i am concerned the new code is not returning the original error

@@ -318,18 +317,16 @@ func (s *UpgradeJujuSuite) TestUpgradeJuju(c *gc.C) {
com := newUpgradeJujuCommand(test.upgradeMap)
if err := coretesting.InitCommand(com, test.args); err != nil {
if test.expectInitErr != "" {
- c.Check(err, gc.ErrorMatches, test.expectInitErr)
+ c.Assert(err, gc.ErrorMatches, test.expectInitErr)
@wallyworld

wallyworld Mar 21, 2016

Owner

we use Check() inside loops

+ versions, err := stor.AllMetadata()
+ for _, v := range versions {
+ err := stor.Remove(v.Version)
+ //c.Assert(err, jc.ErrorIsNil)
- versions := make([]version.Binary, len(tools))
- for i, v := range tools {
- versions[i], err = version.ParseBinary(v)
+ // versions := make([]version.Binary, len(tools))
if err != nil {
c.Assert(err, jc.Satisfies, series.IsUnknownOSForSeriesError)
+ continue
@wallyworld

wallyworld Mar 21, 2016

Owner

why this? we expect to be able to handle tools with an unknown OS.

@@ -866,7 +866,7 @@ func (s *BootstrapSuite) makeTestEnv(c *gc.C) {
c.Assert(err, jc.ErrorIsNil)
s.PatchValue(&juju.JujuPublicKey, sstesting.SignedMetadataPublicKey)
- envtesting.MustUploadFakeTools(s.toolsStorage, cfg.AgentStream(), cfg.AgentStream())
+ envtesting.MustUploadFakeToolsToSimpleStreams(s.toolsStorage, cfg.AgentStream(), cfg.AgentStream())
@wallyworld

wallyworld Mar 21, 2016

Owner

can we also then call s.toolStorage "s.simplestreamsToolsStorage" to disambiguate from tools storage used elsewhere

@wallyworld

wallyworld Mar 21, 2016

Owner

Actually,
MustUploadFakeToolsToDirectory
and
s.toolsDir
is better

@@ -56,8 +56,11 @@ func (s *bootstrapSuite) SetUpTest(c *gc.C) {
s.PatchValue(&envtools.DefaultBaseURL, storageDir)
stor, err := filestorage.NewFileStorageWriter(storageDir)
c.Assert(err, jc.ErrorIsNil)
+ // Upload tools to both release and devel streams since config will dictate that we
@wallyworld

wallyworld Mar 21, 2016

Owner

where do we upload to devel? I just see "released" below

- t, err := uploadFakeToolsVersion(stor, toolsDir, version)
+ meta, err := stor.Metadata(version)
+ ctool := &coretools.Tools{
+ Version: meta.Version,
@wallyworld

wallyworld Mar 21, 2016

Owner

this doesn't look right - how can we expect meta to be valid if err != nil

- s.CommonProvisionerSuite.PatchValue(&tools.DefaultBaseURL, storageDir)
- stor, err := filestorage.NewFileStorageWriter(storageDir)
- c.Assert(err, jc.ErrorIsNil)
+ //storageDir := c.MkDir()

@perrito666 perrito666 closed this Mar 23, 2016

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