cmd/snap-update-ns: misc cleanups #4223

Merged
merged 4 commits into from Nov 15, 2017

Conversation

Projects
None yet
3 participants
Contributor

zyga commented Nov 15, 2017

This branch cleans up a few things I found while working on other parts of the code

zyga added some commits Nov 15, 2017

cmd/snap-update-ns: move changePerform around
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
cmd/snap-update-ns: fix typo
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
cmd/snap-update-ns: rename suite name
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
cmd/snap-update-ns: use existing variable in test
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
+// changePerform is Change.Perform that can be mocked for testing.
+var changePerform = func(chg *Change) ([]*Change, error) {
+ return chg.Perform()
+}
@chipaca

chipaca Nov 15, 2017

Member

you can write this like

var changePerform = (*Change).Perform
@zyga

zyga Nov 15, 2017

Contributor

I did this in a follow-up

codecov-io commented Nov 15, 2017

Codecov Report

Merging #4223 into master will increase coverage by 0.11%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4223      +/-   ##
==========================================
+ Coverage   75.86%   75.98%   +0.11%     
==========================================
  Files         440      440              
  Lines       38247    38377     +130     
==========================================
+ Hits        29016    29159     +143     
+ Misses       7218     7207      -11     
+ Partials     2013     2011       -2
Impacted Files Coverage Δ
cmd/snap-update-ns/main.go 39.06% <ø> (+0.6%) ⬆️
cmd/snap-update-ns/change.go 95.29% <0%> (-2.3%) ⬇️
snap/info_snap_yaml.go 97.03% <0%> (+2.81%) ⬆️
snap/info.go 86.05% <0%> (+5.3%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83636fb...4e11603. Read the comment docs.

@zyga zyga merged commit ae8660c into snapcore:master Nov 15, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@zyga zyga deleted the zyga:tweak/snap-update-ns-cleanups branch Nov 15, 2017

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