Merge lp:~jtv/gwacl/require-storage-location into lp:gwacl
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | 218 |
Merged at revision: | 215 |
Proposed branch: | lp:~jtv/gwacl/require-storage-location |
Merge into: | lp:gwacl |
Diff against target: |
334 lines (+73/-48) 5 files modified
helpers_http_test.go (+3/-2) storage_base.go (+5/-14) storage_base_test.go (+44/-16) storage_test.go (+20/-16) testing_test.go (+1/-0) |
To merge this branch: | bzr merge lp:~jtv/gwacl/require-storage-location |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Review via email: mp+178721@code.launchpad.net |
Commit message
Make StorageContext.
Description of the change
Unfortunately, making this required is a runtime-
There was a lot of collateral damage, as expected. In particular, two storage tests relied on some arbitrary hard-coded names (not even mentioned in the tests themselves!) being identical between various helper functions. Luckily it wasn't hard to clean this up a bit. The tests themselves are now the only source of those arbitrary strings.
The test-helper factory for storage contexts sets an "unguessable" AzureEndpoint by default, so that we don't accidentally rely on such implicit connections here. Tests that need a known string, have to set one. As per the normal policy I used example.com, except of course in the tests for the functions that actually generate those strings. Those are already acceptance-tested against the real-world URLs, although it probably won't show up in the diff here.
Jeroen
Looks great! Good testing as always from you.
8 - Account: MakeRandomStrin g(10), StdEncoding. EncodeToString( MakeRandomByteS lice(10) ), g(10), StdEncoding. EncodeToString( MakeRandomByteS lice(10) ),
9 - Key: base64.
10 + Account: MakeRandomStrin
11 + Key: base64.
12 + AzureEndpoint: APIEndpoint("http://" + MakeRandomString(5) + ".example.com/"),
I'd like to just take a moment to bitch at gofmt for changing lines completely unrelated to the diff at hand. >:(
44 + if context. AzureEndpoint == APIEndpoint("") { New("no Azure blob storage endpoint specified"))
45 + panic(errors.
Can you mention the parameter by name please, it will save a confused developer from hunting down this line of source.