Merge lp://staging/~allenap/gwacl/destroy-everything into lp://staging/gwacl

Proposed by Gavin Panella
Status: Needs review
Proposed branch: lp://staging/~allenap/gwacl/destroy-everything
Merge into: lp://staging/gwacl
Diff against target: 471 lines (+382/-11)
5 files modified
example/destroyer/run.go (+113/-0)
management_base.go (+31/-0)
management_base_test.go (+104/-0)
xmlobjects.go (+36/-1)
xmlobjects_test.go (+98/-10)
To merge this branch: bzr merge lp://staging/~allenap/gwacl/destroy-everything
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) Approve
Review via email: mp+177420@code.staging.launchpad.net

Commit message

Script to destroy most things belonging to a subscription.

Description of the change

I wrote this because I had loads of artifacts in my Azure account that would take me a day to remove, which is more time than it has taken to implement this script and run it.

Along the way I had to implement ListDisks() and ListStorageAccounts(). It also uncovered an error in the XML that's generated in TestStorageServicesUnmarshal(), which is an argument for using the example XML basically as-is from the Azure docs. This actually seems to be what we're doing these days, but it's interesting to note anyway.

To post a comment you must log in.
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

This looks helpful — although please say very clearly at the top of the destroyer program what it does! Otherwise people might expect it to prompt for the thing they want to delete, or something.

The literal XML in tests leads to funny situations, like "true|false" as a Boolean field, but it works for me.

One thing I'm not a fan of is the happy-path-only tests with names like TestFunction. When you push yourself there's usually a corner case you can find that could gainfully be tested. It's a useful habit not just for improving test coverage, but for honing testability skills as well — it trains you to recognize unnecessarily complex code, code that's hard to test exhaustively, unnecessary special cases, and forgotten corner cases.

Revision history for this message
Jeroen T. Vermeulen (jtv) :
review: Approve

Unmerged revisions

211. By Gavin Panella

Remove virtual networks too.

210. By Gavin Panella

Example script to destroy (almost) everything.

209. By Gavin Panella

Whitespace.

208. By Gavin Panella

New method ListDisks().

207. By Gavin Panella

New struct for Disks.

206. By Gavin Panella

New method, ListStorageAccounts.

205. By Gavin Panella

Invalid StorageServices template for test.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: