You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖:bugRelated to a bug, vulnerability, unexpected error with an existing feature🤖:docsChanges to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder
The refactoring changes in this PR which changed the path of files from langchain/* to libs/langchain/langchain/*. But, the corresponding import statements are not refactored which is causing the tests to fail during local development.
Also, in that PR they added a new GitHub workflow which sets the working directory path to libs/langchian to run the unit tests in that path as part of CI. But, wondering how do we run them on the local machine. Also, the CI doesn't cover the integration tests, so how do we validate them after adding new tests.
Suggestion:
Please provide if there is any alternative way to run them and also update the corresponding documentation. Thanks!
The text was updated successfully, but these errors were encountered:
dosubotbot
added
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
🤖:docs
Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder
labels
Jul 25, 2023
I understand that you're having trouble with the refactoring changes in a recent pull request, which have caused the tests to fail during local development. This is due to the path of files being changed from langchain/* to libs/langchain/langchain/*, but the corresponding import statements were not updated. You're also unsure about how to run the tests locally and validate them, as the new GitHub workflow only covers unit tests and not integration tests.
To address your issue, you can run the unit tests locally by navigating to the libs/langchain directory and using the make test command. This command utilizes the pytest Python testing tool to execute the tests located in the tests/unit_tests/ directory. If you wish to run a specific test file, you can specify the path to the file using the TEST_FILE variable like this: make test TEST_FILE=tests/unit_tests/my_test_file.py.
For the integration tests, you can use the make integration_tests command, which also uses pytest to run the tests located in the tests/integration_tests/ directory.
Here are the commands for your reference:
# Run all unit tests
make test# Run a specific unit test file
make test TEST_FILE=tests/unit_tests/my_test_file.py
# Run all integration tests
make integration_tests
As for the import statements that were not refactored, you'll need to manually update them in your test files to match the new file paths. For instance, if a file was moved from langchain/my_file.py to libs/langchain/langchain/my_file.py, you should update the import statement from import langchain.my_file to import libs.langchain.langchain.my_file.
While the CI currently doesn't cover the integration tests, it's important to manually run them after adding new tests to ensure they pass. You might also want to consider updating the CI workflow to include the integration tests.
This is one potential solution to your issue. If you find this solution correct and believe it's a bug that could impact other users, I encourage you to make a pull request with the necessary changes. If this solution doesn't align with your experience, I recommend upgrading to the latest version of LangChain to see if the issue persists.
This response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
🤖:bugRelated to a bug, vulnerability, unexpected error with an existing feature🤖:docsChanges to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder
Issue you'd like to raise.
The refactoring changes in this PR which changed the path of files from
langchain/*
tolibs/langchain/langchain/*
. But, the corresponding import statements are not refactored which is causing the tests to fail during local development.Also, in that PR they added a new GitHub workflow which sets the working directory path to
libs/langchian
to run the unit tests in that path as part of CI. But, wondering how do we run them on the local machine. Also, the CI doesn't cover the integration tests, so how do we validate them after adding new tests.Suggestion:
Please provide if there is any alternative way to run them and also update the corresponding documentation. Thanks!
@hwchase17 @baskaryan
The text was updated successfully, but these errors were encountered: