-
Notifications
You must be signed in to change notification settings - Fork 416
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
chore(langchain): fix flaky cassette tests, skipping logic #9768
Conversation
ddcf4a1
to
c139f43
Compare
Datadog ReportBranch report: ✅ 0 Failed, 137477 Passed, 40702 Skipped, 7h 46m 59.24s Total duration (3m 2.1s time saved) |
BenchmarksBenchmark execution time: 2024-07-29 21:54:17 Comparing candidate commit 3b416e1 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 214 metrics, 2 unstable metrics. |
33f1650
to
f6d7302
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9768 +/- ##
===========================================
- Coverage 74.48% 10.42% -64.07%
===========================================
Files 1391 1358 -33
Lines 128824 126595 -2229
===========================================
- Hits 95959 13193 -82766
- Misses 32865 113402 +80537 ☔ View full report in Codecov by Sentry. |
|
cc78aad
to
489597a
Compare
489597a
to
1b35dc4
Compare
5e0023c
to
d35e50e
Compare
…or langchain v0 tests
1ddb905
to
128dd49
Compare
128dd49
to
2c5b38c
Compare
e7c7e0a
to
6ef4e9a
Compare
…e for CI (#9997) Even after #9768 we're still seeing some tests be skipped on CI, specifically `langchain-community` tests even when `langchain>=0.1`. My suspicion is that the `sys.version_info < (0, 1, 0)` conditional that is used for the test skipping is too precise for the versions of Langchain being run on CI (not exactly sure what the issue is, but I've narrowed it down to that area). This PR only checks the major and minor version of Langchain being run ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
This PR attempts to address the flakiness and general (lack of) reliability of the LangChain test suite, and removes the flaky test markers from most langchain tests. No functionality has been changed, this PR focuses only on improving our test suite to be less flaky and be a better signal of our langchain library coverage.
Problems with LangChain test suite:
This PR solves the above problems by:
vcrpy
to version5.1.0
which is the version prior to the linked issue being introducedPATCH_LANGCHAIN_V0
constant from the patch file which appeared to not be truthful)(3, 10, 0)
as this may result in some edge cases. Do not skip Python 3.9 testing ontest_langchain_community.py
or community tests ontest_langchain_llmobs.py
.We have made some fuzzy approaches to handling Python 3.9 and langchain v0:
langchain v0
tests and onelangchain v1
test due to the cassette file being different across python 3.9 and python 3.10+. To avoid generating so many test cassette files, we have skipped these handful of tests only for Python 3.9.langchain (v0)
andlangchain_community (v1+)
, and only run those tests for respective langchain version environments.Checklist
Reviewer Checklist