cloudant / python-cloudant

A Python library for Cloudant and CouchDB
Apache License 2.0
163 stars 55 forks source link

Added skip_if_iam to some tests that rely on a legacy password #448

Closed ricellis closed 5 years ago

ricellis commented 5 years ago

Checklist

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:

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

Monitoring and Logging