Skip to content

Conversation

jackson-drew
Copy link

@jackson-drew jackson-drew commented Oct 18, 2024

The issue here was caused by the testing being unable to locate a bucket at the given Couchbase connection string. This is configured by the user in the .env file, however the way this is setup now will cause testing to fail if the user does not have a valid bucket set up. While replicating this error we realized invalid COUCHBASE_CONNECTION_STRING, COUCHBASE_USERNAME, COUCHBASE_PASSWORD, or COUCHBASE_DEFAULT_BUCKET will all cause testing to fail.
Replication of Issue:
BucketNotFound

Our solution involved skipping the test if the user had not defined any of the aforementioned .env variables. We did this with a custom method which checks if they have all been defined by the user, and to only run testing once that has happened, skipping tests test_index and test_create_and_get_document if .env variables are not defined, this puts the exception as a responsibility of the user, and no longer a default of the template.
Default testing when the user has not defined .env values:
ExceptionSkip

@jackson-drew jackson-drew changed the title Used pytest SkipIf to skip the two tests causing the BucketNotFoundException Used pytest SkipIf to skip the two tests causing the BucketNotFoundException for Issue#1 Oct 18, 2024
Co-Author Xuan Hien Pham phamxuanhien02@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant