Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add unit tests for run_flow_from_json with fake environment variables #4015

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

edwinjosechittilappilly
Copy link
Collaborator

@edwinjosechittilappilly edwinjosechittilappilly commented Oct 3, 2024

Added Tests for run_flow_from_json Functionality

Description

This PR introduces new unit tests for the run_flow_from_json function to ensure it correctly handles environment variables. The following tests have been added:

  • test_run_flow_with_fake_env: Validates the flow execution using a fake .env file, ensuring that the expected output is returned.
  • test_run_flow_with_fake_env_TWEAKS: Checks the flow execution when environment variables are loaded from the fake .env file, confirming that the output matches the expected result.

Motivation

These tests enhance the reliability of the run_flow_from_json function by verifying its behavior with different configurations of environment variables, which is crucial for maintaining functionality in various deployment scenarios.

Changes

  • Added test_run_flow_with_fake_env to test flow execution with a fake environment.
  • Added test_run_flow_with_fake_env_TWEAKS to test flow execution with environment variables loaded from a fake .env file.
  • Implemented a function to recursively replace keys in the tweaks dictionary with values from the provided environment variables. This Fixes the issue of ENV variables not loading when using run_flow_from_json

- Implemented test_run_flow_with_fake_env to validate flow execution with a fake .env file.
- Added test_run_flow_with_fake_env_TWEAKS to check flow execution using environment variables loaded from the fake .env file.
@github-actions github-actions bot added the enhancement New feature or request label Oct 3, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4015.dmtpw4p5recq1.amplifyapp.com

…values

- Implemented a function to recursively replace keys in the tweaks dictionary with values from the provided environment variables.
@edwinjosechittilappilly edwinjosechittilappilly marked this pull request as ready for review October 3, 2024 21:51
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 3, 2024
@edwinjosechittilappilly edwinjosechittilappilly added the bug Something isn't working label Oct 3, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request bug Something isn't working labels Oct 3, 2024
Copy link
Member

@italojohnny italojohnny left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants