go-watson-sdk icon indicating copy to clipboard operation
go-watson-sdk copied to clipboard

Allow use with Alchemy API, test hygiene

Open danfairs opened this issue 8 years ago • 3 comments

This PR allows the use of go-watson-sdk with the AlchemyAPI, which can be authenticated against using only an API Key. Previously, such a client configuration would be rejected because a username and password was not present.

This patch adds tests for the existing client behaviour, as well as extending the validation to allow just an API key.

This patch also fixes a small bug with the existing tests, which would set the VCAP_SERVICES environment variable and never unset it, causing other tests (in the case, the ones added to test API key behaviour!) to fail unexpectedly.

danfairs avatar Aug 05 '16 11:08 danfairs

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 05 '16 11:08 CLAassistant

Actually - don't merge this yet, there are a number of failures in CI that look like they might have been caused by the change to the environment variable behaviour. I'll comment again (and add commits) when it's ready to go.

danfairs avatar Aug 05 '16 11:08 danfairs

OK - it looks like the tests are already failing on CI on master. I don't think this makes the situation any worse. If I get time, I'll try to see if I can make CI tests pass as well (though that might be difficult if they're actually accessing real services).

So if you're happy with this change @liviosoares then it's good to go.

danfairs avatar Aug 05 '16 11:08 danfairs