Skip to content

Commit 39229f9

Browse files
authored
ci[patch]: Focus yarn install (#6284)
* ci[patch]: Focus yarn install * add back format, dont run ci in some cases * cr * cr * cr * cr * cr * cr * cr * cr
1 parent 58e211d commit 39229f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+138
-57
lines changed

Diff for: .github/workflows/ci.yml

+5-26
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
name: CI
55

66
on:
7-
push:
8-
branches: ["main"]
97
pull_request:
10-
# Do not run this workflow if only docs changed.
11-
paths-ignore:
8+
paths_ignore:
129
- 'docs/**'
10+
- 'dependency_range_tests/**'
11+
- 'environment_tests/**'
12+
- '.github/**'
13+
- '!.github/workflows/ci.yml'
1314
workflow_dispatch: # Allows triggering the workflow manually in GitHub UI
1415

1516

@@ -38,25 +39,3 @@ jobs:
3839
run: yarn install --immutable --mode=skip-build
3940
- name: Check linting
4041
run: yarn run lint
41-
42-
test-exports:
43-
uses:
44-
./.github/workflows/test-exports.yml
45-
secrets: inherit
46-
47-
platform-compatibility:
48-
runs-on: ${{ matrix.os }}
49-
strategy:
50-
matrix:
51-
os: [ubuntu-latest, windows-latest, macos-latest]
52-
steps:
53-
- uses: actions/checkout@v4
54-
- name: Use Node.js ${{ env.NODE_VERSION }}
55-
uses: actions/setup-node@v3
56-
with:
57-
node-version: ${{ env.NODE_VERSION }}
58-
cache: "yarn"
59-
- name: Install dependencies
60-
run: yarn install --immutable
61-
- name: Build `@langchain/core`
62-
run: yarn build --filter=@langchain/core

Diff for: .github/workflows/compatibility.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on:
44
push:
55
branches: ["main"]
66
pull_request:
7-
# Do not run this workflow if only docs/examples changed.
8-
paths-ignore:
9-
- 'docs/**'
10-
- 'examples/**'
7+
# Only run this workflow if the following directories have changed.
8+
paths:
9+
- 'langchain/**'
10+
- 'langchain-core/**'
11+
- 'libs/**'
1112
workflow_dispatch: # Allows triggering the workflow manually in GitHub UI
1213

1314
# If another push to the same PR or branch happens while this workflow is still running,

Diff for: .github/workflows/format.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
name: Format
44

55
on:
6-
push:
7-
branches: ["main"]
86
pull_request:
7+
paths_ignore:
8+
- '.github/**'
99
workflow_dispatch: # Allows triggering the workflow manually in GitHub UI
1010

1111

Diff for: .github/workflows/platform-compatibility.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Platform Compatibility
5+
6+
on:
7+
pull_request:
8+
# Only run this workflow if the following directories have changed.
9+
paths:
10+
- 'langchain/**'
11+
- 'langchain-core/**'
12+
- 'libs/**'
13+
workflow_dispatch: # Allows triggering the workflow manually in GitHub UI
14+
15+
16+
# If another push to the same PR or branch happens while this workflow is still running,
17+
# cancel the earlier run in favor of the next run.
18+
#
19+
# There's no point in testing an outdated version of the code. GitHub only allows
20+
# a limited number of job runners to be active at the same time, so it's better to cancel
21+
# pointless jobs early so that more useful jobs can run sooner.
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
platform-compatibility:
28+
runs-on: ${{ matrix.os }}
29+
strategy:
30+
matrix:
31+
os: [ubuntu-latest, windows-latest, macos-latest]
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Use Node.js ${{ env.NODE_VERSION }}
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: ${{ env.NODE_VERSION }}
38+
cache: "yarn"
39+
- name: Install dependencies
40+
run: cd ./langchain-core && yarn workspaces focus
41+
- name: Build @langchain/scripts
42+
run: cd ./libs/langchain-scripts && yarn build:internal
43+
- name: Build `@langchain/core`
44+
run: cd ./langchain-core && yarn build:internal

Diff for: .github/workflows/test-exports.yml

-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ on:
99
- 'libs/langchain-anthropic/**'
1010
- 'libs/langchain-community/**'
1111
- 'libs/langchain-openai/**'
12-
- 'examples/**'
1312
workflow_dispatch: # Allows triggering the workflow manually in GitHub UI
14-
workflow_call: # Allows triggering the workflow from another workflow
1513

1614
# If another push to the same PR or branch happens while this workflow is still running,
1715
# cancel the earlier run in favor of the next run.

Diff for: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

+28
Large diffs are not rendered by default.

Diff for: .yarnrc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ nodeLinker: node-modules
33
plugins:
44
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
55
spec: "@yarnpkg/plugin-typescript"
6+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
7+
spec: "@yarnpkg/plugin-workspace-tools"
68

79
supportedArchitectures:
810
cpu:

Diff for: langchain-core/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@langchain/scripts": "~0.0.20",
6060
"@swc/core": "^1.3.90",
6161
"@swc/jest": "^0.2.29",
62+
"@types/decamelize": "^1.2.0",
6263
"@types/mustache": "^4",
6364
"dpdm": "^3.12.0",
6465
"eslint": "^8.33.0",

Diff for: langchain-core/src/caches/tests/in_memory_cache.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { test, expect } from "@jest/globals";
12
import { MessageContentComplex } from "../../messages/base.js";
23
import { InMemoryCache } from "../base.js";
34

Diff for: langchain-core/src/callbacks/tests/manager.int.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable no-process-env */
2-
import { test } from "@jest/globals";
2+
import { test, expect } from "@jest/globals";
33

44
import { PromptTemplate } from "../../prompts/prompt.js";
55
import { FakeLLM } from "../../utils/testing/index.js";

Diff for: langchain-core/src/callbacks/tests/run_collector.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { v4 as uuidv4, validate } from "uuid";
22
import { Run } from "langsmith/schemas";
3+
import { describe, it, expect } from "@jest/globals";
34
import {
45
ChatPromptTemplate,
56
HumanMessagePromptTemplate,

Diff for: langchain-core/src/language_models/tests/chat_models.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-promise-executor-return */
22

3-
import { test } from "@jest/globals";
3+
import { test, expect } from "@jest/globals";
44
import { z } from "zod";
55
import { zodToJsonSchema } from "zod-to-json-schema";
66
import { FakeChatModel, FakeListChatModel } from "../../utils/testing/index.js";

Diff for: langchain-core/src/language_models/tests/llms.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-promise-executor-return */
22

3-
import { test } from "@jest/globals";
3+
import { test, expect } from "@jest/globals";
44
import { FakeLLM, FakeStreamingLLM } from "../../utils/testing/index.js";
55
import { HumanMessagePromptTemplate } from "../../prompts/chat.js";
66

Diff for: langchain-core/src/messages/tests/message_utils.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { it, expect } from "@jest/globals";
1+
import { it, describe, test, expect } from "@jest/globals";
22
import {
33
filterMessages,
44
mergeMessageRuns,

Diff for: langchain-core/src/output_parsers/openai_tools/tests/json_output_tools_parser.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { test } from "@jest/globals";
1+
import { test, expect } from "@jest/globals";
22
import { z } from "zod";
33
import { JsonOutputKeyToolsParser } from "../json_output_tools_parsers.js";
44
import { AIMessage } from "../../../messages/index.js";

Diff for: langchain-core/src/output_parsers/tests/json.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { test, expect } from "@jest/globals";
12
import { ChatPromptTemplate } from "../../prompts/chat.js";
23
import { RunnableSequence } from "../../runnables/base.js";
34
import { RunnablePassthrough } from "../../runnables/passthrough.js";

Diff for: langchain-core/src/output_parsers/tests/output_parser.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-loop-func */
22
/* eslint-disable no-promise-executor-return */
33

4-
import { test } from "@jest/globals";
4+
import { test, expect } from "@jest/globals";
55
import { FakeStreamingLLM } from "../../utils/testing/index.js";
66
import { BytesOutputParser } from "../bytes.js";
77
import {

Diff for: langchain-core/src/output_parsers/tests/string.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe } from "@jest/globals";
1+
import { describe, test, expect } from "@jest/globals";
22
import { StringOutputParser } from "../string.js";
33
import {
44
AIMessage,

Diff for: langchain-core/src/output_parsers/tests/xml.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { test, expect } from "@jest/globals";
12
import { FakeStreamingLLM } from "../../utils/testing/index.js";
23
import { XMLOutputParser } from "../xml.js";
34

Diff for: langchain-core/src/prompts/tests/few_shot.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, test } from "@jest/globals";
1+
import { expect, describe, test } from "@jest/globals";
22
import {
33
FewShotChatMessagePromptTemplate,
44
FewShotPromptTemplate,

Diff for: langchain-core/src/prompts/tests/structured.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import { ZodType, ZodTypeDef } from "zod";
3+
import { test, expect } from "@jest/globals";
34
import {
45
StructuredOutputMethodParams,
56
StructuredOutputMethodOptions,

Diff for: langchain-core/src/runnables/tests/runnable.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import { Run } from "langsmith";
66
import { v4 as uuidv4 } from "uuid";
7-
import { jest } from "@jest/globals";
7+
import { jest, test, expect, describe } from "@jest/globals";
88
import { createChatMessageChunkEncoderStream } from "../../language_models/chat_models.js";
99
import { BaseMessage, HumanMessage } from "../../messages/index.js";
1010
import { OutputParserException } from "../../output_parsers/base.js";

Diff for: langchain-core/src/runnables/tests/runnable_binding.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-promise-executor-return */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
3-
import { test } from "@jest/globals";
3+
import { test, expect } from "@jest/globals";
44
import { StringOutputParser } from "../../output_parsers/string.js";
55
import { FakeChatModel, FakeStreamingLLM } from "../../utils/testing/index.js";
66

Diff for: langchain-core/src/runnables/tests/runnable_branch.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-promise-executor-return */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
33

4-
import { test } from "@jest/globals";
4+
import { test, expect } from "@jest/globals";
55
import { RunnableBranch } from "../branch.js";
66
import { ChatPromptTemplate } from "../../prompts/chat.js";
77
import { FakeStreamingLLM } from "../../utils/testing/index.js";

Diff for: langchain-core/src/runnables/tests/runnable_graph.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable no-promise-executor-return */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
3+
import { test, expect } from "@jest/globals";
34
import { StringOutputParser } from "../../output_parsers/string.js";
45
import { FakeLLM } from "../../utils/testing/index.js";
56
import { PromptTemplate } from "../../prompts/prompt.js";

Diff for: langchain-core/src/runnables/tests/runnable_history.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { test, expect } from "@jest/globals";
12
import {
23
AIMessage,
34
AIMessageChunk,

Diff for: langchain-core/src/runnables/tests/runnable_interface.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable no-promise-executor-return */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
33

4+
import { test, expect } from "@jest/globals";
45
import { StringOutputParser } from "../../output_parsers/string.js";
56
import { PromptTemplate } from "../../prompts/prompt.js";
67
import { RunnableSequence } from "../base.js";

Diff for: langchain-core/src/runnables/tests/runnable_map.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable no-promise-executor-return */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
33

4+
import { test, expect } from "@jest/globals";
45
import { StringOutputParser } from "../../output_parsers/string.js";
56
import {
67
ChatPromptTemplate,

Diff for: langchain-core/src/runnables/tests/runnable_passthrough.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { test, expect } from "@jest/globals";
12
import { PromptTemplate } from "../../prompts/prompt.js";
23
import { FakeChatModel } from "../../utils/testing/index.js";
34
import { RunnablePassthrough } from "../passthrough.js";

Diff for: langchain-core/src/runnables/tests/runnable_remote.int.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { test, expect } from "@jest/globals";
12
import { HumanMessage } from "../../messages/index.js";
23
import { applyPatch } from "../../utils/json_patch.js";
34
import { RemoteRunnable } from "../remote.js";

Diff for: langchain-core/src/runnables/tests/runnable_remote.test.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
/* eslint-disable no-promise-executor-return */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
3-
import { jest, test } from "@jest/globals";
3+
import {
4+
jest,
5+
test,
6+
expect,
7+
describe,
8+
beforeEach,
9+
afterEach,
10+
} from "@jest/globals";
411
import {
512
AIMessage,
613
AIMessageChunk,

Diff for: langchain-core/src/runnables/tests/runnable_retry.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-promise-executor-return */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
33

4-
import { test } from "@jest/globals";
4+
import { test, expect } from "@jest/globals";
55
import { RunnableLambda } from "../base.js";
66

77
test("RunnableRetry invoke", async () => {

Diff for: langchain-core/src/runnables/tests/runnable_stream_events.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-disable no-process-env */
33
/* eslint-disable @typescript-eslint/no-explicit-any */
44

5-
import { test } from "@jest/globals";
5+
import { test, expect, afterEach } from "@jest/globals";
66
import { z } from "zod";
77
import {
88
RunnableLambda,

Diff for: langchain-core/src/runnables/tests/runnable_stream_events_v2.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-disable no-process-env */
33
/* eslint-disable @typescript-eslint/no-explicit-any */
44

5-
import { test } from "@jest/globals";
5+
import { test, expect, afterEach } from "@jest/globals";
66
import { z } from "zod";
77
import {
88
RunnableLambda,

Diff for: langchain-core/src/runnables/tests/runnable_stream_log.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-promise-executor-return */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
33

4-
import { test } from "@jest/globals";
4+
import { test, expect } from "@jest/globals";
55
import {
66
ChatPromptTemplate,
77
HumanMessagePromptTemplate,

Diff for: langchain-core/src/runnables/tests/runnable_tools.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { z } from "zod";
2+
import { test, expect } from "@jest/globals";
23
import { RunnableLambda, RunnableToolLike } from "../base.js";
34
import { FakeRetriever } from "../../utils/testing/index.js";
45
import { Document } from "../../documents/document.js";

Diff for: langchain-core/src/runnables/tests/runnable_tracing.int.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Client } from "langsmith";
2+
import { test } from "@jest/globals";
23
import { LangChainTracer } from "../../tracers/tracer_langchain.js";
34
import {
45
BaseOutputParser,

Diff for: langchain-core/src/runnables/tests/runnable_with_fallbacks.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-promise-executor-return */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
3-
import { test } from "@jest/globals";
3+
import { test, expect } from "@jest/globals";
44
import { FakeLLM } from "../../utils/testing/index.js";
55

66
test("RunnableWithFallbacks", async () => {

Diff for: langchain-core/src/structured_query/tests/utils.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable no-process-env */
2-
import { test } from "@jest/globals";
2+
import { test, expect } from "@jest/globals";
33
import { castValue, isFloat, isInt, isString } from "../utils.js";
44

55
test("Casting values correctly", () => {

Diff for: langchain-core/src/tracers/tests/langchain_tracer.int.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-process-env */
22
import * as uuid from "uuid";
3-
import { test } from "@jest/globals";
3+
import { test, expect } from "@jest/globals";
44

55
import { LangChainTracer, Run } from "../tracer_langchain.js";
66
import { Serialized } from "../../load/serializable.js";

Diff for: langchain-core/src/tracers/tests/langsmith_interop.test.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
/* eslint-disable no-process-env */
33
/* eslint-disable no-promise-executor-return */
44

5-
import { jest } from "@jest/globals";
5+
import {
6+
jest,
7+
test,
8+
beforeEach,
9+
afterEach,
10+
afterAll,
11+
expect,
12+
} from "@jest/globals";
613
import { traceable } from "langsmith/traceable";
714

815
import { RunnableLambda } from "../../runnables/base.js";

0 commit comments

Comments
 (0)