Skip to content

Commit

Permalink
Merge pull request juju#16321 from hmlanigan/local-charm-no-channel
Browse files Browse the repository at this point in the history
juju#16321

Our mocked tests should be more accurate. Otherwise it leads to false beliefs about normal code paths. A local charm must not have a channel, track/risk/branch, in its charm origin. Channels are not a concept that local charms understand.

This will have more impact in these tests in the 3.3 branch as the charm origin is validated in tests more.
## QA steps

This is a change to unit tests only, the GitHub action should succeed.
  • Loading branch information
jujubot authored Sep 29, 2023
2 parents 013c5e8 + 53c43c0 commit fb32124
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/juju/application/refresh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,20 @@ func (s *BaseRefreshSuite) setup(c *gc.C, currentCharmURL, latestCharmURL *charm
Meta: &charm.Meta{},
},
}
risk := "stable"
if charm.Local.Matches(currentCharmURL.Schema) {
// A local charm must never have a track, risk,
// nor branch.
risk = ""
}
s.charmAPIClient = mockCharmRefreshClient{
charmURL: currentCharmURL,
bindings: map[string]string{
"": network.AlphaSpaceName,
},
charmOrigin: commoncharm.Origin{
Source: schemaToOriginScource(currentCharmURL.Schema),
Risk: "stable",
Risk: risk,
},
}
s.modelConfigGetter = newMockModelConfigGetter()
Expand Down

0 comments on commit fb32124

Please sign in to comment.