[x] Added tests for code changes or test/build only changes
[x] Updated the change log file (CHANGES.md|CHANGELOG.md) or test/build only changes
[x] Completed the PR template below:
Description
1. Steps to reproduce and the simplest code sample possible to demonstrate the issue
Run tests with only IAM_API_KEY and CLOUDANT_ACCOUNT, but no DB_USER or DB_PASSWORD.
2. What you expected to happen
Tests to use IAM credentials and pass.
3. What actually happened
Two tests failed:
test_bluemix_constructor_specify_instance_name
test_cloudant_bluemix_dedicated_context_helper
Note these tests pass during the current master build because both legacy credentials and IAM credentials are supplied - meaning that these two tests pass with the supplied legacy creds instead of the IAM creds.
Approach
Skip running these tests when using IAM credentials.
These bluemix initialization tests make a connection to the service to test the init worked correctly. They use a username and password combination so can't work with an IAM API key without additional switching. While they pass in cases where both legacy creds and IAM creds are supplied, if only IAM creds are supplied they fail.
We could either add the switching to run them with IAM creds, but that's not really the point of the tests (note test_bluemix_constructor_with_iam exists for this). So instead we should disable them for IAM testing; noting that they run during legacy creds testing.
Schema & API Changes
"No change"
Security and Privacy
"No change"
Testing
Modified existing tests with @skip_if_iam to skip tests requiring legacy credentials.
Checklist
CHANGES.md
|CHANGELOG.md
) or test/build only changesDescription
1. Steps to reproduce and the simplest code sample possible to demonstrate the issue
Run tests with only
IAM_API_KEY
andCLOUDANT_ACCOUNT
, but noDB_USER
orDB_PASSWORD
.2. What you expected to happen
Tests to use IAM credentials and pass.
3. What actually happened
Two tests failed:
test_bluemix_constructor_specify_instance_name
test_cloudant_bluemix_dedicated_context_helper
Note these tests pass during the current
master
build because both legacy credentials and IAM credentials are supplied - meaning that these two tests pass with the supplied legacy creds instead of the IAM creds.Approach
Skip running these tests when using IAM credentials.
These bluemix initialization tests make a connection to the service to test the init worked correctly. They use a username and password combination so can't work with an IAM API key without additional switching. While they pass in cases where both legacy creds and IAM creds are supplied, if only IAM creds are supplied they fail.
We could either add the switching to run them with IAM creds, but that's not really the point of the tests (note
test_bluemix_constructor_with_iam
exists for this). So instead we should disable them for IAM testing; noting that they run during legacy creds testing.Schema & API Changes
Security and Privacy
Testing
@skip_if_iam
to skip tests requiring legacy credentials.Monitoring and Logging