marvelai-org / marvel-ai-backend

This is the Marvel Teaching Assistant ai repo.
MIT License
17 stars 85 forks source link

Pull Request - CI/CD Part 1 Dynamic Env - Digital Dreamers #100

Open xinpengwoo opened 2 months ago

xinpengwoo commented 2 months ago

Summary

The .env file with the utility function configures environment variables during local development. This allows developers to customize their local environment without affecting the production settings.

Changes

Testing

The new feature was tested using the following unit tests and integration tests. Refer to the documentation for more details.

I) Unit Tests

Steps to run the unit tests:

Execute the test command: pytest app/services/tests/test_env_manager.py Review the test output: after running the command, you’ll see output indicating whether the tests passed or failed. Expected Output: Upon successful execution, you should see the following output in terminal:

Screenshot 2024-09-07 at 12 03 21

II) Integration Tests

Steps to run the integration test: Run the Startup Script:

./local-start.sh

The script begins by setting up local environment variables required by the application. It authenticates the Google Cloud project using the service account credentials specified in the ‘local-auth.json’ file. The ‘get_env_variable’ function is called to fetch environment variables, ‘GOOGLE_API_KEY’, ‘ENV_TYPE’,and ‘PROJECT_ID’. These variables are either retrieved from the local ‘.env’ file or from Google Cloud Secret Manager if not found locally. Expected Output: Upon successful execution, you should see the following output in terminal:

Screenshot 2024-08-31 at 11 16 32

Results

The new feature passed the above-mentioned tests and performed its required function without breaking the existing codebase.

Notes