Proper way to "simulate" a snap refresh/release


Before releasing a revision I would like to make sure the snap upgrading from whatever the revision the channel holds to the new revision will not cause any unexpected behaviour.

For example, let say I have revision 50 in beta and would like to release revision 55. How could I test this transition? Is a “snap refresh mysnap --channel=edge” with edge holding revision 55 equivalent to what will happen if revision 55 is released on beta?


Yes, snap refresh mysnap --edge is equivalent to what would happen (except you’d then be tracking edge).

You can also, if you have developer access to the snap and have done snap login, do snap refresh mysnap --revision=55. This would get undone by the next automatic refresh though.

You can even do the revisioned refresh to an unreleased revision. For example, given that I can publish the http snap,

$ snapcraft push http_0.9.9-1.1_all.snap 
Pushing http_0.9.9-1.1_all.snap
Preparing to push '/tmp/http_0.9.9-1.1_all.snap' to the store.
Pushing http_0.9.9-1.1_all.snap [====================] 100%
Ready to release!
Revision 22 of 'http' created.

note that snap is not released to a channel:

$ snapcraft list-revisions http | head -n 2
Rev.    Uploaded              Arch       Version        Channels
22      2018-05-23T11:53:29Z  Arch: All  0.9.9-1.1      -

but even so

$ snap refresh http --revision=22
http 0.9.9-1.1 from 'chipaca' refreshed

but then

$ snap refresh http
http 0.9.9-1 from 'chipaca' refreshed


Thank you that covers it!

You can even do this with a snap you haven’t pushed to the store just by installing over the top of the one installed from the store using --dangerous.