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

openai[patch]: Fix integration tests #5998

Merged
merged 7 commits into from
Jul 8, 2024
Merged

Conversation

bracesproul
Copy link
Member

@bracesproul bracesproul commented Jul 8, 2024

Tests which relied on callbacks are flaky if LANGCHAIN_CALLBACKS_BACKGROUND is set to true. This is due to those callback funcs not necessarily completing until after the parent fn (in this case a chat model) has resolved. To solve this, I wrapped those tests in a try { ... } finally { ... } and set LANGCHAIN_CALLBACKS_BACKGROUND to false at the start of the test, and inside the finally block I reset it to the original value.

I also updated the Azure test Test Azure ChatOpenAI with bearer token provider to first check if the required env vars are set. If they are, it runs the test as normal. If not, it marks the test as skipped. Ideally we remove this code once we get our hands on those vars 🙃

Copy link

vercel bot commented Jul 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2024 8:39pm
langchainjs-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2024 8:39pm

@bracesproul bracesproul marked this pull request as ready for review July 8, 2024 20:28
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. auto:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Jul 8, 2024
@@ -23,6 +25,9 @@ import {
} from "@azure/identity";
Copy link

Choose a reason for hiding this comment

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

Hey team, I've noticed that a new line has been added to save the original value of the 'LANGCHAIN_CALLBACKS_BACKGROUND' environment variable. This is just a heads up for the maintainers to review this change. Let me know if you need further assistance with this.

@@ -1,3 +1,5 @@
/* eslint-disable no-process-env */
Copy link

Choose a reason for hiding this comment

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

Hey there! I noticed that the recent change in the code includes a comment disabling the eslint rule for direct usage of process.env. This is flagged for your review to ensure proper handling of environment variables. Keep up the great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant