Files
langflow/src
Gabriel Luiz Freitas Almeida a3f7f918ea tests: add tests in lfx for 1.6.0 starter projects (#9997)
* tests: add 1.6.0 starter projects in lfx tests data

- Introduced multiple starter project JSON files, including "Basic Prompt Chaining", "Blog Writer", "Document Q&A", and others, to provide diverse templates for chatbot functionalities.
- Each project includes detailed descriptions and structured data to facilitate easy integration and usage.
- Enhanced the overall framework for building chatbots, content generation, and data processing tasks, improving user experience and flexibility in application development.

* test: add backward compatibility tests for starter projects from version 1.6.0

- Introduced a new test suite to validate that starter project templates from version 1.6.0 can be loaded without import errors.
- Implemented asynchronous fetching of starter project JSON files from GitHub and caching them locally for testing.
- Added multiple test cases to ensure the existence, validity, and proper execution of starter projects, while checking for import errors related to langflow and lfx modules.
- Enhanced overall test coverage for backward compatibility, ensuring existing projects remain functional with the latest codebase.

* feat(logging): add backwards compatibility module for lfx.logging.logger

- Introduced a new module to maintain compatibility for imports from lfx.logging.logger, redirecting functionality to lfx.log.logger.
- Ensured all original exports are preserved to facilitate a smooth transition for existing codebases relying on the previous import path.

* refactor(tests): replace aiohttp with httpx for async HTTP requests in backward compatibility tests

- Updated the test suite to utilize httpx for asynchronous HTTP requests instead of aiohttp, enhancing performance and compatibility.
- Improved error handling by checking response status codes and ensuring proper JSON parsing.
- Added handling for known failing starter projects due to import issues in version 1.6.0, marking them as expected failures in tests.
- Enhanced documentation within tests to clarify known issues with specific starter projects.

* refactor(tests): simplify starter project path retrieval and remove unused async fetching

- Refactored the test suite to streamline the retrieval of starter project paths, eliminating the need for asynchronous fetching from GitHub.
- Updated the `get_starter_projects_path` function to directly return the local path for cached starter projects.
- Removed redundant code related to GitHub API calls and caching logic, enhancing test clarity and performance.
- Adjusted test cases to ensure they continue to validate the existence and format of starter project files effectively.

* test(cli): add tests for --format option behavior in error messages

- Introduced two new tests to validate the application of the --format option to error messages in the CLI.
- The first test checks that error messages are returned as plain text when the --format option is set to "text".
- The second test ensures that even with the --verbose flag, the output remains valid JSON when the --format option is set to "json".
- Both tests are marked as expected failures to document current limitations and guide future fixes.
2025-10-10 13:12:25 +00:00
..