feat: Add unit tests for run_flow_from_json with fake environment variables#4015
Merged
ogabrielluiz merged 24 commits intomainfrom Jan 31, 2025
Merged
feat: Add unit tests for run_flow_from_json with fake environment variables#4015ogabrielluiz merged 24 commits intomainfrom
ogabrielluiz merged 24 commits intomainfrom
Conversation
- 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.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
…values - Implemented a function to recursively replace keys in the tweaks dictionary with values from the provided environment variables.
jordanrfrazier
approved these changes
Oct 4, 2024
Contributor
|
Cannot auto-update because of conflicts. |
edwinjosechittilappilly
added a commit
that referenced
this pull request
Jan 31, 2025
…iables (#4015) * Add tests for run_flow_from_json with fake environment variables - 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. * Replace keys in tweaks with their corresponding environment variable values - Implemented a function to recursively replace keys in the tweaks dictionary with values from the provided environment variables. * updated to use better way to load test json file * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * refactor: improve test readability and consistency in load tests - Renamed variable `TWEAKS` to `tweaks_dict` for clarity and consistency across tests. - Updated test function names to follow a consistent naming convention. - Enhanced comments for better understanding of test intentions. - Minor formatting adjustments to improve code readability. * feat: add aload_flow_from_json and arun_flow_from_json to module exports * fix: correct file path handling in aload_flow_from_json function * fix: improve environment variable handling in aload_flow_from_json function --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Yukiyukiyeah
pushed a commit
that referenced
this pull request
Mar 31, 2025
…iables (#4015) * Add tests for run_flow_from_json with fake environment variables - 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. * Replace keys in tweaks with their corresponding environment variable values - Implemented a function to recursively replace keys in the tweaks dictionary with values from the provided environment variables. * updated to use better way to load test json file * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * refactor: improve test readability and consistency in load tests - Renamed variable `TWEAKS` to `tweaks_dict` for clarity and consistency across tests. - Updated test function names to follow a consistent naming convention. - Enhanced comments for better understanding of test intentions. - Minor formatting adjustments to improve code readability. * feat: add aload_flow_from_json and arun_flow_from_json to module exports * fix: correct file path handling in aload_flow_from_json function * fix: improve environment variable handling in aload_flow_from_json function --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added Tests for run_flow_from_json Functionality
Description
This PR introduces new unit tests for the
run_flow_from_jsonfunction to ensure it correctly handles environment variables. The following tests have been added:.envfile, ensuring that the expected output is returned..envfile, confirming that the output matches the expected result.Motivation
These tests enhance the reliability of the
run_flow_from_jsonfunction by verifying its behavior with different configurations of environment variables, which is crucial for maintaining functionality in various deployment scenarios.Changes
test_run_flow_with_fake_envto test flow execution with a fake environment.test_run_flow_with_fake_env_TWEAKSto test flow execution with environment variables loaded from a fake.envfile.run_flow_from_json