Skip to content

Conversation

@JoeZiminski
Copy link
Member

@JoeZiminski JoeZiminski commented Dec 19, 2025

This PR allows python-dotenv to be used to set environment variables for the AWS and GDrive tests. This makes it much easier to run the tests locally.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for python-dotenv to enable easier local testing of AWS and GDrive functionality by allowing developers to store test credentials in a .env file. The changes maintain backward compatibility with GitHub Actions while providing a more convenient way to manage test credentials locally.

  • Adds python-dotenv integration to load environment variables from a .env file
  • Updates documentation in test utility functions to explain the dotenv usage
  • Adds .env to .gitignore to prevent accidental credential commits

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
.gitignore Adds .env file exclusion to prevent test credentials from being committed
tests/tests_transfers/aws/aws_test_utils.py Imports and uses load_dotenv() for loading AWS test credentials, updates documentation and fixes "GitHub" capitalization
tests/tests_transfers/gdrive/gdrive_test_utils.py Imports and uses load_dotenv() for loading GDrive test credentials, adds documentation about dotenv usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +58 to +59
if not load_dotenv():
return False
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here will incorrectly return False if environment variables are set manually (not via .env file) when not running on GitHub Actions. The load_dotenv() function returns False when no .env file is found, even if the required environment variables are already set in the environment. Consider calling load_dotenv() without checking its return value, or restructure the logic to only use load_dotenv() as an attempt to load variables, not as a requirement.

Suggested change
if not load_dotenv():
return False
# Best-effort load from .env for local development; ignore return value
load_dotenv()

Copilot uses AI. Check for mistakes.
Comment on lines +70 to +71
if not load_dotenv():
return False
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here will incorrectly return False if environment variables are set manually (not via .env file) when not running on GitHub Actions. The load_dotenv() function returns False when no .env file is found, even if the required environment variables are already set in the environment. Consider calling load_dotenv() without checking its return value, or restructure the logic to only use load_dotenv() as an attempt to load variables, not as a requirement.

Suggested change
if not load_dotenv():
return False
# Attempt to load variables from a .env file if present, but do not
# treat the absence of a .env file as a failure condition.
load_dotenv()

Copilot uses AI. Check for mistakes.
@JoeZiminski JoeZiminski added this to the v0.8.0 milestone Dec 20, 2025
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.

2 participants